Skip to content

Commit

Permalink
Use volume mounts to get the source checkout
Browse files Browse the repository at this point in the history
Kick it

Specify source_artifact

Run after prefect, not clone

Reorder tasks
  • Loading branch information
samdoran committed Sep 20, 2024
1 parent d630ab5 commit 44c7542
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
25 changes: 16 additions & 9 deletions .tekton/pipeline-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ spec:
description: ""
value: $(tasks.clone-repository.results.commit)

volumes:
- name: workdir
emptyDir: {}

tasks:
- name: init
params:
Expand Down Expand Up @@ -147,9 +151,6 @@ spec:
- name: basic-auth
workspace: git-auth

- name: output
workspace: workspace

- name: prefetch-dependencies
params:
- name: input
Expand Down Expand Up @@ -187,6 +188,9 @@ spec:
params:
- name: path-context
value: $(params.path-context)

- name: source_artifact
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
taskRef:
resolver: git
params:
Expand All @@ -198,9 +202,9 @@ spec:

- name: pathInRepo
value: tasks/parse-build-deploy-script/parse-build-deploy-script.yaml
workspaces:
- name: source
workspace: workspace
volumeMounts:
- name: workdir
mountPath: /var/workdir
runAfter:
- clone-repository

Expand Down Expand Up @@ -244,6 +248,9 @@ spec:

- name: dist-folder
value: $(tasks.parse-build-deploy-script.results.dist-folder)

- name: source_artifact
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
taskRef:
resolver: git
params:
Expand All @@ -255,11 +262,11 @@ spec:

- name: pathInRepo
value: tasks/create-frontend-dockerfile/create-frontend-dockerfile.yaml
workspaces:
- name: source
workspace: workspace
runAfter:
- parse-build-deploy-script
volumeMounts:
- name: workdir
mountPath: /var/workdir

- name: build-container
params:
Expand Down
12 changes: 0 additions & 12 deletions .tekton/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,3 @@ spec:
- name: git-auth
secret:
secretName: '{{ git_auth_secret }}'

- name: workspace
volumeClaimTemplate:
metadata:
creationTimestamp: null
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
12 changes: 0 additions & 12 deletions .tekton/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,3 @@ spec:
- name: git-auth
secret:
secretName: '{{ git_auth_secret }}'

- name: workspace
volumeClaimTemplate:
metadata:
creationTimestamp: null
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}

0 comments on commit 44c7542

Please sign in to comment.