Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions CICD pipeline with maven and jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CICD pipline with maven and jenkins

on: [push, workflow_dispatch]

jobs:

CICDjob:

runs-on: ubuntu-latest

steps:

- name: clone the repo on ubuntu server

uses: actions/checkout@v4

- name: install java and maven on ubuntu server

uses: actions/setup-java@v3

with:

java-version: 11

cache: 'maven'

distribution: 'temurin'

- name: Build the source code and .war file

run: mvn package

- name: connect to lab and depoloy code on tomcat9

uses: cross-the-world/ssh-scp-ssh-pipelines@latest

with:

host: '3.109.48.70'

port: 22

user: 'labuser'

pass: 'Nuvelabs123$'

connect_timeout: 10s

first_ssh: |

sudo chmod 777 /var/lib/tomcat9/webapps

scp: |

'./target/*.war' => /var/lib/tomcat9/webapps

last_ssh: |

sudo systemctl restart tomcat9

- name: Connect to lab and trigger Jenkins job to deploy code on tomcat9

uses: cross-the-world/ssh-scp-ssh-pipelines@latest

with:

host: '3.109.48.70'

port: 22

user: 'labuser'

pass: 'Nuvelabs123$'

connect_timeout: 10s

first_ssh: |

sudo curl -l -u admin:115593825ca2975f5fdd181a936862d4db
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down