diff --git a/.env.enc b/.env.enc index 063d190..4424eaf 100644 Binary files a/.env.enc and b/.env.enc differ diff --git a/.travis.yml b/.travis.yml index 164ebb0..e3a8761 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,7 @@ script: - yarn lint - yarn test before_install: +- openssl aes-256-cbc -K $encrypted_eeb74e8d35d1_key -iv $encrypted_eeb74e8d35d1_iv + -in .env.enc -out .env -d - openssl aes-256-cbc -K $encrypted_fb307c69bf51_key -iv $encrypted_fb307c69bf51_iv -in .env.enc -out .env -d diff --git a/scripts/encrypt.sh b/scripts/encrypt.sh index 509b2c1..932f43f 100644 --- a/scripts/encrypt.sh +++ b/scripts/encrypt.sh @@ -1,18 +1,14 @@ #!/bin/bash echo "Encrypting .env file for Travis..." -if hash travis 2>/dev/null; then - if [ ! -f .env ]; then - echo "============================================================================================" - echo "ERROR: You must create a .env file and add your credentials. See .env.example for an example" - echo "============================================================================================" - exit 3 - else - travis encrypt-file .env --add --force --org - git add .env.enc - git add .travis.yml - echo ".env.enc created and added to commit" - fi -else + +# confirm that user has access to forensic architecture datasheet +# if [ ! -z "$(travis repos | grep "forensic-architecture/datasheet-server")" ] +# echo "No travis encrypt possible, skipping this step." +# exit 0 +# fi + +# confirm travis is installed +if [ ! hash travis 2>/dev/null ]; then echo "============================================================================================" echo "ERROR: Travis CLI is not installed on your local. Please install from:" echo "\thttps://github.com/travis-ci/travis.rb" @@ -21,3 +17,16 @@ else echo "============================================================================================" exit 3 fi + +# confirm there is a .env file to encrypt +if [ ! -f .env ]; then + echo "============================================================================================" + echo "ERROR: You must create a .env file and add your credentials. See .env.example for an example" + echo "============================================================================================" + exit 3 +fi + +travis encrypt-file .env --add --force --org +git add .env.enc +git add .travis.yml +echo ".env.enc created and added to commit"