Skip to content
Snippets Groups Projects
Commit f7b46ea3 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'L2SS-2214-deploy-cdb' into L2SS-2309-trigger-deployment

parents cfe995cd e38d9acc
No related branches found
No related tags found
1 merge request!1092Resolve L2SS-2309 "Trigger deployment"
Pipeline #116726 passed
Pipeline: tango

#116732

    Pipeline: tango

    #116727

      ......@@ -7,8 +7,6 @@ stages:
      deploy_nomad:
      stage: deploy
      rules:
      - if: $STATION != ""
      needs:
      - pipeline: $PARENT_PIPELINE_ID
      job: render_levant
      ......@@ -31,3 +29,30 @@ deploy_nomad:
      echo "Running station ${STATION} component ${COMPONENT}"
      nomad job run -address="http://${HOSTNAME}:4646" jobs/${STATION}/${COMPONENT}.nomad
      done
      deploy_CDB:
      stage: deploy
      needs:
      - pipeline: $PARENT_PIPELINE_ID
      job: render_CDB
      image:
      name: hashicorp/nomad
      entrypoint: [ "" ]
      script:
      - |
      RENDER_CDB_JOB_ID=`cat generated/render-cdb-job-id.txt`
      echo "render-cdb job ID: ${RENDER_CDB_JOB_ID}"
      CDB_JSON_URL="${CI_PROJECT_URL}/-/jobs/${RENDER_CDB_JOB_ID}/artifacts/raw/generated/CDB/deploy/${STATION}.json?inline=false"
      echo "Artifact URL: ${CDB_JSON_URL}"
      if [ "${STATION}" == "dts-lab" ]; then
      # dts-lab test station
      HOSTNAME="dts-lab.lofar.net"
      else
      # core/remote station
      HOSTNAME="${STATION}c.control.lofar"
      fi
      nomad job dispatch -address="http://${HOSTNAME}:4646" dsconfig -meta cdb_json_url="${CDB_JSON_URL}"
      ......@@ -160,6 +160,8 @@ render_CDB:
      mkdir -p generated/CDB/deploy
      echo "${CI_JOB_ID}" > ${CI_PROJECT_DIR}/generated/render-cdb-job-id.txt
      cd CDB/
      for STATION in ${LOFAR2_STATIONS}; do
      ......@@ -182,7 +184,7 @@ render_CDB:
      expose_as: 'deployment cdb configs'
      name: deploy-cdb
      paths:
      - generated/CDB/deploy/
      - generated/
      # Collect services from this repo, to deploy as Nomad jobs on a station
      render_levant:
      ......
      ......@@ -15,6 +15,20 @@ job "dsconfig" {
      mode = "bridge"
      }
      task "wait-for-db" {
      lifecycle {
      hook = "prestart"
      sidecar = false
      }
      driver = "docker"
      config {
      image = "[[ $.registry.astron.url ]]/busybox:latest"
      command = "sh"
      args = ["-c", "while ! nc -z tango.service.consul 10000; do sleep 1; done"]
      }
      }
      task "dsconfig" {
      driver = "docker"
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Please register or to comment