-
Notifications
You must be signed in to change notification settings - Fork 0
Golang Project Orchestration
Vojtech Mašek edited this page Aug 19, 2019
·
2 revisions
All Golang projects use Docker with Kubernetes as a development and production environments. Please follow the Golang installation guide to set up a proper environment. Nothing else will be needed.
deps:
docker-compose up deps
build: deps
docker-compose build
dev:
docker-compose up dev
deploy:
docker-compose up deploy
clean:
docker-compose down
Makefile only supports tabs, not spaces. When this error occurs, use your IDE to convert indent from spaces to tabs.
FROM golang
# Need this for dependency management
RUN curl https://glide.sh/get | sh
# Test watcher
RUN go get github.com/smartystreets/goconvey
# goconvey port
EXPOSE 8080
version: '2'
services:
init:
build: .
image: ${ORGANIZATION}/${PROJECT_NAME}
volumes:
- .:${PROJECT_PATH}:Z
working_dir: ${PROJECT_PATH}
command: bash -c "glide init --non-interactive"
dev:
build: .
image: ${ORGANIZATION}/${PROJECT_NAME}
volumes:
- .:${PROJECT_PATH}:Z
working_dir: ${PROJECT_PATH}
command: bash -c "glide install && go install ${CMD_GOPATH} && ${PROJECT_CMD_NAME}"
ports:
- 3000:3000
- 3001:3001
- 8080:8080
links:
- dev_db
test-dev:
build: .
image: ${ORGANIZATION}/${PROJECT_NAME}
volumes:
- .:${PROJECT_PATH}:Z
working_dir: ${PROJECT_PATH}
command: bash -c ""
empty:
build: .
image: ${ORGANIZATION}/${PROJECT_NAME}
volumes:
- .:${PROJECT_PATH}:Z
working_dir: ${PROJECT_PATH}
command: tail -f /dev/null
dev_db:
image: postgres
container_name: ${PROJECT_NAME}_dev_db
environment:
- POSTGRES_USER=goo
- POSTGRES_PASSWORD=goo
ports:
- 5432:5432
This step can be executed every time you want to start developing the project. It automatically starts tests and re-execution when a file is saved.
$ make dev
Docker images for development should be automatically built. However, if you change Dockerfile
, you need to manually rebuild the images.
$ make build
$ make clean
@TODO
-
FE / Angular
-
Golang
-
DevOps
-
Agile process and SCRUM
-
Internship
-
Bootcamp