File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 10
10
printenv
11
11
12
12
response=$( curl -X POST --url ' https://circleci.com/api/v2/context' \
13
- -H ' Circle-Token: $CIRCLE_TOKEN ' \
13
+ -H ' Circle-Token: f7aa3b819623c1cc786dd39bb9e09742c47fea3c ' \
14
14
-H ' content-type: application/json' \
15
15
-d ' {"name":"php-context2","owner":{"id":"5d18d3c7-f8c4-4c5f-a691-b730e67047d3","type":"organization"}}' --write-out ' %{http_code}' --silent --output /dev/null servername)
16
16
context_id=${ response | jq -r ' .id' }
@@ -20,16 +20,13 @@ env | while IFS= read -r line; do
20
20
name=${line%% =* }
21
21
echo " V: $value "
22
22
echo " N: $name "
23
- if [[ " $response " -ne 200 ]] ; then
24
- echo " API returned $status_code "
25
- else
23
+ # "message" : "Invalid JSON body." nov 27
26
24
curl --request PUT \
27
- --url https://circleci.com/api/v2/context/%7Bcontext-id%7D/environment-variable/POSTGRES_USER \
28
- --header ' authorization: Basic REPLACE_BASIC_AUTH' \
29
- --header ' content-type: application/json' \
30
- --data ' {"value":"some-secret-value"}'
31
- fi
32
- don
25
+ --url https://circleci.com/api/v2/context/%7B$context_id %7D/environment-variable/$name \
26
+ -H ' Circle-Token: f7aa3b819623c1cc786dd39bb9e09742c47fea3c' \
27
+ -H ' content-type: application/json' \
28
+ --data ' {"value":$value}'
29
+ done
33
30
34
31
# Create new context for PHP application environment variables
35
32
You can’t perform that action at this time.
0 commit comments