Multiple cleanups working toward run of test-pipeline.

This commit is contained in:
James Pace 2023-04-11 19:40:08 -04:00
parent 6c28be4490
commit ad8dd1cdda
8 changed files with 68 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
git checkout $(params.hash)
git rev-parse HEAD > $(results.hash.path)

View File

@ -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)
git clone --single-branch --branch $(params.branch) $(params.url) $(workspaces.output.path)
cd $(workspaces.output.path)
git rev-parse HEAD > $(results.hash.path)

View File

@ -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)

View File

@ -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

View File

@ -5,4 +5,5 @@ resources:
- j7s-buildah.yaml
- j7s-git-clone-hash.yaml
- j7s-git-clone.yaml
- j7s-ros-clone.yaml
- j7s-ros-clone.yaml
- j7s-gitea-status.yaml