admin管理员组文章数量:1123158
I'm trying to create a custom bitbucket pipeline which has 2 inputs - version and target environment that deploys a specific version of the app(based on git tags) to different environments.
image: python:3.12
clone:
enabled: true
depth: full
lfs: false
definitions:
caches:
sonar: ~/.sonar/cache
pipelines:
custom:
ReleaseToEnvironment:
- variables:
- name: VERSION
description: Enter version to deploy like v1.0.0
- name: TARGET_ENV
description: Image will be tagged with this value.
default: qa
allowed-values:
- qa
- preview
- step:
name: Checkout version
script:
- git describe --tags #outputs the most recent tag - v1.2.0
- echo "Deploying version ${VERSION} to $Environment environment..."
- git checkout tags/$VERSION
- git describe --tags #outputs the tag I want - v1.0.0
- step:
script:
- git describe --tags #again back to most recent tag v1.2.0
But the problem is if I checkout tag (say v1.0.0) in step 1, it's back to the most recent tags in all the subsequent steps. Like I never did the checkout. How can I stash or persist the git checkout in 1 step so that it stays there in the following step?
Thanks in advance.
本文标签: Issue with Persisting Git Checkout State Across Multiple Steps in Bitbucket PipelinesStack Overflow
版权声明:本文标题:Issue with Persisting Git Checkout State Across Multiple Steps in Bitbucket Pipelines - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736552347a1944528.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论