diff --git a/Dockerfile-dev b/Dockerfile-dev index b510df5e..11f1fc97 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -2,13 +2,13 @@ FROM golang:1.10.3-alpine RUN apk update && apk add git g++ libstdc++ ca-certificates -WORKDIR $GOPATH/src/github.com/hunterlong/statup/ +WORKDIR $GOPATH/src/github.com/hunterlong/statup COPY . . RUN go get github.com/GeertJohan/go.rice/rice RUN cd cmd && go get -d -v RUN cd source && rice embed-go -RUN cd cmd && go install +RUN cd cmd && go install && mv $GOPATH/bin/cmd /usr/local/bin/statup RUN wget -q https://assets.statup.io/sass && \ chmod +x sass && \ @@ -24,4 +24,4 @@ RUN printf "#!/usr/bin/env sh\n\$1\n" > $CMD_FILE && \ WORKDIR /app VOLUME /app EXPOSE 8080 -CMD ["/go/bin/statup"] \ No newline at end of file +ENTRYPOINT statup \ No newline at end of file diff --git a/Makefile b/Makefile index c9341ddd..02be2984 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=0.37 +VERSION=0.38 GOPATH:=$(GOPATH) GOCMD=`which go` GOBUILD=$(GOCMD) build @@ -11,6 +11,7 @@ BUILDVERSION=-ldflags="-X main.VERSION=$(VERSION)" BINARY_NAME=statup RICE=$(GOPATH)/bin/rice DOCKER=`which docker` +DOCKER_COMP=`which docker-compose` PATH:=/usr/local/bin:$(GOPATH)/bin:$(PATH) all: deps compile install clean @@ -63,6 +64,9 @@ docker-run: docker docker-dev-run: docker-dev $(DOCKER) run -t -p 8080:8080 hunterlong/statup:dev +docker-test: docker-dev + $(DOCKER_COMP) -f servers/docker-compose-test.yml up + databases: $(DOCKER) run --name statup_postgres -p 5432:5432 -e POSTGRES_PASSWORD=password123 -e POSTGRES_USER=root -e POSTGRES_DB=root -d postgres $(DOCKER) run --name statup_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password123 -e MYSQL_DATABASE=root -d mysql diff --git a/servers/docker-compose-test.yml b/servers/docker-compose-test.yml new file mode 100644 index 00000000..93247eb6 --- /dev/null +++ b/servers/docker-compose-test.yml @@ -0,0 +1,51 @@ +version: '2.3' + +services: + + statup: + container_name: statup + image: hunterlong/statup:dev + networks: + - internet + - database + depends_on: + - postgres_statup + - postgres_mysql + entrypoint: + - "sleep 30 && cd /go/src/github.com/hunterlong/statup && go test -v ./..." + environment: + GO_ENV: test + DB_CONN: postgres + DB_HOST: postgres_statup + DB_USER: root + DB_PASS: root + DB_DATABASE: statup + NAME: EC2 Example + DESCRIPTION: This is a Statup Docker Compose instance + + postgres_statup: + container_name: postgres_statup + image: postgres + restart: always + networks: + - database + environment: + POSTGRES_PASSWORD: password123 + POSTGRES_USER: statup + POSTGRES_DB: statup + + postgres_mysql: + container_name: mysql_statup + image: mysql + restart: always + networks: + - database + environment: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statup + +networks: + internet: + driver: bridge + database: + driver: bridge \ No newline at end of file diff --git a/source/tmpl/logs.html b/source/tmpl/logs.html new file mode 100644 index 00000000..4e32b505 --- /dev/null +++ b/source/tmpl/logs.html @@ -0,0 +1,44 @@ + + +
+ + +{{if USE_CDN}} + + +{{ else }} + + +{{end}} +