-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsFile
45 lines (41 loc) · 1.08 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
pipeline {
agent any
environment {
PATH = "/usr/local/bin/:$PATH"
HOME="/var/root/.jenkins"
}
stages {
stage('Checkout') {
steps {
git branch: 'main',
url: '[email protected]:meta-magic/pipelinetest.git',
credentialsId: 'mygithubssh'
}
}
stage('Build') {
steps {
echo 'Build the App'
echo "PATH is: $PATH"
sh 'npm i'
sh 'ng build --prod'
}
}
stage('Test1') {
steps {
echo 'Test the App'
sh 'ls -ltr'
}
}
stage('Staging') {
steps {
echo 'Deploy the App in Staging'
echo "HOME is: $HOME"
sh 'git add docs'
sh 'git commit -m "docs"'
sshagent(credentials : ['mygithubssh']) {
sh 'git push -f origin HEAD:main'
}
}
}
}
}