Skip to content

Commit

Permalink
Mount artifact-metadata dir to /workspace
Browse files Browse the repository at this point in the history
Sometimes artifact-metadata dir is located under long
enouth path, and being mounted 'as is' it leads to tox
failure. This is because pip (?) replaces shebang string in
'metadata-app' when installs it into virtualenv, and if the
string is long enough we've got failure.

There is github issue related:
  pypa/virtualenv#596

This commit mounts any external path to internal '/workspace'
dir and fixes the issue.

Related-Prod: PRODX-2782
Change-Id: Ie3405086a94a9f7315ce0ba935d1dd68a85d0325
  • Loading branch information
teselkin committed Feb 13, 2020
1 parent a1004b5 commit 187d3a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/com/mirantis/mk/ReleaseWorkflow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def getReleaseMetadataValue(String key, Map params = [:]) {

checkoutReleaseMetadataRepo(params)

docker.image(toxDockerImage).inside {
result = sh(script: "cd ${repoDir} && tox -qq -e metadata -- ${opts} get --key ${key}", returnStdout: true).trim()
docker.image(toxDockerImage).inside("--volume ${repoDir}:/workspace") {
result = sh(script: "cd /workspace && tox -qq -e metadata -- ${opts} get --key ${key}", returnStdout: true).trim()
}
common.infoMsg("""
Release metadata key ${key} has value:
Expand Down Expand Up @@ -163,9 +163,9 @@ def updateReleaseMetadata(String key, String value, Map params, Integer dirdepth
def keyArr = key.split(';')
def valueArr = value.split(';')
if (keyArr.size() == valueArr.size()) {
docker.image(toxDockerImage).inside {
docker.image(toxDockerImage).inside("--volume ${repoDir}:/workspace") {
for (i in 0..keyArr.size()-1) {
sh "cd ${repoDir} && tox -qq -e metadata -- update --key '${keyArr[i]}' --value '${valueArr[i]}'"
sh "cd /workspace && tox -qq -e metadata -- update --key '${keyArr[i]}' --value '${valueArr[i]}'"
}
}
}
Expand Down

0 comments on commit 187d3a1

Please sign in to comment.