updates and fixes

This commit is contained in:
James Brumond 2022-12-09 16:57:47 -08:00
parent 5100e7cff6
commit e9030e53ef
Signed by: james
GPG Key ID: 24BA25B8B303B023
2 changed files with 43 additions and 15 deletions

View File

@ -5,8 +5,20 @@ type: kubernetes
name: build-{{ $plat.os }}-{{ $plat.arch }}
trigger:
event: [ push ]
branch: [ {{ if $.input.build_branches -}}{{ range $.input.build_branches }}{{ . }}, {{ end }}{{ else }}master{{- end }} ]
event:
- push
branch:
{{ if $.input.build_branches -}}
{{ range $.input.build_branches }}- {{ . }}{{ end }}
{{ else }}- master{{- end }}
platform:
os: {{ $plat.os }}
arch: {{ $plat.arch }}
node_selector:
kubernetes.io/os: {{ $plat.os }}
kubernetes.io/arch: {{ $plat.arch }}
steps:
- name: build
@ -33,8 +45,19 @@ type: kubernetes
name: publish-{{ $plat.os }}-{{ $plat.arch }}
trigger:
event: [ promote ]
target: [ publish, "publish-{{ $plat.os }}-{{ $plat.arch }}" ]
event:
- promote
target:
- publish
- publish-{{ $plat.os }}-{{ $plat.arch }}
platform:
os: {{ $plat.os }}
arch: {{ $plat.arch }}
node_selector:
kubernetes.io/os: {{ $plat.os }}
kubernetes.io/arch: {{ $plat.arch }}
steps:
- name: build-and-publish
@ -53,7 +76,6 @@ steps:
- {{ . }}
{{ end }}
tags:
- latest-{{ $plat.os }}-{{ $plat.arch }}
{{ range $.input.tags }}
- {{ . }}-{{ $plat.os }}-{{ $plat.arch }}
{{ end }}
@ -65,12 +87,24 @@ type: kubernetes
name: publish-multiarch-manifest
trigger:
event: [ promote ]
target: [ publish ]
event:
- promote
target:
- publish
{{ if .input.publish_multiarch_from }}
platform:
os: {{ .input.publish_multiarch_from.os }}
arch: {{ .input.publish_multiarch_from.arch }}
node_selector:
kubernetes.io/os: {{ .input.publish_multiarch_from.os }}
kubernetes.io/arch: {{ .input.publish_multiarch_from.arch }}
{{ end }}
steps:
- name: deploy
image: gitea.internal.example.com/examples/docker:{{ if .input.docker_image_tag }}{{ .input.docker_image_tag }}{{ else }}latest{{ end }}
image: gitea.internal.example.com/examples/docker:latest{{ if .input.publish_multiarch_from }}-{{ .input.publish_multiarch_from.os }}-{{ .input.publish_multiarch_from.arch }}{{ end }}
volumes:
- name: dockersock
path: /var/run/
@ -81,13 +115,6 @@ steps:
from_secret: gitea-internal-password
commands:
- /bin/docker-setup
- |
docker manifest create \
gitea.internal.example.com/{{ .input.repo }}:latest \
{{ range .input.platforms -}}
--amend gitea.internal.example.com/{{ $.input.repo }}:latest-{{ .os }}-{{ .arch }} \
{{- end }}
- docker manifest push gitea.internal.example.com/{{ .input.repo }}:latest
{{ range $i, $tag := $.input.tags }}
- |
docker manifest create \

View File

@ -18,6 +18,7 @@ data:
build_args:
- EXAMPLE_ARG=foo
tags:
- latest
- "1.2.3"
- "1.2"
- "1"