- name: getversion
workingDir: $(resources.inputs.app.path)
image: gittools/gitversion:5.6.10-alpine.3.12-x64-3.1
script: |
#!/usr/bin/env ash
git tag
# so we are making a hack, that if we try to merge hotfix branch into main we should
[ -e GitVersion-hotfix.yml ] && /tools/dotnet-gitversion | grep hotfix 1>/dev/null && (echo "hotfix"; rm -rf GitVersion.yml; cp GitVersion-hotfix.yml GitVersion.yml)
# since this is a busybox we can't use bash regexp here
if echo $(params.branch) | grep -E '^refs/heads/(main|release/[0-9.]+)$' > /dev/null;
then
local_tags=$(git tag --points-at HEAD)
echo "remove local head tags"
echo $local_tags
git tag -d $local_tags
fi
/tools/dotnet-gitversion /updateprojectfiles
git status
chown -R "$(params.user_id):$(params.group_id)" "$(workspaces.source.path)"
chown -R "$(params.user_id):$(params.group_id)" "$(resources.inputs.app.path)"
echo "DONE"
so when I use kubectl edit
commend, and then try to do one more time to edit it - I get this
script: "#!/usr/bin/env ash\n# so we are making a hack, that if we try to merge
hotfix branch into main we should \n[ -e GitVersion-hotfix.yml ] && /tools/dotnet-gitversion
| grep hotfix 1>/dev/null && (echo \"hotfix\"; rm -rf GitVersion.yml; cp GitVersion-hotfix.yml
GitVersion.yml)\n\n# since this is a busybox we can't use bash regexp here\nif
echo $(params.branch) | grep -E '^refs/heads/(main|release/[0-9.]+)$' > /dev/null;\nthen\n
\ local_tags=$(git tag --points-at HEAD)\n echo \"remove local head tags\"\n
\ echo $local_tags\n git tag -d $local_tags\nfi\n\nsleep 3000\n\n/tools/dotnet-gitversion
/updateprojectfiles\ngit status\nchown -R \"$(params.user_id):$(params.group_id)\"
\"$(workspaces.source.path)\"\nchown -R \"$(params.user_id):$(params.group_id)\"
\"$(resources.inputs.app.path)\"\necho \"DONE\"\n"
workingDir: $(resources.inputs.app.path)