Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1020 B
Newer Older
L4168's avatar
L4168 committed
stages:
  - purge
  - build
L4168's avatar
L4168 committed
  - rf-test
  - push-results
L4168's avatar
L4168 committed

docker-push:
  image: docker
  services:
    - docker:dind
  stage: purge
L4168's avatar
L4168 committed
  tags: ['docker']
  only:
    - testing
L4168's avatar
L4168 committed
    - docker stop front
    - docker rm front
L4168's avatar
L4168 committed
  allow_failure: true

docker-build:
  image: docker
  services:
    - docker:dind
  stage: build
  tags: ['docker']
  only:
    - testing
L4168's avatar
L4168 committed
  script:
    - printf "REACT_APP_URL=%s\n" "$REACT_APP_URL" > .env
L4168's avatar
L4168 committed
    - docker build -t overflow2019/frontend:test .
Ronnie Friman's avatar
Ronnie Friman committed
    - docker run --name front -p 8080:80 -d overflow2019/frontend:test
L4168's avatar
L4168 committed

rf-test:
  image: gitlab.labranet.jamk.fi:4567/wimma-lab-2019/mysticons/devsecops/robot
  stage: rf-test
  tags: ['docker']
  only:
    - testing
  script:
    - export ROBOT_TESTS=./tests
    - export OUTPUT_DIR=./results
    - run.sh
  artifacts:
    when: always
    untracked: true
    expire_in: 24h

push-results:
  stage: push-results
  tags: ['shell']
  only:
    - testing
  when: always
  script:
    - docker cp ./results front:/usr/share/nginx/html