diff --git a/generic-pipelines/kustomization.yaml b/generic-pipelines/kustomization.yaml index 4045c5b..54a4f11 100644 --- a/generic-pipelines/kustomization.yaml +++ b/generic-pipelines/kustomization.yaml @@ -1,7 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- dev-contain-pipeline.yaml -- ostree-package-pipeline.yaml -- simple-ros-pipeline.yaml - test-pipeline.yaml \ No newline at end of file diff --git a/generic-pipelines/test-pipeline.yaml b/generic-pipelines/test-pipeline.yaml index f278a40..88799cc 100644 --- a/generic-pipelines/test-pipeline.yaml +++ b/generic-pipelines/test-pipeline.yaml @@ -1,4 +1,4 @@ -# A pipeline to test the infrasture around calling pipelines. +# A pipeline to test the infrastructure around calling pipelines. --- apiVersion: tekton.dev/v1beta1 kind: Pipeline @@ -23,7 +23,7 @@ spec: workspace: git-credentials params: - name: url - value: ssh://git.jpace121.net:2222/tests/job-test + value: ssh://git@git.jpace121.net:2222/tests/job-test.git - name: branch value: master taskRef: @@ -43,17 +43,15 @@ spec: cat $(workspaces.source.path)/README.md exit 0 finally: - - name: notify-onedev + - name: gitea-status params: - - name: tekton-login-secret-name - value: onedev-api-key - - name: feedback-url - value: https://git.jpace121.net/ - - name: pr-id - value: $(params.pr-id) - - name: run-name - value: $(context.pipelineRun.name) + - name: git-owner + value: tests + - name: git-repo-name + value: job-test + - name: sha + value: $(tasks.fetch-repo.results.hash) - name: status value: $(tasks.status) taskRef: - name: j7s-onedev-pr-review + name: j7s-gitea-status diff --git a/generic-tasks/j7s-buildah.yaml b/generic-tasks/j7s-buildah.yaml index 2a197d6..ae58198 100644 --- a/generic-tasks/j7s-buildah.yaml +++ b/generic-tasks/j7s-buildah.yaml @@ -21,7 +21,7 @@ spec: - name: cosign-credentials steps: - name: build - image: harbor.internal.jpace121.net/buildah:latest + image: harbor.internal.jpace121.net/k8s/buildah:latest workingDir: $(workspaces.source.path) script: | set -x diff --git a/generic-tasks/j7s-git-clone-hash.yaml b/generic-tasks/j7s-git-clone-hash.yaml index 7c486e6..03c087a 100644 --- a/generic-tasks/j7s-git-clone-hash.yaml +++ b/generic-tasks/j7s-git-clone-hash.yaml @@ -9,8 +9,10 @@ spec: params: - name: url - name: hash + results: + - name: hash steps: - - image: harbor.internal.jpace121.net/gitssh:latest + - image: harbor.internal.jpace121.net/k8s/gitssh:latest script: | set -x cp -r $(workspaces.ssh-directory.path) ~/.ssh @@ -20,4 +22,6 @@ spec: git clone $(params.url) $(workspaces.output.path) cd $(workspaces.output.path) - git checkout $(params.hash) \ No newline at end of file + git checkout $(params.hash) + + git rev-parse HEAD > $(results.hash.path) \ No newline at end of file diff --git a/generic-tasks/j7s-git-clone.yaml b/generic-tasks/j7s-git-clone.yaml index d18a8e6..3e5a77a 100644 --- a/generic-tasks/j7s-git-clone.yaml +++ b/generic-tasks/j7s-git-clone.yaml @@ -9,8 +9,10 @@ spec: params: - name: url - name: branch + results: + - name: hash steps: - - image: harbor.internal.jpace121.net/gitssh:latest + - image: harbor.internal.jpace121.net/k8s/gitssh:latest script: | set -x cp -r $(workspaces.ssh-directory.path) ~/.ssh @@ -18,4 +20,7 @@ spec: chmod -R 400 ~/.ssh/* ssh-keyscan -H -p 2222 git.jpace121.net >> ~/.ssh/known_hosts - git clone --single-branch --branch $(params.branch) $(params.url) $(workspaces.output.path) \ No newline at end of file + git clone --single-branch --branch $(params.branch) $(params.url) $(workspaces.output.path) + + cd $(workspaces.output.path) + git rev-parse HEAD > $(results.hash.path) diff --git a/generic-tasks/j7s-gitea-status.yaml b/generic-tasks/j7s-gitea-status.yaml new file mode 100644 index 0000000..5947a80 --- /dev/null +++ b/generic-tasks/j7s-gitea-status.yaml @@ -0,0 +1,41 @@ +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: j7s-gitea-status +spec: + params: + - name: git-owner + - name: git-repo-name + - name: sha + - name: context + - name: status + - name: description + default: "" + - name: targetUrl + default: "" + - name: base-url + default: "https://git.jpace121.net/" + - name: token-secret-name + default: gitea-token + steps: + - image: harbor.internal.jpace121.net/k8s/j7s-gitea-status:latest + env: + - name: GIT_URL + value: $(params.base-url) + - name: GIT_TOKEN + valueFrom: + secretKeyRef: + name: $(params.token-secret-name) + key: token + - name: GIT_OWNER + value: $(params.git-owner) + - name: GIT_REPO + value: $(params.git-repo-name) + script: | + set -x + cd / + ./j7s-gitea-status -sha $(params.sha) \ + -context $(params.context) \ + -statusFlag $(params.status) \ + -description $(params.description) \ + -targetUrl $(params.targetUrl) \ No newline at end of file diff --git a/generic-tasks/j7s-ros-clone.yaml b/generic-tasks/j7s-ros-clone.yaml index d17569f..3573376 100644 --- a/generic-tasks/j7s-ros-clone.yaml +++ b/generic-tasks/j7s-ros-clone.yaml @@ -11,7 +11,7 @@ spec: - name: branch - name: repos-file steps: - - image: harbor.internal.jpace121.net/vcs:latest + - image: harbor.internal.jpace121.net/k8s/vcs:latest script: | set -x cp -r $(workspaces.ssh-directory.path) ~/.ssh diff --git a/generic-tasks/kustomization.yaml b/generic-tasks/kustomization.yaml index 25f23c9..03ad897 100644 --- a/generic-tasks/kustomization.yaml +++ b/generic-tasks/kustomization.yaml @@ -5,4 +5,5 @@ resources: - j7s-buildah.yaml - j7s-git-clone-hash.yaml - j7s-git-clone.yaml -- j7s-ros-clone.yaml \ No newline at end of file +- j7s-ros-clone.yaml +- j7s-gitea-status.yaml \ No newline at end of file