Created
November 22, 2019 12:56
-
-
Save edsoncelio/de9cc0d41060f620310d04de70367905 to your computer and use it in GitHub Desktop.
Gitlab-CI to python project
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
stages: | |
- test | |
- deploy | |
test: | |
stage: test | |
script: | |
# this configures Django application to use attached postgres database that is run on `postgres` host | |
- export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app | |
- apt-get update -qy | |
- apt-get install -y python-dev python-pip | |
- pip install -r requirements.txt | |
- python manage.py test | |
staging: | |
stage: deploy | |
script: | |
- apt-get update -qy | |
- apt-get install -y ruby-dev | |
- gem install dpl | |
- dpl --provider=heroku --app=gitlab-ci-python-test-staging --api-key=$HEROKU_STAGING_API_KEY | |
only: | |
- master | |
production: | |
stage: deploy | |
script: | |
- apt-get update -qy | |
- apt-get install -y ruby-dev | |
- gem install dpl | |
- dpl --provider=heroku --app=gitlab-ci-python-test-prod --api-key=$HEROKU_PRODUCTION_API_KEY | |
only: | |
- tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment