Combined 2 steps checkout and get-git-sha into one
This commit is contained in:
parent
7a411a7148
commit
7b12088952
@ -36,8 +36,6 @@ spec:
|
||||
value: "{{workflow.parameters.repo}}"
|
||||
- name: branch
|
||||
value: "{{workflow.parameters.branch}}"
|
||||
- - name: get-git-sha
|
||||
template: get-git-sha
|
||||
- - name: tests
|
||||
template: tests
|
||||
- - name: build-test-and-push-image
|
||||
@ -45,7 +43,7 @@ spec:
|
||||
arguments:
|
||||
parameters:
|
||||
- name: git-sha
|
||||
value: "{{steps.get-git-sha.outputs.parameters.git-sha}}"
|
||||
value: "{{steps.checkout.outputs.parameters.git-sha}}"
|
||||
|
||||
# 📦 GIT CHECKOUT
|
||||
- name: checkout
|
||||
@ -55,28 +53,13 @@ spec:
|
||||
- name: branch
|
||||
container:
|
||||
image: alpine/git
|
||||
command: [sh,-c]
|
||||
workingDir: /workspace
|
||||
args:
|
||||
- clone
|
||||
- --depth
|
||||
- "1"
|
||||
- --branch
|
||||
- "{{inputs.parameters.branch}}"
|
||||
- --single-branch
|
||||
- "{{inputs.parameters.repo}}"
|
||||
- repo
|
||||
volumeMounts:
|
||||
- name: workspace
|
||||
mountPath: /workspace
|
||||
|
||||
# Get sha of the latest commit
|
||||
- name: get-git-sha
|
||||
script:
|
||||
image: alpine/git
|
||||
command: [sh]
|
||||
workingDir: /workspace/repo
|
||||
source: |
|
||||
git rev-parse HEAD > /tmp/gitsha.txt
|
||||
- |
|
||||
git clone --depth 1 --branch "{{inputs.parameters.branch}}" --single-branch "{{inputs.parameters.repo}}" repo
|
||||
cd repo
|
||||
git rev-parse HEAD > /tmp/gitsha.txt
|
||||
volumeMounts:
|
||||
- name: workspace
|
||||
mountPath: /workspace
|
||||
|
Loading…
x
Reference in New Issue
Block a user