NodeJS script which sets up a repository with secrets for Scala/Nuget/etc publishing
- Have Hashicorp Vault address set in
VAULT_ADDRenvironment variable with LDAP authentication configured, - Run
export VAULT_TOKEN=$(vault login --method=ldap --field token username=$USER). If you use other login method, change the command accordingly. If you use LDAP, you may just runsource auth-ldap.sh. - Run
./pub-prepare --owner GITHUBPREFIX --repo GITHUBREPO
The script expects Vault to have mount ghpub configured with versioned v2 KV storage. The mount name can be altered with a command line option (use --help)
./pub-prepare --owner 7mind --repo test --writeVault true --readVault falseThis will read the secrets from terminal and write them into vault.
Vault may be provisioned with a script like:
#!/usr/bin/env bash
set -x
set -e
vault kv put -mount=$VPATH github token=ghp_blah123
vault kv put -mount=$VPATH nuget token=oyblah123
vault kv put -mount=$VPATH sonatype user=7mind password=blah123 [email protected]