Drone CI pipelines

This commit is contained in:
Adam Štrauch 2021-11-19 18:09:15 +01:00
parent 3e4c1fbbc0
commit 2bc8867eaf
Signed by: cx
GPG Key ID: 018304FFA8988F8D
2 changed files with 29 additions and 35 deletions

View File

@ -1,17 +1,19 @@
kind: pipeline kind: pipeline
type: ssh type: docker
name: image builder name: image building
server:
host: 192.168.1.2
user: build
password:
from_secret: ssh_password
steps: steps:
- name: build - name: build&push squashed image
image: harbor.hq.rosti.cz/library/builder:35
environment:
username: robot$rosti+rosti
password:
from_secret: repo_password
repo: harbor.hq.rosti.cz
privileged: true
commands: commands:
- make build - echo "$password" | podman login -u $username --password-stdin $repo
- make push
trigger: trigger:
event: event:
@ -21,27 +23,18 @@ trigger:
--- ---
kind: pipeline kind: pipeline
type: ssh type: docker
name: production image builder name: test image building
server:
host: 192.168.1.2
user: build
password:
from_secret: ssh_password
steps: steps:
- name: build - name: test build
image: harbor.hq.rosti.cz/library/builder:35
environment: environment:
DOCKER_USERNAME: creckx username: robot$rosti+rosti
DOCKER_PASSWORD: password:
from_secret: docker_password from_secret: repo_password
repo: harbor.hq.rosti.cz
privileged: true
commands: commands:
- docker login -u $DOCKER_USERNAME --password $DOCKER_PASSWORD - echo "$password" | podman login -u $username --password-stdin $repo
- make push - make build
trigger:
event:
- promote
target:
- production

View File

@ -1,19 +1,20 @@
REPO=harbor.hq.rosti.cz/rosti/runtime
DOCKER=docker DOCKER=docker
VERSION=2021.09-1 VERSION=2021.11-1
all: build all: build
build: build:
$(DOCKER) pull debian:buster $(DOCKER) pull debian:buster
$(DOCKER) build -t rosti/runtime:dev . $(DOCKER) build -t ${REPO}:dev .
test: test:
DOCKER=$(DOCKER) ./tests.sh DOCKER=$(DOCKER) ./tests.sh
squashed: squashed:
$(DOCKER) pull debian:buster $(DOCKER) pull debian:buster
$(DOCKER) build --squash -t rosti/runtime:dev-squashed . $(DOCKER) build --squash -t ${REPO}:dev-squashed .
push: squashed push: squashed
$(DOCKER) tag rosti/runtime:dev-squashed rosti/runtime:$(VERSION) $(DOCKER) tag ${REPO}:dev-squashed ${REPO}:$(VERSION)
$(DOCKER) push rosti/runtime:$(VERSION) $(DOCKER) push ${REPO}:$(VERSION)