forked from maksrom/javascript-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravis_key.sh
More file actions
executable file
·21 lines (16 loc) · 944 Bytes
/
travis_key.sh
File metadata and controls
executable file
·21 lines (16 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
ssh-keygen -t rsa -N "" -C travis -f ./travis_key
# i only tested the encrypting on Linux.
# on mac you need gsplit instead of split, but the rest should be mostly the same
#
# decryption works on both linux and mac travis-workers
echo " # id_rsa"
gbase64 --wrap=0 ./travis_key > ./travis_key_base64
ENCRYPTION_FILTER="echo \$(echo \" - secure: \")\$(travis encrypt \"\$FILE='\`cat $FILE\`'\" -r iliakan/javascript-nodejs)"
gsplit --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ./travis_key_base64 id_rsa_
rm ./travis_key_base64
echo " # id_rsa.pub"
gbase64 --wrap=0 ./travis_key.pub > ./travis_key_base64.pub
ENCRYPTION_FILTER="echo \$(echo \" - secure: \")\$(travis encrypt \"\$FILE='\`cat $FILE\`'\" -r iliakan/javascript-nodejs)"
gsplit --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ./travis_key_base64.pub id_rsa_pub_
rm ./travis_key_base64.pub