@@ -60,18 +60,16 @@ commands:
6060 echo "Saving version-tag to << parameters.workspace >>/<< parameters.versionfile >>"
6161 echo "$VERSION_TAG" >> << parameters.workspace >>/<< parameters.versionfile >>
6262 echo "export VERSION_TAG=\"$CIRCLE_BUILD_NUM-$COMMIT_TAG\"" >> $BASH_ENV
63+
64+ echo "Created version tag: VERSION_TAG=${VERSION_TAG}
65+ This will be available in all steps in this job,
66+ but not in other jobs as part of the workflow.
67+ To use in other jobs, add the version-tag/get command in them."
6368 fi
6469 - persist_to_workspace :
6570 root : << parameters.workspace >>
6671 paths :
6772 - << parameters.versionfile >>
68- - run :
69- name : Print Version Tag
70- command : |
71- echo "Created version tag: VERSION_TAG=${VERSION_TAG}
72- This will be available in all steps in this job,
73- but not in other jobs as part of the workflow.
74- To use in other jobs, add the version-tag command to them."
7573
7674 get :
7775 parameters :
@@ -89,14 +87,22 @@ commands:
8987 and cat the contents of the file where you need it. E.g. export VERSION_TAG=$(cat version.txt)
9088 type : string
9189 steps :
90+ - attach_workspace :
91+ at : << parameters.workspace >>
9292 - run :
9393 name : Get Version Tag
9494 command : |
9595 if [ -f << parameters.workspace >>/<< parameters.versionfile >> ]; then
9696 echo "<< parameters.versionfile >> already present in your workspace, setting enviroment variable."
9797 echo "export VERSION_TAG=$(cat << parameters.workspace >>/<< parameters.versionfile >>)" >> $BASH_ENV
98+
99+ echo "Got version tag: VERSION_TAG=${VERSION_TAG}
100+ This will be available in all steps in this job,
101+ but not in other jobs as part of the workflow.
102+ To use in other jobs, add the version-tag/get command in them."
98103 else
99104 echo "Unabled to file version tag in << parameters.workspace >>/<< parameters.versionfile >>, run the create command first."
105+ exit 1
100106 fi
101107description : |
102108 Common commands used by Commit in our build pipelines. See this orb's source: https://github.com/commitdev/circleci-orbs
0 commit comments