build: Revert using export and refactor to gracefully exit on an empty value
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2023-07-13 10:33:33 +02:00
parent f4457a1275
commit cbd981cf19

View File

@ -24,7 +24,7 @@ steps:
@semantic-release/commit-analyzer \ @semantic-release/commit-analyzer \
@semantic-release/exec \ @semantic-release/exec \
- | - |
GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY} export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
- | - |
npx semantic-release \ npx semantic-release \
--package @semantic-release/exec \ --package @semantic-release/exec \
@ -48,7 +48,7 @@ steps:
pull: always pull: always
commands: commands:
- | - |
IMAGE_TAG=$(cat .version) || exit 0 export IMAGE_TAG=$(cat .version) && [ -n "$IMAGE_TAG" ] || { exit 0 }
- | - |
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq
chmod +x /bin/jq chmod +x /bin/jq
@ -73,7 +73,7 @@ steps:
pull: always pull: always
commands: commands:
- | - |
IMAGE_TAG=$(cat .version) || exit 0 export IMAGE_TAG=$(cat .version) && [ -n "$IMAGE_TAG" ] || { exit 0 }
- | - |
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -qO /bin/jq
chmod +x /bin/jq chmod +x /bin/jq
@ -98,7 +98,7 @@ steps:
pull: always pull: always
commands: commands:
- | - |
CHART_VERSION=$(cat .version) || exit 0 export CHART_VERSION=$(cat .version) && [ -n "$CHART_VERSION" ] || { exit 0 }
sed -i 's/{{ chart_version }}/'$CHART_VERSION'/g' charts/json-server/Chart.yaml sed -i 's/{{ chart_version }}/'$CHART_VERSION'/g' charts/json-server/Chart.yaml
sed -i 's/tag: latest/tag: '$CHART_VERSION'/g' charts/json-server/values.yaml sed -i 's/tag: latest/tag: '$CHART_VERSION'/g' charts/json-server/values.yaml
- | - |
@ -129,7 +129,7 @@ steps:
pull: always pull: always
commands: commands:
- | - |
IMAGE_TAG=$(cat .version) || exit 0 export VALID_TAG=$(cat .version) && [ -n "$VALID_TAG" ] || { exit 0 }
- | - |
apt-get update apt-get update
- | - |
@ -144,7 +144,7 @@ steps:
@semantic-release/git \ @semantic-release/git \
@semantic-release/release-notes-generator @semantic-release/release-notes-generator
- | - |
GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY} export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
- | - |
npx semantic-release \ npx semantic-release \
--branches ${DRONE_BRANCH} \ --branches ${DRONE_BRANCH} \