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

View File

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