-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
57 lines (51 loc) · 1.48 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
46
47
48
49
50
51
52
53
54
55
56
pipeline {
agent any
stages {
stage('Clean workspace') {
steps{
script {
sh "rm -rf *"
}
}
}
stage('Checkout'){
steps{
git branch: 'main' , url: 'https://github.com/Aar-if/Shikshak-dost.git'
}
}
stage('BuildingCode') {
steps{
dir('/var/lib/jenkins/workspace/teacherapp-shiksha'){
sh "rm -rf node_modules"
sh "rm -rf package-lock.json"
sh "ls"
//sh "yarn install"
sh "npm i --legacy-peer-deps"
sh "npm run build"
}
}
}
stage('Deployment') {
steps{
dir ('/var/lib/jenkins/workspace/teacherapp-shiksha/dist/') {
script {
def awsCliCmd = 'aws'
def bucketName = 'onestbucket'
sh "aws s3 cp /var/lib/jenkins/workspace/teacherapp-shiksha/dist/index.html s3://${bucketName}/"
sh "aws s3 cp /var/lib/jenkins/workspace/teacherapp-shiksha/dist/vite.svg s3://${bucketName}/"
sh "aws s3 cp /var/lib/jenkins/workspace/teacherapp-shiksha/dist/assets/ s3://${bucketName}/assets/ --recursive"
}
}
}
}
// New stage for executing ccs.sh script
stage('Execute invalidation Script') {
steps {
dir('/var/lib/jenkins/workspace'){
sh 'cd /var/lib/jenkins/workspace'
sh 'sh teacherapp.sh'
}
}
}
}
}