stages:
  - build
  - restart

build-faircoind:
  stage: build
  tags:
    - FairCoin.Co
  only:
    refs:
      - master
    variables:
      - $CMD =~ /build/
  before_script:
    - mkdir -p ~/.faircoin2
    - chown -R gitlab-runner:gitlab-runner ~/.faircoin2
  script:
    - docker-compose build

restart-faircoind:
  stage: restart
  tags:
    - FairCoin.Co
  only:
    refs:
      - master
    variables:
      - $CMD =~ /build|restart/
  script:
    - docker-compose down
    - docker-compose up
