Skip to content

Commit

Permalink
AppImages OSUOSL: use expect
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 18, 2017
1 parent 0351aec commit 041595c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ matrix:
- bsdtar
- curl
- zsync
- expect
services:
- docker
script:
Expand All @@ -78,6 +79,7 @@ matrix:
# - bsdtar
# - curl
# - zsync
# - expect
# services:
# - docker
# script:
Expand All @@ -91,6 +93,7 @@ matrix:
# - bsdtar
# - curl
# - zsync
# - expect
# services:
# - docker
# before_script:
Expand Down
15 changes: 9 additions & 6 deletions build/travis/job2_AppImage/osuosl.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
#!/bin/bash

# Do not upload artefacts generated as part of a pull request
if [ $(env | grep TRAVIS_PULL_REQUEST) ] ; then
if [ $(env | grep TRAVIS_PULL_REQUEST) == "TRAVIS_PULL_REQUEST" ] ; then
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
echo "Not uploading AppImage since this is a pull request."
exit 0
fi
fi


FILE="$1"
[ -f "$FILE" ] || { echo "$0: Please provide a valid path to a file" >&2 ; exit 1 ;}

# instal ssh key
openssl aes-256-cbc -K $encrypted_99b076488ab1_key -iv $encrypted_99b076488ab1_iv -in build/travis/resources/osuosl_nighlies_rsa.enc -out build/travis/resources/osuosl_nighlies_rsa -d -pass "pass:$OSUOSL_NIGHTLY_PASSPHRASE"
# Make ssh dir
mkdir $HOME/.ssh/
openssl aes-256-cbc -K $encrypted_99b076488ab1_key -iv $encrypted_99b076488ab1_iv -in build/travis/resources/osuosl_nighlies_rsa.enc -out build/travis/resources/osuosl_nighlies_rsa -d

# Copy over private key, and set permissions
cp build/travis/resources/osuosl_nighlies_rsa $HOME/.ssh/osuosl_nighlies_rsa
# set permission
Expand All @@ -26,7 +24,12 @@ touch $HOME/.ssh/known_hosts
ssh-keyscan ftp-osl.osuosl.org >> $HOME/.ssh/known_hosts

eval "$(ssh-agent -s)"
ssh-add $HOME/.ssh/osuosl_nighlies_rsa
expect << EOF
spawn ssh-add $HOME/.ssh/osuosl_nighlies_rsa
expect "Enter passphrase"
send "${OSUOSL_NIGHTLY_PASSPHRASE}\r"
expect eof
EOF

SSH_INDENTITY=$HOME/.ssh/osuosl_nighlies_rsa

Expand Down

0 comments on commit 041595c

Please sign in to comment.