-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-Angular
46 lines (40 loc) · 1.25 KB
/
Jenkinsfile-Angular
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
46
pipeline {
agent any
environment {
PATH = "/usr/local/bin:$PATH"
}
stages {
stage('Clone the repository') {
steps {
// Clone the repo
sh 'git clone https://github.com/yusufsefasezer/angular-contact-list'
}
}
stage('Build angular app') {
steps {
// Install dependencies and build the Angular app
// Install dependencies and build the Angular app
dir('angular-contact-list') {
// Install npm dependencies
// Build the Angular app
sh '''
npm install
ng build
'''
}
}
}
stage('Deploy') {
steps {
// Deploy the Angular app (e.g., copy files to a web server)
sh 'scp -i /var/lib/jenkins/secrets/sshkey_rsa -r angular-contact-list/dist/contact [email protected]:/var/www/html'
}
}
}
post {
always {
// Clean up after the build
sh 'rm -rf angular-contact-list'
}
}
}