Skip to content

Commit

Permalink
Merge pull request #247 from GermanZero-de/236-fix-deployments-affect…
Browse files Browse the repository at this point in the history
…ing-both-envs

[#236] Fix deployments always affecting both environments
  • Loading branch information
mdrie authored Jul 13, 2023
2 parents b0140c6 + 5b56e45 commit 9caaad5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,17 @@ docker compose up -d
docker load -i /tmp/cpmonitor.tar
docker load -i /tmp/klimaschutzmonitor-dbeaver.tar
```
(Docker should print "Loading layer" for both images.)
8. Tag the images with the current date in case we want to roll back:
(Docker should print "Loading layer" for both images.)
8. Tag the images with the current date in case we want to roll back, as well as with the environment you're deploying to (to prevent affecting the other environment):
```sh
DATESTR=$(date +%Y-%b-%d) && echo ${DATESTR}
docker tag cpmonitor:latest cpmonitor:${DATESTR}
docker tag cpmonitor:latest cpmonitor:<testing|production>
docker tag klimaschutzmonitor-dbeaver:latest klimaschutzmonitor-dbeaver:${DATESTR}
docker tag klimaschutzmonitor-dbeaver:latest klimaschutzmonitor-dbeaver:<testing|production>
```
9. Stop the server, apply the migrations, start the server:
```sh
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
build:
context: ./
dockerfile: ./docker/cpmonitor/Dockerfile
image: cpmonitor
image: cpmonitor:${ENVIRONMENT_NAME}
user: "1007"
volumes:
- ${DB_PATH?:Please set the DB_PATH environment variable.}:/db
Expand Down Expand Up @@ -40,7 +40,7 @@ services:
dbeaver:
build: ./docker/dbeaver
container_name: dbeaver-${ENVIRONMENT_NAME}
image: klimaschutzmonitor-dbeaver
image: klimaschutzmonitor-dbeaver:${ENVIRONMENT_NAME}
volumes:
- ${DB_PATH?:Please set the DB_PATH environment variable.}:/db
networks:
Expand Down

0 comments on commit 9caaad5

Please sign in to comment.