Commit 02182a67 authored by Zachary Seguin's avatar Zachary Seguin

Enable GitLab CI

parent 42c759ff
bin
Dockerfile
celerybeat-*
.webassets-cache/
.*
image: docker:latest
services:
- docker:dind
stages:
- build
- test
- release
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
RELEASE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay2
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.zacharyseguin.ca
build container:
services:
- docker:dind
stage: build
script:
- docker build --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
test ac.py runs:
stage: test
script:
- docker pull $IMAGE_TAG
# Simple test, just see that ac.py runs
# Environment variable should match docker-compose.yml
- docker run --env AC_FLASK_SECRET_KEY=1817e8c14cc6d7389db3114b0b910b99 --env AC_DATABASE_URL=postgres://alerts_canada:ac_docker@db/alerts_canada --env AC_BROKER_URL=redis://redis:6379/0 --env AC_REDIS_URL=redis://redis:6379/1 $IMAGE_TAG ./ac.py test
release container:
stage: release
script:
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $RELEASE_TAG
- docker push $RELEASE_TAG
......@@ -100,6 +100,10 @@ def listen():
while True:
signal.pause()
@manager.command
def test():
print('Hello :)')
manager.add_command('assets', ManageAssets(assets_env))
manager.add_command('runserver', Server(host='0.0.0.0', use_debugger=True))
manager.add_command('shell', Shell())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment