Skip to content

Commit a0d76d5

Browse files
committed
fix version parsing
1 parent fd7b46d commit a0d76d5

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

azure/templates/deploy-service.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ steps:
122122
- bash: |
123123
set -euo pipefail
124124
125-
echo "Setting variables"
126125
export SERVICE_NAME="${{ parameters.service_name }}"
127126
export PROXIES_DIR="$(SERVICE_DIR)/proxies"
128127
export SERVICE_BASE_PATH="${{ parameters.service_base_path }}"
@@ -132,28 +131,21 @@ steps:
132131
export SOURCE_COMMIT_ID=$(Build.SourceVersion)
133132
export RELEASE_RELEASEID=$(Build.BuildId)
134133
135-
echo "Setting assumed version"
136134
export ASSUMED_VERSION=`echo $SERVICE_ARTIFACT_NAME | ( grep -E -o "v[0-9]+\.[0-9]+\.[0-9]+-?[a-z]*" || true ) | tail -1`
137-
echo "Setting deployed version"
138135
if [[ ! -z $ASSUMED_VERSION ]]; then
139-
echo "Setting deployed=assumed"
140136
export DEPLOYED_VERSION=$ASSUMED_VERSION
141137
else
142-
echo "Setting FQSN"
143138
export DEPLOYED_VERSION="${{ parameters.fully_qualified_service_name }}"
144139
fi
145140
146-
echo "Sourcing build vars"
147141
if [ -f $(SERVICE_DIR)/.build_env_vars ]; then
148142
source $(SERVICE_DIR)/.build_env_vars
149143
fi
150144
151-
echo "Templating proxies"
152145
cd $(UTILS_DIR)
153146
ANSIBLE_FORCE_COLOR=yes \
154147
make --no-print-directory -C ansible template-proxies
155148
156-
echo "Adding GUIDS policy"
157149
if [ -f $(SERVICE_DIR)/manifest.yml ]; then
158150
DIST_DIR=$(SERVICE_DIR) \
159151
PROXY_DIR=${{ parameters.proxy_path }} \
@@ -211,8 +203,9 @@ steps:
211203
212204
source $(SERVICE_DIR)/.build_env_vars
213205
214-
if [[ $SERVICE_ARTIFACT_NAME == v* ]]; then
215-
export DEPLOYED_VERSION=`echo $SERVICE_ARTIFACT_NAME | grep -E -o "v[0-9]+\.[0-9]+\.[0-9]+-?[a-z]*" | tail -1`
206+
export ASSUMED_VERSION=`echo $SERVICE_ARTIFACT_NAME | ( grep -E -o "v[0-9]+\.[0-9]+\.[0-9]+-?[a-z]*" || true ) | tail -1`
207+
if [[ ! -z $ASSUMED_VERSION ]]; then
208+
export DEPLOYED_VERSION=$ASSUMED_VERSION
216209
else
217210
export DEPLOYED_VERSION="${{ parameters.fully_qualified_service_name }}"
218211
fi

0 commit comments

Comments
 (0)