-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
55 lines (53 loc) · 1.83 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
pipeline {
agent any
parameters {
string(name: 'TAG', description: 'Tag to checkout and version to publish')
}
stages {
stage("CLONE") {
steps {
echo "======== executing CLONE ==========="
checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/${params.TAG}"]],userRemoteConfigs: [[url: "https://github.com/kamcknig/pick-up-stix", name: 'origin', credentialsId: 'git-kamcknig']]], poll: false, changelog: true
}
post {
success {
echo "=========== Clone executed successfully ========"
}
failure {
echo "========== Clone failed ==========="
}
}
}
stage("BUILD") {
steps {
echo "======== executing BUILD ========"
sh 'npm ci'
sh 'npm run build'
sh 'npm run package'
}
post{
success {
echo "======== A executed successfully ========"
}
failure {
echo "======== A execution failed ========"
}
}
}
stage("UPLOAD") {
steps {
withAWS(credentials: "jenkins-s3-publisher") {
s3Upload(bucket:"turkeysunite-foundry-modules", path:"pick-up-stix/releases/", includePathPattern:"package/pick-up-stix-v${params.TAG}*.zip", workingDir:"package", acl: "PublicRead")
}
}
post {
success {
echo "======== Publish to S3 Success ========"
}
failure {
echo "======== Failed to upload to S3 =========="
}
}
}
}
}