Merge "Make sure that contrail admin user is created during Upgrade on OC 4.X"
diff --git a/aptly-promote-pipeline.groovy b/aptly-promote-pipeline.groovy
index bf73bec..7c7f492 100644
--- a/aptly-promote-pipeline.groovy
+++ b/aptly-promote-pipeline.groovy
@@ -30,15 +30,19 @@
try {
stage("promote") {
// promote is restricted to users in aptly-promote-users LDAP group
- lock("aptly-api") {
- for (storage in storages) {
- if (storage == "local") {
- storage = ""
- }
- retry(2) {
- aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY, '-d --timeout 600', DUMP_PUBLISH.toBoolean(), storage)
- }
- }
+ if(jenkinsUtils.currentUserInGroups(["mcp-cicd-admins", "release-engineering", "opencontrail-all"])){
+ lock("aptly-api") {
+ for (storage in storages) {
+ if (storage == "local") {
+ storage = ""
+ }
+ retry(2) {
+ aptly.promotePublish(APTLY_URL, SOURCE, TARGET, RECREATE, components, packages, DIFF_ONLY, '-d --timeout 600', DUMP_PUBLISH.toBoolean(), storage)
+ }
+ }
+ }
+ }else{
+ throw new Exception(String.format("You don't have permissions to make aptly promote from source:%s to target:%s! Only CI/CD and QA team can perform aptly promote.", SOURCE, TARGET))
}
}
} catch (Throwable e) {
@@ -60,4 +64,3 @@
}
}
}
-
diff --git a/generate-repo-snapshot-context.groovy b/generate-repo-snapshot-context.groovy
index e51dbc4..c36aeae 100644
--- a/generate-repo-snapshot-context.groovy
+++ b/generate-repo-snapshot-context.groovy
@@ -69,6 +69,8 @@
}
}
+ // remove file if exists
+ sh "rm -rf ${fileName}"
writeYaml file: fileName, data: ['parameters': meta ]
archiveArtifacts artifacts: fileName
}
diff --git a/openstack-compute-install.groovy b/openstack-compute-install.groovy
index 2b37fba..581168a 100644
--- a/openstack-compute-install.groovy
+++ b/openstack-compute-install.groovy
@@ -57,6 +57,10 @@
salt.runSaltProcessStep(pepperEnv, targetLiveAll, 'pkg.upgrade', [], null, true)
}
+ stage("Update Hosts file") {
+ salt.enforceState(pepperEnv, "I@linux:system", 'linux.network.host', true)
+ }
+
stage("Setup networking") {
// Sync all of the modules from the salt master.
salt.syncAll(pepperEnv, targetLiveAll)
diff --git a/release-mcp-version.groovy b/release-mcp-version.groovy
index 665a170..bd19b02 100644
--- a/release-mcp-version.groovy
+++ b/release-mcp-version.groovy
@@ -88,6 +88,31 @@
]
}
+def triggerPkgPromoteJob(PkgRepoList, PromoteFrom, PromoteTo) {
+ def repos = PkgRepoList.trim().tokenize()
+ def RepoName, RepoDist, PackagesToPromote
+ for (repo in repos) {
+ if(repo.startsWith('#')){
+ common.warningMsg("Skipping repo ${repo}")
+ continue
+ }
+ if(repo.trim().indexOf(' ') == -1){
+ throw new IllegalArgumentException("Wrong format of repository and commit input")
+ }
+ repoArray = repo.trim().tokenize(' ')
+ RepoName = repoArray[0]
+ RepoDist = repoArray[1]
+ PackagesToPromote = repoArray[2]
+ build job: "pkg-promote", parameters: [
+ [$class: 'ChoiceParameterValue', name: 'repoName', value: RepoName],
+ [$class: 'ChoiceParameterValue', name: 'repoDist', value: RepoDist],
+ [$class: 'ChoiceParameterValue', name: 'promoteFrom', value: PromoteFrom],
+ [$class: 'ChoiceParameterValue', name: 'promoteTo', value: PromoteTo],
+ [$class: 'TextParameterValue', name: 'packagesToPromote', value: PackagesToPromote],
+ ]
+ }
+}
+
def triggerSyncVCPJob(VcpImageList, targetTag) {
// Operation must be synced with triggerPromoteVCPJob procedure!
def images = VcpImageList.trim().tokenize()
@@ -117,6 +142,11 @@
triggerAptlyPromoteJob(APTLY_URL, 'all', false, true, 'all', false, "(.*)/${SOURCE_REVISION}", APTLY_STORAGES, "{0}/${TARGET_REVISION}")
}
+ if (PKG_PROMOTE.toBoolean() && SOURCE_REVISION == 'testing') {
+ common.infoMsg("Promoting Extra and Ceph packages")
+ triggerPkgPromoteJob(PKG_REPO_LIST, SOURCE_REVISION, TARGET_REVISION)
+ }
+
if (RELEASE_DEB_MIRRORS.toBoolean()) {
common.infoMsg("Promoting Debmirrors")
triggerMirrorRepoJob(SOURCE_REVISION, TARGET_REVISION)
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 404c0d0..e537ee1 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -16,7 +16,6 @@
def slaveNode = env.SLAVE_NODE ?: 'python&&docker'
def saltVersion = env.SALT_VERSION ?: ""
def dockerLib = new com.mirantis.mk.Docker()
-def img = dockerLib.getImage(env.SMOKE_TEST_DOCKER_IMG, "ubuntu:16.04")
def checkouted = false
@@ -64,6 +63,7 @@
timeout(time: 4, unit: 'HOURS') {
node(slaveNode) {
+ def img = dockerLib.getImage(env.SMOKE_TEST_DOCKER_IMG, "ubuntu:16.04")
try {
if (fileExists("tests/build")) {
common.infoMsg('Cleaning test env')
diff --git a/test-salt-model-wrapper.groovy b/test-salt-model-wrapper.groovy
index f49b7fc..cb16cf3 100644
--- a/test-salt-model-wrapper.groovy
+++ b/test-salt-model-wrapper.groovy
@@ -167,7 +167,7 @@
}
def branches = [:]
- branches.failFast = true
+ branches.failFast = false
String branchJobName = ''
if (gerritProject == reclassSystemRepo && gerritBranch == 'master') {
diff --git a/upgrade-mcp-release.groovy b/upgrade-mcp-release.groovy
index 5bc0ab2..aa8b076 100644
--- a/upgrade-mcp-release.groovy
+++ b/upgrade-mcp-release.groovy
@@ -89,8 +89,12 @@
}
}
-if (common.validInputParam('PIPELINE_TIMEOUT') && env.PIPELINE_TIMEOUT.isInteger()) {
- pipelineTimeout = env.PIPELINE_TIMEOUT.toInteger()
+if (common.validInputParam('PIPELINE_TIMEOUT')) {
+ try {
+ pipelineTimeout = env.PIPELINE_TIMEOUT.toInteger()
+ } catch(Exception e) {
+ common.warningMsg("Provided PIPELINE_TIMEOUT parameter has invalid value: ${env.PIPELINE_TIMEOUT} - should be interger")
+ }
}
timeout(time: pipelineTimeout, unit: 'HOURS') {
@@ -139,10 +143,10 @@
// backward compatibility for 2018.11.0
saltMastURL = env.getProperty('SALT_MASTER_URL')
saltMastCreds = env.getProperty('SALT_MASTER_CREDENTIALS')
- upgradeSaltStack = env.getProperty('UPGRADE_SALTSTACK', false).toBoolean()
- updateClusterModel = env.getProperty('UPDATE_CLUSTER_MODEL', false).toBoolean()
- updatePipelines = env.getProperty('UPDATE_PIPELINES', false).toBoolean()
- updateLocalRepos = env.getProperty('UPDATE_LOCAL_REPOS', false).toBoolean()
+ upgradeSaltStack = env.getProperty('UPGRADE_SALTSTACK').toBoolean()
+ updateClusterModel = env.getProperty('UPDATE_CLUSTER_MODEL').toBoolean()
+ updatePipelines = env.getProperty('UPDATE_PIPELINES').toBoolean()
+ updateLocalRepos = env.getProperty('UPDATE_LOCAL_REPOS').toBoolean()
reclassSystemBranch = gitTargetMcpVersion
}