Created
January 15, 2021 17:00
-
-
Save lovromazgon/f51727d3fd4b903d0eca57d0fe2f9790 to your computer and use it in GitHub Desktop.
Duplicate a SemaphoreCI secret.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# ./sem-copy-secret.sh [source secret name] [target secret name] | |
set -e | |
SOURCE_SECRET="$1" | |
TARGET_SECRET="$2" | |
echo "Copying secret $SOURCE_SECRET to $TARGET_SECRET" | |
sem get secret "$SOURCE_SECRET" | sed "s/$SOURCE_SECRET/$TARGET_SECRET/g" > "/tmp/$TARGET_SECRET.yaml" | |
sem create -f "/tmp/$TARGET_SECRET.yaml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment