stages:
  - update
  - build
  - start
  - jekyll_debug
  - stop
  - uninstall
  - remove

update:
  stage: update
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /update|^$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/update

build:
  stage: build
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /build/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/build

start:
  stage: start
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /start/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/start

jekyll_debug:
  stage: jekyll_debug
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /jekyll_debug/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/jekyll_debug

stop:
  stage: stop
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /^stop$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/stop

uninstall:
  stage: uninstall
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /^uninstall$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/uninstall

remove:
  stage: remove
  tags:
    - strategy-investor.de
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /^remove$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/remove
