mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 13:35:50 +00:00
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:
parent
b5b2dcf1c1
commit
6ec7e7eee2
3 changed files with 5 additions and 65 deletions
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
Loading…
Reference in a new issue