Jenkins: Removes deploy application stage.

Makes pipeline less dependent to its environment. No longer needs a preconfigured slave an a host to deploy the petclinic to via SSH. The demo content can now be used on more environments.
This commit is contained in:
Johannes Schnatterer 2017-12-12 09:25:47 +01:00
parent b5b2dcf1c1
commit 6ec7e7eee2
3 changed files with 5 additions and 65 deletions

20
Jenkinsfile vendored
View file

@ -41,21 +41,11 @@ node {
}
}
parallel(
deployArtifacts: {
stage('Deploy Artifacts') {
String releaseProp = "-DaltReleaseDeploymentRepository=${cesFqdn}::default::${cesUrl}/nexus/content/repositories/releases/";
String snapshotProp = "-DaltSnapshotDeploymentRepository=${cesFqdn}::default::${cesUrl}/nexus/content/repositories/snapshots/";
mvn "-DskipTests deploy ${releaseProp} ${snapshotProp}"
}
},
deployApplication: {
stage('Deploy Application') {
sh "ansible-playbook playbook.yaml"
}
}
)
stage('Deploy Artifacts') {
String releaseProp = "-DaltReleaseDeploymentRepository=${cesFqdn}::default::${cesUrl}/nexus/content/repositories/releases/";
String snapshotProp = "-DaltSnapshotDeploymentRepository=${cesFqdn}::default::${cesUrl}/nexus/content/repositories/snapshots/";
mvn "-DskipTests deploy ${releaseProp} ${snapshotProp}"
}
}
// Archive Unit and integration test results, if any

View file

@ -1,39 +0,0 @@
---
- hosts: all
become: yes
gather_facts: yes
tasks:
- name: Copy systemd descriptor
copy:
src: src/main/systemd/spring-petclinic.service
dest: /etc/systemd/system/spring-petclinic.service
notify:
- reload systemd
- name: Copy spring-petclinic
copy:
src: target/spring-petclinic.jar
dest: /opt/spring-petclinic.jar
owner: deploy
mode: u+rwx
notify:
- restart service
- name: Enable service
service:
name: spring-petclinic
enabled: yes
handlers:
- name: reload systemd
systemd:
name: spring-petclinic
daemon_reload: yes
- name: restart service
service:
name: spring-petclinic
state: restarted

View file

@ -1,11 +0,0 @@
[Unit]
Description=spring-petclinic
After=syslog.target
[Service]
User=deploy
ExecStart=/opt/spring-petclinic.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target