Skip to content

Commit

Permalink
chore: Remove secure repo and fetch secrets from AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
syedimranhassan committed Oct 25, 2023
1 parent 7e512c7 commit b52245b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions devops/resources/user-retirement-archiver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ pip install -r util/jenkins/requirements.txt
# hide the sensitive information in the logs
set +x

SECRET_YAML=$(aws secretsmanager get-secret-value --secret-id "${SECRET_ARN}" --region "us-east-1" --output json | jq -r '.SecretString' | yq -y .)
CONFIG_YAML=$(aws secretsmanager get-secret-value --secret-id "${SECRET_ARN}" --region "us-east-1" --output json | jq -r '.SecretString' | yq -y .)

# Create a temporary file to store the YAML
temp_yaml_file=$(mktemp $WORKSPACE/tempfile.XXXXXXXXXX.yml)
TEMP_CONFIG_YAML=$(mktemp $WORKSPACE/tempfile.XXXXXXXXXX.yml)

# Write the YAML data to the temporary file
echo "$SECRET_YAML" > "$temp_yaml_file"
echo "$CONFIG_YAML" > "$TEMP_CONFIG_YAML"

set -x

Expand All @@ -41,12 +41,12 @@ fi

# Call the script to read the retirement statuses from the LMS, send them to S3, and delete them from the LMS.
python scripts/retirement_archive_and_cleanup.py \
--config_file=$temp_yaml_file \
--config_file=$TEMP_CONFIG_YAML \
--cool_off_days=$COOL_OFF_DAYS \
--batch_size=$BATCH_SIZE \
--start_date=$START_DATE \
--end_date=$END_DATE \
--dry_run=$DRY_RUN

# Remove the temporary file after processing
rm -f "$temp_yaml_file"
rm -f "$TEMP_CONFIG_YAML"

0 comments on commit b52245b

Please sign in to comment.