Last active
August 17, 2018 13:17
-
-
Save LeandroFranciscato/e6f77d39b6cddf87a0bce5b34b9530a9 to your computer and use it in GitHub Desktop.
Yml utilizado para Build e Deploy de um Projeto java (jar)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: JAVA:latest | |
before_script: | |
- /home/leandro/netbeans-8.2/java/maven/bin/mvn clean install | |
after_script: | |
stages: | |
- build_deploy_dev | |
- build_deploy_production | |
build_&_deploy_production: | |
stage: build_deploy_production | |
only: | |
- master | |
script: | |
- cd target | |
- scp EnviaEmail-1.0-SNAPSHOT-jar-with-dependencies.jar [email protected]:/home/ifrfid/jars/EnviaEmail/ | |
- ssh [email protected] "pkill -f java.*EnviaEmail < /dev/null > /home/ifrfid/jars/EnviaEmail/KillEnviaEmail.log 2>&1 &" | |
- ssh [email protected] "java -jar /home/ifrfid/jars/EnviaEmail/EnviaEmail-1.0-SNAPSHOT-jar-with-dependencies.jar -Xmx256m < /dev/null > /home/ifrfid/jars/EnviaEmail/EnviaEmail.log 2>&1 &" | |
build_&_deploy_dev: | |
stage: build_deploy_dev | |
except: | |
- master | |
script: | |
- cd target | |
- scp EnviaEmail-1.0-SNAPSHOT-jar-with-dependencies.jar [email protected]:/home/leandro/Desktop | |
- ssh [email protected] "kill $(ps -ef | grep EnviaEmail | grep -v grep | awk '{print $2}') < /dev/null > /home/leandro/Desktop/KillEnviaEmail.log 2>&1 &" | |
- ssh [email protected] "java -jar /home/leandro/Desktop/EnviaEmail-1.0-SNAPSHOT-jar-with-dependencies.jar -Xmx256m < /dev/null > /home/leandro/Desktop/EnviaEmail.log 2>&1 &" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment