auth-api/.drone.yml
Lilleman dbf4512e9f
All checks were successful
continuous-integration/drone/push Build is passing
Updated pipelines to always push the latest tag to docker hub
2022-02-15 20:14:33 +01:00

75 lines
1.7 KiB
YAML

kind: pipeline
type: docker
name: Tests
steps:
- name: Tests
image: docker/compose:1.29.2
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker-compose build
- docker-compose --profile tests build
- docker-compose run --rm db-migrations
- docker-compose up -d
- docker-compose run --rm tests
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock
trigger:
event:
exclude:
- tag
---
kind: pipeline
type: docker
name: Deploy
steps:
- name: Tests
image: docker/compose:1.29.2
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker-compose build
- docker-compose --profile tests build
- docker-compose run --rm db-migrations
- docker-compose up -d
- docker-compose run --rm tests
- name: Build db migration
image: docker/compose:1.29.2
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker build -t lilleman/auth-api-db-migrate:$DRONE_TAG -f ./Dockerfile.migrations .
- docker build -t lilleman/auth-api:$DRONE_TAG -f ./Dockerfile .
- name: Push to Docker Hub
image: docker/compose:1.29.2
environment:
DOCKERHUB_TOKEN:
from_secret: dockerhub
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker login -u lilleman -p $DOCKERHUB_TOKEN
- docker push lilleman/auth-api-db-migrate:$DRONE_TAG
- docker push lilleman/auth-api:$DRONE_TAG
- docker push lilleman/auth-api-db-migrate:latest
- docker push lilleman/auth-api:latest
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock
trigger:
event:
- tag