-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
98 lines (91 loc) · 2.87 KB
/
Jenkinsfile
File metadata and controls
98 lines (91 loc) · 2.87 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
pipeline {
agent { label 'slave-ec2-fleet' }
tools {nodejs "nodejs"}
environment {
finalArtifactName = "$GIT_BRANCH.$GIT_COMMIT.$BUILD_ID" + ".zip"
s3Prefix = "$GIT_BRANCH" + "/"
s3Bucket = "muf-modular-cfr-bucket"
awsCredId = "Mufazzal"
}
stages {
stage('Versioning') {
steps {
sh 'printenv'
}
}
stage('Installing') {
steps {
echo 'Installation in progress..'
sh 'npm install'
echo 'Installation Finished'
}
}
stage('Lint') {
steps {
echo 'Linting in progress..'
sh 'npm run lint'
echo 'Linting Finished'
}
}
stage('Build') {
steps {
echo 'Building in progress..'
sh 'npm run preBuild'
sh 'npm run build'
echo 'Building Finished'
}
}
stage('Post Build') {
steps {
echo 'Post Building in progress..'
sh 'npm run postBuild'
echo 'Post Building Finished'
}
}
stage('Test') {
steps {
echo 'Testing in progress..'
sh 'npm run test'
echo 'Testing Finished'
}
}
stage('Archiving') {
steps {
echo 'Archiving in progress..'
sh """
cd outputs
zip -r -qq ${finalArtifactName} dist/*
cd ..
"""
echo 'Archiving Finished'
}
}
stage('Upload') {
steps {
withAWS(region:'us-east-1',credentials: "$awsCredId") {
echo "Uploading artifact: outputs/" + "$finalArtifactName"
s3Upload(bucket: "$s3Bucket",
path: "$s3Prefix",
file:"outputs/" + "$finalArtifactName");
}
withAWS(region:'us-east-1',credentials: "$awsCredId") {
echo "Uploading latest artifact: outputs/" + "$finalArtifactName"
s3Upload(bucket: "$s3Bucket",
path: "$s3Prefix"+"latest.zip",
file:"outputs/" + "$finalArtifactName");
}
}
post {
success {
echo "Uploading location of artifact :-"
echo "https://"+"$s3Bucket"+".s3.amazonaws.com/"+"$s3Prefix"+"$finalArtifactName"
}
}
}
stage('Deploy') {
steps {
echo 'Deploying Hello....'
}
}
}
}