# 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: iterativ/skillbox-test clone: depth: full definitions: services: postgres: image: postgres variables: POSTGRES_HOST_AUTH_METHOD: trust caches: npm: $HOME/.npm cypress: $HOME/.cache/Cypress clientmodules: client/node_modules aliases: - &lint name: lint caches: - clientmodules script: - npm install --prefix client - npm run lint --prefix client - &unittest-python name: run python unit tests caches: - pip services: - postgres script: # Modify the commands below to build your repository. - &setup-tests source setup-for-tests.sh - ./server/run_unittests_coverage.sh - &cypress-test name: run cypress tests caches: - pip - node - clientmodules - npm artifacts: - client/cypress/**/*.png - client/cypress/**/*.mp4 services: - postgres script: - echo "This pipeline rules!" - *setup-tests - npm ci --prefix client - npm run "install:cypress" --prefix client - psql -U $DATABASE_USER -h $DATABASE_HOST -c "create database $DATABASE_NAME" - python server/manage.py dummy_data - python server/manage.py runserver 2>&1 > /dev/null & - npm run build --prefix client - curl http://localhost:8000/beta-login - npm run --prefix client test:cypress - &jest-test name: run jest tests caches: - node - clientmodules script: - echo "This pipeline rules!" - *setup-tests - npm install --prefix client - cd client - npm run test:unit - &deploy-prod name: deploy to prod on Heroku deployment: prod script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-prod.git HEAD:master - &deploy-prod-manual name: deploy to prod on Heroku deployment: prod trigger: manual script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-prod.git HEAD:master - &deploy-dev name: deploy to dev on Heroku deployment: dev trigger: manual script: - git push --force https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-dev.git HEAD:master - &deploy-academy-manual name: deploy to iterativ-academy on Heroku deployment: prod trigger: manual script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/iterativ-academy.git HEAD:master pipelines: default: - parallel: - step: *lint - step: *unittest-python - step: *cypress-test - step: *jest-test - step: *deploy-dev branches: master: - parallel: - step: *unittest-python - step: *cypress-test - step: *jest-test develop: - parallel: - step: *lint - step: *unittest-python - step: *cypress-test - step: *jest-test - step: name: deploy to stage on Heroku deployment: stage script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/skillbox-stage.git develop:master tags: v202*: - parallel: - step: *unittest-python - step: *cypress-test - step: *jest-test - parallel: - step: *deploy-prod-manual - step: *deploy-academy-manual custom: prod: - parallel: - step: *unittest-python - step: *cypress-test - step: *jest-test - parallel: - step: *deploy-prod-manual - step: *deploy-academy-manual