Skip to content

Commit 7bdd2dd

Browse files
committed
use jq to parse customer json
1 parent da9e923 commit 7bdd2dd

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/mlflow-ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ jobs:
168168
- name: Set up chart-testing
169169
uses: helm/[email protected]
170170

171+
# Install jq via apt-get
172+
- name: Install jq
173+
run: |
174+
sudo apt-get update
175+
sudo apt-get install -y jq
176+
171177
# Get license ID from customer inspect
172178
- name: Get License ID
173179
id: get-license
@@ -179,15 +185,18 @@ jobs:
179185
replicated/vendor-cli:latest \
180186
customer inspect --customer "automated-${{ github.run_id }}" --output json)
181187
182-
# Extract the installationID from the JSON
183-
INSTALLATION_ID=$(echo "$CUSTOMER_JSON" | grep -o '"installationId":"[^"]*"' | cut -d'"' -f4)
188+
# Use jq to properly extract the installationId
189+
INSTALLATION_ID=$(echo "$CUSTOMER_JSON" | jq -r '.installationId')
184190
185-
if [ -z "$INSTALLATION_ID" ]; then
191+
if [ -z "$INSTALLATION_ID" ] || [ "$INSTALLATION_ID" = "null" ]; then
186192
echo "Failed to extract installationId from customer JSON"
187-
echo "$CUSTOMER_JSON" | grep -C 3 installationId || echo "installationId not found"
193+
echo "JSON structure:"
194+
echo "$CUSTOMER_JSON" | jq 'del(.installationId)' # Print JSON without the license ID
188195
exit 1
189196
fi
190-
197+
198+
# Don't print the actual license ID, just indicate success
199+
echo "Successfully extracted installationId"
191200
echo "license_id=$INSTALLATION_ID" >> $GITHUB_OUTPUT
192201
193202
- name: Create Cluster
@@ -209,6 +218,7 @@ jobs:
209218
# Authenticate with the Replicated registry
210219
- name: Login to Replicated registry
211220
run: |
221+
echo "Authenticating with Replicated registry using license ID from previous step"
212222
cd applications/mlflow
213223
make registry-login
214224
env:

0 commit comments

Comments
 (0)