Production build uses commit hashes from submodules

This commit is contained in:
FinnStutzenstein 2020-02-28 12:55:21 +01:00
parent 67e519a00f
commit 741a13eeb7
6 changed files with 22 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
*~ *~
.DS_Store .DS_Store
.idea .idea
.env
# Old OS3 files and folders # Old OS3 files and folders
.coverage .coverage

View File

@ -56,6 +56,15 @@ required (phony) targets are:
- `run-tests`: Execute all tests from the submodule - `run-tests`: Execute all tests from the submodule
- `build-dev`: Build an image with the tag `openslides-<service>-dev` - `build-dev`: Build an image with the tag `openslides-<service>-dev`
### Build arguments in the Dockerfile
These build arguments should be supported by every service:
- `REPOSITORY_URL`: The git-url for the repository to use
- `GIT_CHECKOUT`: A branch/tag/commit to check out during the build
Note that meaningful defaults should be provided in the Dockerfile.
## Developing on a single service ## Developing on a single service
Go to the serivce and create a new branch (from master): Go to the serivce and create a new branch (from master):

View File

@ -1,4 +1,4 @@
# TESTS SHELL := /bin/bash
run-system-tests: run-system-tests:
echo "TODO: write complete system tests" echo "TODO: write complete system tests"
@ -14,6 +14,7 @@ run-dev: | build-dev
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -p 127.0.0.1:8000:8000/tcp up docker-compose -f docker-compose.yml -f docker-compose.dev.yml -p 127.0.0.1:8000:8000/tcp up
build-prod: build-prod:
git submodule status | awk '{ gsub(/[^0-9a-f]/, "", $$1); gsub("-","_",$$2); print toupper($$2)"_COMMIT_HASH="$$1 }' > .env
docker-compose -f docker-compose.yml -f docker-compose.prod.yml build docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
run-prod: | build-prod run-prod: | build-prod

View File

@ -1,10 +1,16 @@
version: '3' version: '3'
services: services:
datastore-writer: datastore-writer:
build: https://github.com/OpenSlides/openslides-datastore-service.git#:writer build:
context: "https://github.com/OpenSlides/openslides-datastore-service.git#:writer"
args:
GIT_CHECKOUT: "${OPENSLIDES_DATASTORE_SERVICE_COMMIT_HASH}"
image: openslides-datastore-writer image: openslides-datastore-writer
client: client:
build: https://github.com/OpenSlides/openslides-client.git build:
context: "https://github.com/OpenSlides/openslides-client.git"
args:
GIT_CHECKOUT: "${OPENSLIDES_CLIENT_COMMIT_HASH}"
image: openslides-client image: openslides-client
haproxy: haproxy:
build: ./haproxy build: ./haproxy

@ -1 +1 @@
Subproject commit e75e72b50c66cd59ca6aac8cea1cf8c6c998d954 Subproject commit 049920af19dd88d83548e710d25f07dacd3b56f4

@ -1 +1 @@
Subproject commit 51af334ddc7c7a57616263e8d56e27c21c0e5e65 Subproject commit 4325e10af1f7ecad911c9f3ded195ba08f7eef86