Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Yml utilizado para Build e Deploy de um Projeto java (jar)
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 root@192.168.2.60:/home/ifrfid/jars/EnviaEmail/
- ssh root@192.168.2.60 "pkill -f java.*EnviaEmail < /dev/null > /home/ifrfid/jars/EnviaEmail/KillEnviaEmail.log 2>&1 &"
- ssh root@192.168.2.60 "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 root@192.168.0.147:/home/leandro/Desktop
- ssh root@192.168.0.147 "kill $(ps -ef | grep EnviaEmail | grep -v grep | awk '{print $2}') < /dev/null > /home/leandro/Desktop/KillEnviaEmail.log 2>&1 &"
- ssh root@192.168.0.147 "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
You can’t perform that action at this time.