Skip to content

Instantly share code, notes, and snippets.

@SeunMatt
Created March 22, 2019 11:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeunMatt/81e15f78118c0029acb39473fac703ea to your computer and use it in GitHub Desktop.
Save SeunMatt/81e15f78118c0029acb39473fac703ea to your computer and use it in GitHub Desktop.
stages:
- build
- deploy
maven-build:
image: maven:3-jdk-8
stage: build
script: "mvn package -B"
artifacts:
paths:
- target/ROOT.war
deploy-production:
only:
- master
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
stage: deploy
script:
- sshpass -V
- export SSHPASS=$USER_PASS
- sshpass -e scp -o StrictHostKeyChecking=no target/ROOT.war ci@0.0.0.10:/home/ci
- sshpass -e ssh -tt -o StrictHostKeyChecking=no ci@0.0.0.10 sudo mv /home/ci/ROOT.war /opt/tomcat/webapps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment