Playing with pipelines

This commit is contained in:
Lilleman auf Larv 2022-02-15 19:24:22 +01:00
parent 649d37d14c
commit 3fb0101b9c
4 changed files with 46 additions and 6 deletions

View File

@ -1,3 +1,5 @@
# Run on all branch pushes
---
kind: pipeline kind: pipeline
type: docker type: docker
name: default name: default
@ -18,4 +20,45 @@ steps:
volumes: volumes:
- name: docker-sock - name: docker-sock
host: 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

View File

@ -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 # Install missing pkgs
RUN apk add --no-cache git RUN apk add --no-cache git

View File

@ -1,3 +1,3 @@
FROM amacneil/dbmate:v1.12.1 FROM amacneil/dbmate:v1.14.0
COPY db /db COPY db /db

View File

@ -14,11 +14,8 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile.migrations dockerfile: Dockerfile.migrations
# image: amacneil/dbmate:v1.12.1
environment: environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/auth?sslmode=disable - DATABASE_URL=postgres://postgres:postgres@postgres:5432/auth?sslmode=disable
# volumes:
# - "./db:/db:ro"
command: ["--wait", "up"] command: ["--wait", "up"]
profiles: ["migrations"] profiles: ["migrations"]
depends_on: depends_on: