From 60d235765dfe2ac4d08a32516bdbaf8024db9f54 Mon Sep 17 00:00:00 2001 From: redxef Date: Mon, 21 Nov 2022 21:40:49 +0100 Subject: [PATCH] Update pipeline to include integrationtest. --- ci/pipeline.yml | 114 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 103 insertions(+), 11 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 1830826..51b08a7 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -1,4 +1,21 @@ --- +resource_types: +- name: ssh-edge + type: registry-image + source: + repository: redxef/concourse-ssh-resource + tag: edge +- name: ssh + type: registry-image + source: + repository: redxef/concourse-ssh-resource + tag: latest +- name: oci-image + type: registry-image + source: + repository: redxef/concourse-oci-resource + tag: latest + resources: - name: source type: git @@ -10,9 +27,25 @@ resources: type: registry-image source: repository: alpine +- name: image + type: oci-image + source: + repository: redxef/concourse-ssh-resource + tag: edge + username: ((docker.username)) + password: ((docker.password)) +- name: test-server + type: ssh-edge + source: + hostname: ((test-server.hostname)) + user: ((test-server.user)) + identity: ((test-server.identity)) + hostkey: ((test-server.hostkey)) + files: + - file/hello.txt jobs: -- name: build-push +- name: build-push-edge plan: - get: source trigger: true @@ -51,17 +84,76 @@ jobs: inputs: - name: source path: . - - name: docker-tags + outputs: + - name: build-output params: - username: ((docker.username)) - password: ((docker.password)) - repository: docker.io/redxef/concourse-ssh-resource - tag: edge - additional_tags: docker-tags/tags.txt - push: true - platform: amd64,i386,aarch64,arm,ppc64le,s390x - context: . - manual: false + dest: build-output/image.tar + platform: aarch64,arm,i386,ppc64le,s390x,x86_64 run: path: build + - put: image + inputs: + - build-output + - docker-tags + params: + image: build-output/image.tar + additional_tags: docker-tags/tags.txt +- 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