mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-12 13:28:32 +03:00
encrypt script for travis
This commit is contained in:
@@ -13,7 +13,8 @@
|
|||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-push": "sh ./scripts/encrypt.sh"
|
"pre-commit": "sh ./scripts/encrypt.sh",
|
||||||
|
"pre-push": "yarn lint && yarn test"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
travis encrypt-file .env --add --force
|
echo "Encrypting .env file for Travis..."
|
||||||
git add .env.enc
|
if hash travis 2>/dev/null; then
|
||||||
git commit -m "TRAVIS: add encrypted key"
|
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 --pro
|
||||||
|
git add .env.enc
|
||||||
|
git add .travis.yml
|
||||||
|
echo ".env.enc created and added to commit"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "============================================================================================"
|
||||||
|
echo "ERROR: Travis CLI is not installed on your local. Please install from:"
|
||||||
|
echo "\thttps://github.com/travis-ci/travis.rb"
|
||||||
|
echo "After installing, make sure that you login with:"
|
||||||
|
echo "\ttravis login --pro"
|
||||||
|
echo "============================================================================================"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user