-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
42 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,53 +10,64 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
timeout-minutes: 12 | ||
|
||
- run: | | ||
docker version | ||
- name: run Docker hello-world | ||
run: docker run hello-world | ||
|
||
- name: brew vault | ||
run: brew install hashicorp/tap/vault | ||
|
||
- name: Run docker-compose | ||
run: docker-compose -f ./vault-docker/docker-compose.yml up -d | ||
|
||
- name: verifying vault | ||
run: | | ||
echo "Waiting for Vault to start..." | ||
sleep 30 | ||
docker ps | ||
echo "docker images" | ||
brew tap hashicorp/tap | ||
brew install hashicorp/tap/vault | ||
echo "exporting vault addr" | ||
export VAULT_ADDR=http://127.0.0.1:8200 | ||
echo "vault status" | ||
echo $VAULT_ADDR | ||
vault status | ||
echo "login to vault" | ||
echo "starting sevrer in dev mode with token id vault-plaintext-root-token" | ||
vault server -dev -dev-root-token-id="vault-plaintext-root-token" | ||
echo "Authenticating to vault..." | ||
vault login token=vault-plaintext-root-token | ||
echo "Initializing vault..." | ||
vault secrets enable -version=1 -path=my-secrets kv | ||
echo "Adding entries..." | ||
vault kv put my-secrets/dev password=test_password | ||
echo "Complete..." | ||
vault token lookup | ||
echo "Passwort is: (next line)" | ||
echo $(vault kv get -field=password "/my-secrets/dev") | ||
mkdir $HOME/.superexport | ||
touch $HOME/.superexport/.exported.sh | ||
chmod +x $HOME/.superexport/.exported.sh | ||
chmod +x superexport.sh | ||
./superexport.sh MYKEY password /my-secrets/dev foo | ||
echo "reading secrets from from secret tools" | ||
source $HOME/.superexport/.secretreader.sh | ||
echo "mykey is $MYKEY" | ||
echo "GH_ENV=$MYKEY" >> $GITHUB_ENV | ||
- name: check if the password is correct | ||
run: | | ||
CHECKVAR="${{ env.GH_ENV }}" | ||
if [ "$CHECKVAR" = "test_password" ]; then | ||
echo "password is correct" | ||
exit 0 | ||
else | ||
echo "password is wrong" | ||
echo "password should be \"test_password\" but was $CHECKVAR" | ||
exit 1 | ||
fi | ||
# - name: Run docker-compose | ||
# run: docker-compose -f ./vault-docker/docker-compose.yml up -d | ||
|
||
# - name: verifying vault | ||
# run: | | ||
# echo "Waiting for Vault to start..." | ||
# sleep 30 | ||
# docker ps | ||
# echo "docker images" | ||
# export VAULT_ADDR=http://127.0.0.1:8200 | ||
# echo "vault status" | ||
# echo $VAULT_ADDR | ||
# vault status | ||
# echo "login to vault" | ||
# vault login token=vault-plaintext-root-token | ||
# vault token lookup | ||
# echo "Passwort is: (next line)" | ||
# echo $(vault kv get -field=password "/my-secrets/dev") | ||
# mkdir $HOME/.superexport | ||
# touch $HOME/.superexport/.exported.sh | ||
# chmod +x $HOME/.superexport/.exported.sh | ||
# chmod +x superexport.sh | ||
# ./superexport.sh MYKEY password /my-secrets/dev foo | ||
# | ||
# echo "reading secrets from from secret tools" | ||
# source $HOME/.superexport/.secretreader.sh | ||
# echo "mykey is $MYKEY" | ||
# echo "GH_ENV=$MYKEY" >> $GITHUB_ENV | ||
# - name: check if the password is correct | ||
# run: | | ||
# CHECKVAR="${{ env.GH_ENV }}" | ||
# if [ "$CHECKVAR" = "test_password" ]; then | ||
# echo "password is correct" | ||
# exit 0 | ||
# else | ||
# echo "password is wrong" | ||
# echo "password should be \"test_password\" but was $CHECKVAR" | ||
# exit 1 | ||
# fi |