This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
81 lines (69 loc) · 1.87 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
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
pipeline {
agent any
tools {
nodejs 'nodejs'
}
environment {
AZURE_STORAGE_ACCOUNT_NAME = getSAName()
REACT_APP_ENV = getEnvironment()
REACT_APP_BFF_URL = getBffUrl()
}
stages {
stage("Build Statics") {
when {
anyOf {
branch 'develop'
branch 'master'
}
}
steps {
sh "yarn install"
sh "yarn build"
}
}
stage("Publish Statics - Azure Blob") {
when {
anyOf {
branch 'develop'
branch 'master'
}
}
steps {
dir("build") {
azureUpload blobProperties: [cacheControl: '', contentEncoding: '', contentLanguage: '', contentType: '', detectContentType: true], cleanUpContainerOrShare: true, containerName: '$web', filesPath: '**/', storageCredentialId: "${env.AZURE_STORAGE_ACCOUNT_NAME}", storageType: 'blobstorage'
}
}
}
}
post {
success {
office365ConnectorSend color: 'GREEN', status: 'success', webhookUrl: "${env.TEAMS_CHANNEL_URL}"
}
failure {
office365ConnectorSend color: 'RED', status: 'failed', webhookUrl: "${env.TEAMS_CHANNEL_URL}"
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
disableConcurrentBuilds()
timeout(time: 25, unit: 'MINUTES')
}
}
def getSAName() {
if (env.BRANCH_NAME == 'develop') {
return "siscobfrontendhml"
}
return "siscobfrontendprod"
}
def getEnvironment() {
if (env.BRANCH_NAME == 'develop') {
return "homolog"
}
return "production"
}
def getBffUrl() {
if (env.BRANCH_NAME == 'develop') {
return "bff-siscob-hml.integracao.brmalls.com.br"
}
return "bff-siscob-prd.integracao.brmalls.com.br"
}