forked from VirtoCommerce/jenkins-pipeline-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoVC3
45 lines (41 loc) · 1.87 KB
/
DemoVC3
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
import jobs.scripts.*
node {
def SETTINGS
stage('Init'){
deleteDir()
checkout scm
def settingsFileContent
configFileProvider([configFile(fileId: 'shared_lib_settings', variable: 'SETTINGS_FILE')]) {
settingsFileContent = readFile(SETTINGS_FILE)
}
SETTINGS = new Settings(settingsFileContent)
SETTINGS.setRegion('demo3')
}
psfolder = "${env.WORKSPACE}\\resources\\demoVC3"
dir(psfolder){
stage('Platform Update'){
timestamps {
SETTINGS.setEnvironment('platform')
def ghRelease = GithubRelease.getLatestGithubRelease(this, Utilities.getOrgName(this), 'vc-platform', '3.0.0', true)
def fileName = ghRelease.assets[0].name
def filePath = "${env.WORKSPACE}@tmp\\${fileName}"
GithubRelease.downloadGithubRelease(this, ghRelease.assets[0].url, filePath)
powershell "${psfolder}\\PlatformUpdate.ps1 -SubscriptionID ${SETTINGS['subscriptionID']} -ResourceGroupName ${SETTINGS['resourceGroupName']} -WebAppName ${SETTINGS['appName']} -Path2Zip ${filePath} -ErrorAction Stop"
}
}
stage('Storefront Update'){
timestamps {
SETTINGS.setEnvironment('storefront')
withEnv(["AzureSubscriptionIDProd=${SETTINGS['subscriptionID']}", "AzureResourceGroupNameProd=${SETTINGS['resourceGroupName']}", "AzureWebAppNameProd=${SETTINGS['appName']}"]){
powershell "${psfolder}\\StorefrontUpdate.ps1 -ErrorAction Stop"
}
}
}
stage('Recreate DB'){
timestamps{
SETTINGS.setEnvironment('platform')
powershell "${psfolder}\\RecreateDB.ps1 -SubscriptionID ${SETTINGS['subscriptionID']} -ResourceGroupName ${SETTINGS['resourceGroupName']} -ErrorAction Stop"
}
}
}
}