2023-07-20 09:26:25 +00:00
|
|
|
---
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
# -- Unit tests should run on each commit
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Run unit tests
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check formatting
|
|
|
|
image: registry.hub.docker.com/golangci/golangci-lint
|
|
|
|
commands:
|
|
|
|
- make lint
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
image: registry.hub.docker.com/library/golang
|
|
|
|
commands:
|
|
|
|
- make test
|
|
|
|
|
|
|
|
---
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
# -- Build a container
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Build a container
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Build the builder image
|
|
|
|
image: alpine
|
|
|
|
privileged: true
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: GITEA_TOKEN
|
2023-08-02 15:00:34 +00:00
|
|
|
BUILDAH_REG: git.badhouseplants.net/allanger/shoebill-builder
|
2023-07-20 09:26:25 +00:00
|
|
|
commands:
|
|
|
|
- ./build/build
|
|
|
|
|
|
|
|
- name: Cleanup the registry
|
2023-08-02 15:00:34 +00:00
|
|
|
image: git.badhouseplants.net/allanger/shoebill-builder:${DRONE_COMMIT_SHA}
|
2023-07-20 09:26:25 +00:00
|
|
|
privileged: true
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: GITEA_TOKEN
|
2023-08-02 15:00:34 +00:00
|
|
|
GITEA_PACKAGE: shoebill-builder
|
2023-07-20 09:26:25 +00:00
|
|
|
commands:
|
|
|
|
- cleanup
|
|
|
|
|
2023-08-02 15:00:34 +00:00
|
|
|
- name: Build shoebill container and cleanuo the registry
|
|
|
|
image: git.badhouseplants.net/allanger/shoebill-builder:${DRONE_COMMIT_SHA}
|
2023-07-20 09:26:25 +00:00
|
|
|
privileged: true
|
|
|
|
environment:
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: GITEA_TOKEN
|
|
|
|
commands:
|
|
|
|
- build-container
|
|
|
|
- cleanup
|