.gitlab-ci.yml 631 Bytes
Newer Older
Torsten Grote's avatar
Torsten Grote committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
image: docker:git

services:
- docker:dind

stages:
- build
- test
- release

variables:
  TEST_IMAGE: briar/tor-reproducer:${CI_BUILD_REF_NAME}
  RELEASE_IMAGE: briar/tor-reproducer:latest

before_script:
  - echo ${DOCKER_HUB_PASS} | docker login -u ${DOCKER_HUB_USER} --password-stdin

build:
  stage: build
  script:
    - docker build -t ${TEST_IMAGE} .
    - docker push $TEST_IMAGE

test:
  stage: test
  script:
    - docker run ${TEST_IMAGE} ./build-tor.py

release:
  stage: release
  script:
    - docker pull $TEST_IMAGE
    - docker tag $TEST_IMAGE $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
  only:
    - master