From c32dbb2a07b42539edb7bd2f213efbe7758f3cbc Mon Sep 17 00:00:00 2001 From: Sachi King Date: Mon, 7 Aug 2017 11:47:41 +1000 Subject: [PATCH] Build an ephemeral dev container for rego testing Create a ephemeral dev container to facilitate testing of populate_inventory. It can be created, tweeked in the admin interface, files updated in admin's populate_inventory, then redeployed to deal with those changes. A branch based one will need to be created to so we can do this work without polluting the master branch. --- .gitlab-ci.yml | 2 ++ docker/Dockerfile.dev | 4 ++++ docker/deploy_with_sqlite.sh | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 docker/Dockerfile.dev diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3021f9e..6157509e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,8 +4,10 @@ build_image: - docker:dind script: - docker build -f docker/Dockerfile -t asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA . + - docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA . - docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io - docker push asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA + - docker push asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA - docker tag asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA asia.gcr.io/linuxconfsydney/symposion_app:latest - docker push asia.gcr.io/linuxconfsydney/symposion_app:latest only: diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev new file mode 100644 index 00000000..7e50b281 --- /dev/null +++ b/docker/Dockerfile.dev @@ -0,0 +1,4 @@ +ARG CI_COMMIT_SHA +FROM asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA + +CMD ["/app/symposion_app/docker/deploy_with_sqlite.sh"] diff --git a/docker/deploy_with_sqlite.sh b/docker/deploy_with_sqlite.sh index c2dd221b..42b892b2 100755 --- a/docker/deploy_with_sqlite.sh +++ b/docker/deploy_with_sqlite.sh @@ -3,4 +3,5 @@ /usr/local/bin/python /app/symposion_app/manage.py migrate /usr/local/bin/python /app/symposion_app/manage.py loaddata /app/symposion_app/fixtures/conference.json /app/symposion_app/fixtures/proposal_base.json /app/symposion_app/fixtures/sites.json /app/symposion_app/fixtures/sitetree.json /usr/local/bin/python /app/symposion_app/manage.py populate_inventory -exec /usr/local/bin/python /app/symposion_app/manage.py runserver 0.0.0.0:8000 + +exec /usr/local/bin/uwsgi --http-socket 0.0.0.0:8000 --wsgi-file pinaxcon/wsgi.py