Hello Team, By following How to insert files as environment variables with Base64 – CircleCI Support Center, I am able to store data.
I have updated the context environment variable(USER_NAME) using “CircleCI API”. After successful updation, in the shell USER_NAME value still shows old value not updated value. kindly suggest.
What am i supposed to do to access updated value of USER_NAME?
version: 2.1
workflows:
version: 2
sample:
jobs:
- build-and-test:
context: ABC_CONT
jobs:
build-and-test:
docker:
- image: cimg/python:3.9.4
steps:
- run:
name: Data Update
command: |
echo "$USER_NAME" #actual user name: actUser123
curl \
--request PUT \
--url https://circleci.com/api/v2/context/0a561357XXXXXXXXXXX/environment-variable/USER_NAME \
--header 'content-type: application/json' \
-u "$CIRCLE_API_USER_TOKEN:" \
--data '{"value":"modUser123"}'
echo "$USER_NAME" #I am expecting "modUser123" but returns actUser123
- run:
name: Access updated data
command: |
echo "$USER_NAME" #I am expecting "modUser123" but returns actUser123