From 3759b373511f22f5f535962f2161b35c95dce4d9 Mon Sep 17 00:00:00 2001 From: redxef Date: Wed, 30 Oct 2024 00:30:12 +0100 Subject: [PATCH] ci: add simple pipeline. --- ci/pipeline.yaml | 132 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 ci/pipeline.yaml diff --git a/ci/pipeline.yaml b/ci/pipeline.yaml new file mode 100644 index 0000000..9666767 --- /dev/null +++ b/ci/pipeline.yaml @@ -0,0 +1,132 @@ +--- +resources: +- name: source + type: git + source: + uri: https://gitea.redxef.at/redxef/concourse-http-resource + branch: main + fetch_tags: true +- name: image + type: registry-image + source: + repository: redxef/concourse-http-resource + tag: edge + username: ((docker.username)) + password: ((docker.password)) + +jobs: +- name: build-push-edge + plan: + - get: source + 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: concourse/oci-build-task + inputs: + - name: source + path: . + outputs: + - name: output-image + path: image + params: + IMAGE_PLATFORM: aarch64,x86_64 + OUTPUT_OCI: true + UNPACK_ROOTFS: true + run: + path: build + - put: image + inputs: + - output-image + - docker-tags + params: + image: output-image/image + additional_tags: docker-tags/tags.txt + get_params: + format: oci + + + #- name: test + # plan: + # - get: image + # trigger: true + # passed: + # - build-push-edge + # - task: create-put-file + # config: + # platform: linux + # image_resource: + # type: registry-image + # source: + # repository: alpine + # outputs: + # - name: file + # run: + # path: sh + # args: + # - -c + # - | + # echo Hello > file/hello.txt + # - put: test-server + # inputs: + # - file + # params: + # command: + # - ls + # - -la + # + #- name: tag-latest + # plan: + # - get: image + # trigger: true + # passed: + # - test + # - task: write-latest-file + # config: + # platform: linux + # image_resource: + # type: registry-image + # source: + # repository: alpine + # outputs: + # - name: latest-tag + # run: + # path: sh + # args: + # - -c + # - | + # #!/usr/bin/env sh + # echo latest > latest-tag/tags.txt + # - put: image + # inputs: + # - image + # - latest-tag + # params: + # image: image/image.tar + # additional_tags: latest-tag/tags.txt