hackspace/.drone.yml

70 lines
1.8 KiB
YAML

kind: pipeline
name: default
steps:
- name: tests
image: python:3.6
environment:
PYTHONUSERBASE: /drone/src/cache/packages
POSTGRES_USER: mhackspace
USE_DOCKER: yes
DJANGO_SETTINGS_MODULE: config.settings.test
BUCKET_URL: http://minio:9000
commands:
- cp -n env.example .env
- mkdir -p ./cache/packages ./cache/pip
- pip install --user --cache-dir ./cache/pip -r ./requirements/test.txt
- python manage.py compilescss
- python manage.py collectstatic --no-input
- pytest -v
# - python manage.py test mhackspace --keepdb --verbosity 2
- name: publish-stage
pull: True
image: appleboy/drone-ssh
host: stage.maidstone-hackspace.org.uk
user: root
secrets: [ ssh_key ]
port: 22
command_timeout: 480
script:
- cd /var/www/maidstone-hackspace-website
- git pull
- docker-compose -fstage.yml build
- docker-compose -fstage.yml run --rm django python manage.py compilescss
- docker-compose -fstage.yml run --rm django python manage.py collectstatic
- docker-compose -fstage.yml down --remove-orphans
- docker-compose -fstage.yml up -d
- name: publish-live
pull: True
image: appleboy/drone-ssh
user: root
secrets:
- source: DEPLOY_SSH_KEY
target: ssh_key
host: maidstone-hackspace.org.uk
port: 22
command_timeout: 480
script:
- echo 'to be added'
when:
event: [ tag ]
services:
- name: mailhog
image: mailhog/mailhog
- name: node
image: node:alpine
commands:
- npm --version
- npm install
- name: minio
image: minio/minio
environment:
MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE
MINIO_SECRET_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
command: [ "server", "--config-dir=/tmp/minio", "/bucket/" ]