diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15263eb7d76f9153f2cf0a286e295cd6fe36ba30..166530b609089c4368ff35949e24d081264e968a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -683,7 +683,7 @@ stages: - cd deploy || exit 1 - echo "[all]" > hosts - echo "stat ansible_host=$DEPLOY_HOST ansible_user=$DEPLOY_USER" >> hosts - - ansible-playbook deploy.yml --extra-vars station_version=$CI_COMMIT_TAG + - ansible-playbook deploy.yml --extra-vars station_version=$CI_COMMIT_TAG --extra-vars station_config=CS001_ConfigDb.json .deploy_l2ts_base: extends: .base_deploy variables: diff --git a/deploy/deploy.yml b/deploy/deploy.yml index e89ae6cf657f1a2f257891cdf17ba5f551803077..e0c5ce6936a98e0995cc38a352caaf7848fa1660 100644 --- a/deploy/deploy.yml +++ b/deploy/deploy.yml @@ -2,6 +2,11 @@ - name: StationControl Early Deployment hosts: all tasks: + - name: Register make installation status + command: which make + changed_when: false + failed_when: make_installed.rc not in [0,1] + register: make_installed - name: Register git installation status command: which git changed_when: false @@ -28,6 +33,10 @@ args: chdir: ~/tango register: pending_changes + - name: Check make installation status + fail: + msg: "Make does not appear to be installed!" + when: make_installed.rc not in [0] - name: Check git installation status fail: msg: "Git does not appear to be installed!" @@ -39,9 +48,48 @@ - name: Check pending changes fail: msg: "Deployment repository seems to have pending changes!" - when: pending_changes not in [0] - - name: Update sources + when: pending_changes.rc not in [0] + - name: Stop Current Station + changed_when: false + shell: "make stop" + args: + chdir: ~/tango/docker-compose + - name: Update Sources + changed_when: false + shell: "git checkout {{ station_version }}" + args: + chdir: ~/tango + - name: Pull Images + changed_when: false + shell: "make pull" + args: + chdir: ~/tango/docker-compose + - name: Build Images + changed_when: false + shell: "make build" + args: + chdir: ~/tango/docker-compose + - name: Start Database + changed_when: false + shell: "make minimal" + args: + chdir: ~/tango/docker-compose + - name: Wait for databaseds + ansible.builtin.wait_for: + port: 10000 + delay: 10 + - name: Update Base Database Config + changed_when: false + shell: "./sbin/load_ConfigDb.sh CDB/LOFAR_ConfigDb.json" + args: + chdir: ~/tango/ + - name: Update Station Database Config + changed_when: false + shell: "./sbin/load_ConfigDb.sh CDB/stations/{{ station_config }}" + args: + chdir: ~/tango/ + - name: Start Station changed_when: false - shell: "git checkout v{{ station_version }}" + shell: "make start" args: - chdir: ~/tango \ No newline at end of file + chdir: ~/tango/docker-compose diff --git a/docker-compose/Makefile b/docker-compose/Makefile index 5cdb54531b472901dbda22902937e62a0ab2902b..0ca1c240ba67498ebcef67c9c0516dc9d9e2b32d 100644 --- a/docker-compose/Makefile +++ b/docker-compose/Makefile @@ -149,6 +149,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) \ CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \ COMPOSE_IGNORE_ORPHANS=true \ + COMPOSE_HTTP_TIMEOUT=180 \ CONTAINER_EXECUTION_UID=$(shell id -u) \ DOCKER_GID=$(DOCKER_GID) \ TEST_MODULE=$(INTEGRATION_MODULE)