stages:
  - deploy

deploy-lcr:
  tags:
    - docker
  stage: deploy
  image: registry.esss.lu.se/ics-docker/tower-cli
  script:
    - >
      tower-cli job launch
      -h torn.tn.esss.lu.se
      -t ${TOWER_OAUTH_TOKEN}
      -J "deploy-cs-studio@lcr"
      --tags csstudio-ess-opis
      -e "csstudio_ess_opis_version=$CI_COMMIT_REF_NAME" --monitor
  only:
    - master@ics-software/ess-opis

deploy-nx:
  tags:
    - docker
  stage: deploy
  image: registry.esss.lu.se/ics-docker/tower-cli
  script:
    - >
      tower-cli job launch
      -h torn.tn.esss.lu.se
      -t ${TOWER_OAUTH_TOKEN}
      -J "deploy-nxbastion-terminalsrv"
      --tags csstudio-ess-opis
      -e "csstudio_ess_opis_version=$CI_COMMIT_REF_NAME" --monitor
  only:
    - master@ics-software/ess-opis

deploy-hmivms:
  tags:
    - docker
  stage: deploy
  image: registry.esss.lu.se/ics-docker/tower-cli
  script:
    - >
      tower-cli job launch
      -h torn.tn.esss.lu.se
      -t ${TOWER_OAUTH_TOKEN}
      -J "deploy-csstudio-hmivms"
      --tags csstudio-ess-opis --monitor
  only:
    - master@ics-software/ess-opis
