stages:
  - build
  - test
  - deploy

before_script:
  - docker info

build_test:
  stage: build
  script:
    - docker build -f ./BHCDatabase/Dockerfile-test -t my-docker-test-image ./BHCDatabase/

test:
  stage: test
  script:
    - ls
    - docker run my-docker-test-image ./bin/rails t

build_deploy:
  stage: deploy
  script:
    - docker-compose -f ./BHCDatabase/docker-compose.yml stop
    - docker-compose -f ./BHCDatabase/docker-compose.yml build --no-cache app web
    - docker-compose -f ./BHCDatabase/docker-compose.yml build db
  only:
    - master
    
deploy:
  stage: deploy
  script:
    - docker-compose -f ./BHCDatabase/docker-compose.yml run app rails db:migrate
    - docker-compose -f ./BHCDatabase/docker-compose.yml up -d
  only:
    - master
stages:
  - build
  - test
  - deploy

before_script:
  - docker info

build_test:
  stage: build
  script:
    - docker build -f ./BHCDatabase/Dockerfile-test -t my-docker-test-image ./BHCDatabase/

test:
  stage: test
  script:
    - ls
    - docker run my-docker-test-image ./bin/rails t

build_deploy:
  stage: deploy
  script:
    - docker-compose -f ./BHCDatabase/docker-compose.yml stop
    - docker-compose -f ./BHCDatabase/docker-compose.yml build
  only:
    - master

deploy:
  stage: deploy
  script:
    - docker-compose -f ./BHCDatabase/docker-compose.yml run app rails db:migrate
    - docker-compose -f ./BHCDatabase/docker-compose.yml run app rails assets:precompile
    - docker-compose -f ./BHCDatabase/docker-compose.yml up -d
  only:
    - master

Update gitlab file to reflect new changes to flow of build
Update gitlab file to reflect new changes to flow of build
