Last active
September 30, 2021 21:11
-
-
Save f213/f25dc2ddbcfdf7baf037760b66206e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
defaults: &defaults | |
docker: | |
- image: circleci/python:3.6-stretch | |
environment: | |
- DATABASE_URL=postgres://root:@postgres:5432/circle_test | |
- CELERY_BACKEND=redis://redis:6379 | |
- ELASTICSEARCH_HOST=http://elasticsearch:9200 | |
jobs: | |
build-docker-image: | |
steps: | |
- attach_workspace: | |
at: . | |
- setup_remote_docker: | |
docker_layer_caching: true | |
- run: | |
name: Store environment variables | |
command: | | |
sudo apt-get -y --no-install-recommends install gettext-base | |
envsubst < src/app/build_env.py > src/app/build_env.with.env.py | |
mv src/app/build_env.with.env.py src/app/build_env.py | |
- run: | |
name: Build and upload docker image | |
command: | | |
export D_RELEASE=0.2.4 | |
wget -O - https://cdn.rawgit.com/f213/d/351d2459/install.sh|sh | |
./d build-image gdml/image src | |
./d push-image gdml/image | |
deploy-service: | |
steps: | |
- attach_workspace: | |
at: . | |
- run: | |
name: Install deploy tooling | |
command: | | |
export D_RELEASE=0.3.0 | |
wget -O - https://cdn.rawgit.com/f213/d/351d2459/install.sh|sh | |
- run: | |
name: Add host key | |
command: ./d add-host-key | |
- run: | |
name: Migrate DB | |
command: | | |
./d run-command -i gdml/image:${CIRCLE_SHA1} --env-from=service_api [email protected] ./manage.py migrate --noinput | |
- run: | |
name: Update image | |
command: | | |
./d update-image [email protected] service gdml/image:${CIRCLE_SHA1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment