Skip to content
Snippets Groups Projects
Commit 2c20aada authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

feat: Automate ood knightly build and deploy in a single pipeline

* Detach the floating ips to assign to new instance

* Detach internal port to assign it to new instance

* Install NetworkManager required during deploy

  NetworkManager is restarted during cloud-init final module but it
  failsbecause the package was not available. So install it during build
  to make it available during deploy
parent 6ad59da4
No related branches found
No related tags found
1 merge request!197Automate ood knightly build and deploy in a single pipeline
......@@ -210,7 +210,7 @@ build_ood_image:
reports:
dotenv: image.env
rules:
- if: $PIPELINE_TARGET == "build" && $BUILD_TARGET == "ood"
- if: $BUILD_TARGET == "ood"
when: always
deploy_http_proxy_node:
......@@ -379,7 +379,24 @@ deploy_ood_node:
name: $ENV
tags:
- build
before_script:
- |
for OOD_FLOATING_IP in ${OOD_FLOATING_IP_LIST[@]}; do
OOD_FIXED_IP=$(
openstack floating ip list \
--floating-ip-address $OOD_FLOATING_IP -c "Fixed IP Address" -f value)
CURRENT_INSTANCE_ID=$(
openstack server list \
--name $OOD_INSTANCE_NAME --ip $OOD_FIXED_IP -c ID -f value)
openstack server remove floating ip $CURRENT_INSTANCE_ID $OOD_FLOATING_IP
done
- |
if [ -n "$OOD_PORT" ];then
openstack server remove port $CURRENT_INSTANCE_ID $OOD_PORT
fi
script:
- OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}"
- openstack image set --accept $OOD_IMAGE_ID || true
- FAILED=false
- |
......@@ -424,5 +441,5 @@ deploy_ood_node:
openstack server add floating ip $OOD_INSTANCE_ID $OOD_FLOATING_IP
done
rules:
- if: $PIPELINE_TARGET == "deploy" && $OOD_IMAGE_ID
- if: $DEPLOY_TARGET == "ood"
when: always
......@@ -60,7 +60,7 @@ build {
provisioner "shell" {
inline = [
"sudo yum install -y libselinux-python3 python3 python3-pip tmux vim git bash-completion curl wget unzip",
"sudo yum install -y libselinux-python3 python3 python3-pip tmux vim git bash-completion curl wget unzip NetworkManager",
"sudo python3 -m pip install --upgrade pip",
"sudo pip3 install s3cmd==2.3.0 ansible==4.10.0 python-openstackclient==5.8.0"
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment