[docker] Add MCP_DOCKER_TAG env var 25/62025/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 10 Sep 2018 01:26:46 +0000 (03:26 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 10 Sep 2018 02:00:06 +0000 (04:00 +0200)
Allow skipping docker pull for verify jobs by setting the new env
var to 'verify'.

JIRA: FUEL-383

Change-Id: If8e2f66b5ccdac5c3911eeabfc2ba9c0eba61093
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
.gitreview
ci/deploy.sh
mcp/scripts/docker-compose/docker-compose.yaml.j2
mcp/scripts/lib.sh

index 49ca261..8687965 100644 (file)
@@ -2,4 +2,4 @@
 host=gerrit.opnfv.org
 port=29418
 project=fuel.git
-
+defaultbranch=master
index f64b3b8..4a85412 100755 (executable)
@@ -137,6 +137,7 @@ USE_EXISTING_INFRA=${USE_EXISTING_INFRA:-0}
 NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0}
 ERASE_ENV=${ERASE_ENV:-0}
 MCP_VCP=${MCP_VCP:-1}
+MCP_DOCKER_TAG=${MCP_DOCKER_TAG:-latest}
 
 source "${DEPLOY_DIR}/globals.sh"
 source "${DEPLOY_DIR}/lib.sh"
@@ -264,7 +265,7 @@ export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
 
 MCP_DPDK_MODE=$([[ "$DEPLOY_SCENARIO" =~ ovs ]] && echo 1 || echo 0)
 # Expand jinja2 templates based on PDF data and env vars
-export MCP_REPO_ROOT_PATH MCP_VCP MCP_DPDK_MODE MCP_STORAGE_DIR \
+export MCP_REPO_ROOT_PATH MCP_VCP MCP_DPDK_MODE MCP_STORAGE_DIR MCP_DOCKER_TAG \
        MCP_JUMP_ARCH=$(uname -i)
 do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
                       "${BASE_CONFIG_URI}" "${SCENARIO_DIR}"
index 7099e4f..ed0400d 100644 (file)
@@ -13,7 +13,7 @@ version: '2'
 services:
   opnfv-fuel-salt-master:
     container_name: "fuel"
-    image: "opnfv/fuel:saltmaster-reclass-latest"
+    image: "opnfv/fuel:saltmaster-reclass-{{ conf.MCP_DOCKER_TAG }}"
     networks:
       - mcpcontrol
       - pxebr
index cc88f9b..6572074 100644 (file)
@@ -493,6 +493,9 @@ function prepare_containers {
   docker-compose --version > /dev/null 2>&1 || COMPOSE_PREFIX="${image_dir}/"
 
   "${COMPOSE_PREFIX}docker-compose" -f docker-compose/docker-compose.yaml down
+  if [ ! "${MCP_DOCKER_TAG}" = 'verify' ]; then
+    "${COMPOSE_PREFIX}docker-compose" -f docker-compose/docker-compose.yaml pull
+  fi
   sudo rm -rf "${image_dir}/"{salt,hosts,pki} "${image_dir}/nodes/"*
   mkdir -p "${image_dir}/salt/"{master.d,minion.d}
   touch "${image_dir}/hosts"
@@ -502,7 +505,6 @@ function start_containers {
   local image_dir=$1
   [ -n "${image_dir}" ] || exit 1
   docker-compose --version > /dev/null 2>&1 || COMPOSE_PREFIX="${image_dir}/"
-  "${COMPOSE_PREFIX}docker-compose" -f docker-compose/docker-compose.yaml pull
   "${COMPOSE_PREFIX}docker-compose" -f docker-compose/docker-compose.yaml up -d
 }