Skip to content

Commit

Permalink
Travis: test SSH to start.vertx.io
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Mar 11, 2019
1 parent 3556637 commit 703b196
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
26 changes: 25 additions & 1 deletion .travis.deploy.bash
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
echo "TODO"
set -e

echo "Extracting Starter version..."
STARTER_VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')
echo "Starter version is ${STARTER_VERSION}"

STARTER_JAR="./build/libs/vertx-starter-${STARTER_VERSION}-fat.jar"

if [ ! -f ${STARTER_JAR} ]; then
echo "Could not find file ${STARTER_JAR}"
exit 1
fi

REMOTE_USER="jenkins"
REMOTE_HOSTNAME="start.vertx.io"
REMOTE_TEMP="/tmp/vertx"

echo "Sending JAR to ${REMOTE_USER}@${REMOTE_HOSTNAME}..."
ssh "${REMOTE_USER}"@"${REMOTE_HOSTNAME}" rm -rf "${REMOTE_TEMP}" && mkdir -p "${REMOTE_TEMP}"
scp "${STARTER_JAR}" "${REMOTE_USER}"@"${REMOTE_HOSTNAME}":"${REMOTE_TEMP}"
echo "JAR sent"

echo "Deploying with ${REMOTE_USER}@${REMOTE_HOSTNAME}..."
echo "TODO"
#ssh "${REMOTE_USER}"@"${REMOTE_HOSTNAME}" "sudo -t bash -s" < ./scripts/deploy.sh
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: java
addons:
ssh_known_hosts: start.vertx.io
branches:
only:
- master
Expand All @@ -7,12 +9,21 @@ jdk: oraclejdk8
jobs:
include:
- stage: test
install: ./gradlew assemble
script: ./gradlew check -i --version #temporarily disabling tests for fast turnaround
install:
- ./gradlew assemble
script:
- ./gradlew check -i --version
- stage: deploy
if: type = push AND branch = prod
install: ./gradlew assemble
script: bash .travis.deploy.bash
before_install:
- openssl aes-256-cbc -K $encrypted_08b377984515_key -iv $encrypted_08b377984515_iv -in deploy_rsa.enc -out deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 deploy_rsa
- ssh-add deploy_rsa
install:
- ./gradlew assemble
script:
- bash .travis.deploy.bash
notifications:
email:
recipients:
Expand Down
Binary file added deploy_rsa.enc
Binary file not shown.

0 comments on commit 703b196

Please sign in to comment.