35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: git-semver
|
|
namespace: goghvideo-cicd-pipeline
|
|
spec:
|
|
params:
|
|
- name: gitrepositoryurl
|
|
type: string
|
|
- name: gitbranch
|
|
type: string
|
|
default: master
|
|
results:
|
|
- name: version
|
|
type: string
|
|
steps:
|
|
- name: clone-and-calculate-semver
|
|
image: quay01.ipa.endofday.com/goghvideo/gitversion:latest
|
|
env:
|
|
- name: PARAM_REPO
|
|
value: $(params.gitrepositoryurl)
|
|
- name: PARAM_BRANCH
|
|
value: $(params.gitbranch)
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
USERNAME=$(cat /workspace/gitauth/username)
|
|
PASSWORD=$(cat /workspace/gitauth/password)
|
|
/tools/dotnet-gitversion /url ${PARAM_REPO} /b ${PARAM_BRANCH} /u ${USERNAME} /p ${PASSWORD} /dynamicRepoLocation /workspace/repo /overrideconfig mode=Mainline /showvariable MajorMinorPatch /verbosity quiet > $(results.version.path)
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 65532
|
|
workspaces:
|
|
- name: repo
|
|
- name: gitauth
|