Playing with pipelines
This commit is contained in:
parent
649d37d14c
commit
3fb0101b9c
45
.drone.yml
45
.drone.yml
|
@ -1,3 +1,5 @@
|
|||
# Run on all branch pushes
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
@ -18,4 +20,45 @@ steps:
|
|||
volumes:
|
||||
- name: docker-sock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
path: /var/run/docker.sock
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- tag
|
||||
|
||||
# Run on all tag pushes
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: Tests
|
||||
image: docker/compose:1.29.2
|
||||
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
|
||||
path: /var/run/docker.sock
|
||||
- name: Build db migration
|
||||
image: docker/compose:1.29.2
|
||||
environment:
|
||||
DOCKERHUB_TOKEN:
|
||||
from_secret: dockerhub
|
||||
commands:
|
||||
#- docker build -t auth-api-db-migrate:
|
||||
- env
|
||||
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.17.6-alpine3.14 AS builder
|
||||
FROM golang:1.17.7-alpine3.15 AS builder
|
||||
|
||||
# Install missing pkgs
|
||||
RUN apk add --no-cache git
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
FROM amacneil/dbmate:v1.12.1
|
||||
FROM amacneil/dbmate:v1.14.0
|
||||
|
||||
COPY db /db
|
|
@ -14,11 +14,8 @@ services:
|
|||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.migrations
|
||||
# image: amacneil/dbmate:v1.12.1
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/auth?sslmode=disable
|
||||
# volumes:
|
||||
# - "./db:/db:ro"
|
||||
command: ["--wait", "up"]
|
||||
profiles: ["migrations"]
|
||||
depends_on:
|
||||
|
|
Loading…
Reference in New Issue
Block a user