mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-12 13:28:32 +03:00
refactor encrypt script to be more readable
This commit is contained in:
@@ -13,5 +13,7 @@ script:
|
|||||||
- yarn lint
|
- yarn lint
|
||||||
- yarn test
|
- yarn test
|
||||||
before_install:
|
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
|
- openssl aes-256-cbc -K $encrypted_fb307c69bf51_key -iv $encrypted_fb307c69bf51_iv
|
||||||
-in .env.enc -out .env -d
|
-in .env.enc -out .env -d
|
||||||
|
|||||||
@@ -1,18 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "Encrypting .env file for Travis..."
|
echo "Encrypting .env file for Travis..."
|
||||||
if hash travis 2>/dev/null; then
|
|
||||||
if [ ! -f .env ]; then
|
# confirm that user has access to forensic architecture datasheet
|
||||||
echo "============================================================================================"
|
# if [ ! -z "$(travis repos | grep "forensic-architecture/datasheet-server")" ]
|
||||||
echo "ERROR: You must create a .env file and add your credentials. See .env.example for an example"
|
# echo "No travis encrypt possible, skipping this step."
|
||||||
echo "============================================================================================"
|
# exit 0
|
||||||
exit 3
|
# fi
|
||||||
else
|
|
||||||
travis encrypt-file .env --add --force --org
|
# confirm travis is installed
|
||||||
git add .env.enc
|
if [ ! hash travis 2>/dev/null ]; then
|
||||||
git add .travis.yml
|
|
||||||
echo ".env.enc created and added to commit"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "============================================================================================"
|
echo "============================================================================================"
|
||||||
echo "ERROR: Travis CLI is not installed on your local. Please install from:"
|
echo "ERROR: Travis CLI is not installed on your local. Please install from:"
|
||||||
echo "\thttps://github.com/travis-ci/travis.rb"
|
echo "\thttps://github.com/travis-ci/travis.rb"
|
||||||
@@ -21,3 +17,16 @@ else
|
|||||||
echo "============================================================================================"
|
echo "============================================================================================"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user