-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
31 lines (30 loc) · 977 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pipeline{
agent any
tools {nodejs 'node'}
stages{
stage("Test"){
steps{
echo('This is the Test stage')
}
}
stage("Build stage"){
steps{
echo('This is the build stage')
sh '''
sudo ssh -i /home/ubuntu/project.pem -t -o StrictHostKeyChecking=no ubuntu@ec2-3-86-158-102.compute-1.amazonaws.com
cd /var/www/
sudo rm -rf html
sudo mkdir html
cd html
pm2 kill
sudo git init
sudo git config --global --add safe.directory /var/www/html
sudo git remote add origin https://github.com/Fearreece/simple_server.git
sudo git pull origin main
sudo npm install
PORT=80 pm2 start server.js
'''
}
}
}
}