skillbox/bitbucket-pipelines.yml

65 lines
1.4 KiB
YAML

# This is a sample build configuration for Python.
# Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: python:3.6.6
clone:
depth: full
definitions:
services:
postgres:
image: postgres
aliases:
- &unittest-python
name: run python unit tests
caches:
- pip
services:
- postgres
script: # Modify the commands below to build your repository.
- pip install pipenv
- export SECRET_KEY=abcd1234
- export DATABASE_URL=postgres://postgres:postgres@localhost:5432/skillbox
- export DEBUG=True
- export USE_AWS=False
- pipenv install --dev --system
- ./server/run_unittests_coverage.sh
- &cypress-test
name: run cypress tests
services:
- postgres
script:
- echo "This pipeline rules!"
- &deploy-prod
name: deploy to prod on Heroku
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-prod.git HEAD:master
pipelines:
default:
- step: *unittest-python
branches:
master:
- step: *unittest-python
develop:
- step: *unittest-python
- step: *cypress-test
- step:
name: deploy to stage on Heroku
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-stage.git develop:master
custom:
prod:
- step: *unittest-python
- step: *deploy-prod