Update paths for calico/ctl and calico/node images as
their code splitted into 2 independent projects in
upstream. Therefore they are stored in the separate
directories of a pipeline's workspace while building
containers.
This is the part of the adaptation to changes
made in upstream repos (PROD-12401).
Change-Id: I445360168134eae40b934526db69816a025ff4bc
diff --git a/src/com/mirantis/mcp/Calico.groovy b/src/com/mirantis/mcp/Calico.groovy
index 2d14741..6259acd 100644
--- a/src/com/mirantis/mcp/Calico.groovy
+++ b/src/com/mirantis/mcp/Calico.groovy
@@ -484,16 +484,20 @@
try {
// create fake targets to avoid execution of unneeded operations
sh """
- mkdir -p vendor
+ mkdir -p calicoctl_home/vendor
+ mkdir -p calico_home/vendor
"""
// pull calico/ctl image and extract calicoctl binary from it
sh """
+ cd calicoctl_home
mkdir -p dist
docker run --rm -u \$(id -u):\$(id -g) --entrypoint /bin/cp -v \$(pwd)/dist:/dist ${ctlImage} /calicoctl /dist/calicoctl
touch dist/calicoctl dist/calicoctl-linux-amd64
"""
// pull calico/node image and extract required binaries
sh """
+ cd calico_home
+ mkdir -p dist
mkdir -p calico_node/filesystem/bin
for calico_binary in startup allocate-ipip-addr calico-felix bird calico-bgp-daemon confd libnetwork-plugin; do
docker run --rm -u \$(id -u):\$(id -g) --entrypoint /bin/cp -v \$(pwd)/calico_node/filesystem/bin:/calicobin ${nodeImage} /bin/\${calico_binary} /calicobin/
@@ -503,7 +507,11 @@
touch calico_node/filesystem/bin/*
touch calico_node/.calico_node.created
"""
- sh "NODE_CONTAINER_NAME=${nodeImage} make st"
+ // execute systests against calico/node
+ sh """
+ cd calico_home
+ NODE_CONTAINER_NAME=${nodeImage} make st
+ """
} catch (Exception e) {
sh "make stop-etcd"
// FIXME: cleaning has to be done by make stop/clean targets
@@ -591,12 +599,12 @@
def birdclUrl = config.get('birdclUrl', "${artifactoryURL}/${projectNamespace}/bird/birdcl-${birdBuildId}")
// add LABELs to dockerfiles
- docker.setDockerfileLabels("./calicoctl/Dockerfile.calicoctl",
+ docker.setDockerfileLabels("./calicoctl_home/calicoctl/Dockerfile.calicoctl",
["docker.imgTag=${imgTag}",
"calico.buildImage=${buildImage}",
"calico.birdclUrl=${birdclUrl}"])
- docker.setDockerfileLabels("./calico_node/Dockerfile",
+ docker.setDockerfileLabels("./calico_home/calico_node/Dockerfile",
["docker.imgTag=${imgTag}",
"calico.buildImage=${buildImage}",
"calico.felixImage=${felixImage}",
@@ -608,6 +616,7 @@
// Start build section
stage ('Build calico/ctl image'){
sh """
+ cd calicoctl_home
make calico/ctl \
CTL_CONTAINER_NAME=${ctlName} \
PYTHON_BUILD_CONTAINER_NAME=${buildImage} \
@@ -618,6 +627,7 @@
stage('Build calico/node'){
sh """
+ cd calico_home
make calico/node \
NODE_CONTAINER_NAME=${nodeName} \
PYTHON_BUILD_CONTAINER_NAME=${buildImage} \