This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
concourse-oci-resource/ci/pipeline.yml

131 lines
3 KiB
YAML
Raw Normal View History

2022-08-29 18:28:23 +02:00
---
2022-08-29 23:09:30 +02:00
resource_types:
- name: oci-image
type: registry-image
source:
repository: redxef/concourse-oci-resource
tag: latest
2022-08-30 00:12:45 +02:00
- name: oci-image-testing
type: registry-image
source:
repository: redxef/concourse-oci-resource
tag: edge
2022-08-29 18:28:23 +02:00
resources:
- name: source
type: git
source:
uri: https://gitea.redxef.at/redxef/concourse-oci-resource
branch: master
fetch_tags: true
- name: upstream-image
type: registry-image
source:
repository: alpine
2022-08-29 23:09:30 +02:00
- name: concourse-oci-resource
type: oci-image
source:
repository: redxef/concourse-oci-resource
tag: edge
username: ((docker.username))
password: ((docker.password))
2022-08-30 00:12:45 +02:00
- name: concourse-oci-resource-testing
type: oci-image-testing
source:
repository: redxef/concourse-oci-resource
tag: edge
username: ((docker.username))
password: ((docker.password))
2022-08-29 18:28:23 +02:00
jobs:
2022-08-29 23:09:30 +02:00
- name: build-push-edge
2022-08-29 18:28:23 +02:00
plan:
- get: source
trigger: true
- get: upstream-image
trigger: true
- task: compute-docker-tags
config:
platform: linux
image_resource:
type: registry-image
source:
repository: alpine/git
inputs:
- name: source
path: .
outputs:
- name: docker-tags
run:
path: sh
args:
- -c
- |
#!/usr/bin/env sh
git rev-parse --short HEAD > docker-tags/tags.txt
git show-ref --tags | \
sed -n "/$(git rev-parse HEAD)/ s|$(git rev-parse HEAD).refs/tags/||gp" \
>> docker-tags/tags.txt
- task: build
privileged: true
config:
platform: linux
image_resource:
type: registry-image
source:
repository: redxef/concourse-buildkit
inputs:
- name: source
path: .
2022-08-29 23:09:30 +02:00
outputs:
- name: build-output
2022-08-29 18:28:23 +02:00
params:
2022-08-29 23:09:30 +02:00
dest: build-output/image.tar
2022-08-29 18:28:23 +02:00
platform: aarch64,arm,ppc64le,s390x,x86_64
context: .
run:
path: build
2022-08-29 23:09:30 +02:00
- put: concourse-oci-resource
inputs:
- build-output
- docker-tags
params:
image: build-output/image.tar
additional_tags: docker-tags/tags.txt
2022-08-30 00:12:45 +02:00
- name: test-and-tag
plan:
- get: concourse-oci-resource
passed:
- build-push-edge
trigger: true
- get: concourse-oci-resource-testing
# TODO: verify artifacts
- put: concourse-oci-resource-testing
inputs:
- concourse-oci-resource-testing
params:
image: concourse-oci-resource-testing/image.tar
- task: create-latest-tag-file
config:
platform: linux
image_resource:
type: registry-image
source:
repository: alpine/git
outputs:
- name: latest-tag
run:
path: sh
args:
- -c
- |
#!/usr/bin/env sh
echo latest > latest-tag/tags.txt
- put: concourse-oci-resource
inputs:
- concourse-oci-resource
- latest-tag
params:
image: concourse-oci-resource/image.tar
additional_tags: latest-tag/tags.txt