-
Notifications
You must be signed in to change notification settings - Fork 0
/
nullplatform-application-metadata.yml
27 lines (25 loc) · 1.32 KB
/
nullplatform-application-metadata.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
stages:
- nullplatform-application-metadata
variables:
RUNNER_TAG: $RUNNER_TAG
NULLPLATFORM_API_KEY: $NULLPLATFORM_API_KEY
NULLPLATFORM_ENCRIPTION_KEY: $NULLPLATFORM_ENCRIPTION_KEY
NULLPLATFORM_APPLICATION_METADATA_URL: "https://ci.nullplatform.com/application"
NULLPLATFORM_APPLICATION_METADATA_PARAMS: "repository_url=$CI_PROJECT_URL"
NULLPLATFORM_APPLICATION_METADATA_HEADERS: "Content-Type: application/json"
nullplatform-application-metadata:
stage: nullplatform-application-metadata
image: alpine:latest
before_script:
- apk add --no-cache openssl curl jq
- openssl enc -d -iter 1000 -aes-256-cbc -in nullplatform_login.response.json.enc -out nullplatform_login.response.json -k "$NULLPLATFORM_ENCRIPTION_KEY"
- ACCESS_TOKEN=$(cat nullplatform_login.response.json | jq -r '.access_token')
script:
- NULLPLATFORM_APPLICATION_METADATA_RESPONSE=$(curl --fail --http1.1 --retry 3 --retry-connrefused --retry-all-errors -H "Authorization:Bearer $ACCESS_TOKEN" -H "$NULLPLATFORM_APPLICATION_METADATA_HEADERS" "$NULLPLATFORM_APPLICATION_METADATA_URL?$NULLPLATFORM_APPLICATION_METADATA_PARAMS")
- printf "%s" "$NULLPLATFORM_APPLICATION_METADATA_RESPONSE" > nullplatform_application_metadata.json
artifacts:
paths:
- nullplatform_application_metadata.json
expire_in: 30 min
except:
- tags