Fixed tekton pipelines
This commit is contained in:
parent
720bfb8b62
commit
a28d0d8364
10
tekton/2-Setup/kubeconfig-creds.yaml
Normal file
10
tekton/2-Setup/kubeconfig-creds.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: kubeconfig
|
||||||
|
namespace: tekton-pipelines
|
||||||
|
annotations:
|
||||||
|
kube-1password: ppvndbst3pdqpvfaavgy7mkluq
|
||||||
|
kube-1password/vault: Kubernetes
|
||||||
|
kube-1password/secret-text-key: config
|
||||||
|
type: Opaque
|
@ -65,12 +65,36 @@ spec:
|
|||||||
inputs:
|
inputs:
|
||||||
- name: src
|
- name: src
|
||||||
resource: git-source
|
resource: git-source
|
||||||
- name: make-release
|
- name: build-and-publish-sha-public
|
||||||
taskRef:
|
conditions:
|
||||||
name: make
|
- conditionRef: is-public-project
|
||||||
params:
|
params:
|
||||||
- name: TARGET
|
- name: isprivate
|
||||||
value: "release"
|
value: $(params.isprivate)
|
||||||
|
taskRef:
|
||||||
|
name: docker-build-and-publish
|
||||||
|
params:
|
||||||
|
- name: IMAGE
|
||||||
|
value: $(params.publicdockerregistry)/$(params.projectname):$(params.gitrevision)
|
||||||
|
resources:
|
||||||
|
inputs:
|
||||||
|
- name: src
|
||||||
|
resource: git-source
|
||||||
|
- name: make-release
|
||||||
|
taskRef:
|
||||||
|
name: make
|
||||||
|
runAfter:
|
||||||
|
- build-and-publish-sha
|
||||||
|
- build-and-publish-sha-public
|
||||||
|
params:
|
||||||
|
- name: TARGET
|
||||||
|
value: "release"
|
||||||
|
- name: REPO
|
||||||
|
value: $(params.projectname)
|
||||||
|
- name: PR_ID
|
||||||
|
value: ""
|
||||||
|
- name: SHA
|
||||||
|
value: $(params.gitrevision)
|
||||||
resources:
|
resources:
|
||||||
inputs:
|
inputs:
|
||||||
- name: src
|
- name: src
|
||||||
|
@ -41,6 +41,7 @@ spec:
|
|||||||
- --destination=$(params.IMAGE)
|
- --destination=$(params.IMAGE)
|
||||||
- --oci-layout-path=/workspace/src/image-digest
|
- --oci-layout-path=/workspace/src/image-digest
|
||||||
- --digest-file=/tekton/results/IMAGE_DIGEST
|
- --digest-file=/tekton/results/IMAGE_DIGEST
|
||||||
|
- --cache=true
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -7,6 +7,12 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: TARGET
|
- name: TARGET
|
||||||
description: The make target to run
|
description: The make target to run
|
||||||
|
- name: REPO
|
||||||
|
description: The name of the repo
|
||||||
|
- name: PR_ID
|
||||||
|
description: The ID of the pull request
|
||||||
|
- name: SHA
|
||||||
|
description: The commit sha
|
||||||
resources:
|
resources:
|
||||||
inputs:
|
inputs:
|
||||||
- name: src
|
- name: src
|
||||||
@ -16,14 +22,27 @@ spec:
|
|||||||
workingDir: /workspace/src
|
workingDir: /workspace/src
|
||||||
image: docker.cluster.fun/averagemarcus/ci-builder:latest
|
image: docker.cluster.fun/averagemarcus/ci-builder:latest
|
||||||
script: |
|
script: |
|
||||||
make --dry-run -t $(params.TARGET) &> /dev/null && make $(params.TARGET) || echo "No '$(params.TARGET)' target found, skipping"
|
make --dry-run $(params.TARGET) &> /dev/null || (echo "No '$(params.TARGET)' target found, skipping" && exit 0)
|
||||||
|
make $(params.TARGET)
|
||||||
env:
|
env:
|
||||||
- name: REPO
|
- name: REPO
|
||||||
value: $(params.REPO)
|
value: $(params.REPO)
|
||||||
- name: PR_ID
|
- name: PR_ID
|
||||||
value: $(params.PR_ID)
|
value: $(params.PR_ID)
|
||||||
|
- name: SHA
|
||||||
|
value: $(params.SHA)
|
||||||
- name: ACCESS_TOKEN
|
- name: ACCESS_TOKEN
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: gitea-access-token
|
name: gitea-access-token
|
||||||
key: access-token
|
key: access-token
|
||||||
|
- name: KUBECONFIG
|
||||||
|
value: /root/.kube/config
|
||||||
|
volumeMounts:
|
||||||
|
- name: kubeconfig
|
||||||
|
mountPath: /root/.kube/config
|
||||||
|
subPath: config
|
||||||
|
volumes:
|
||||||
|
- name: kubeconfig
|
||||||
|
secret:
|
||||||
|
secretName: kubeconfig
|
||||||
|
Loading…
Reference in New Issue
Block a user