.gitlab-ci.yml 868 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
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

24 25
# TODO unify with test_verify once latest release was uploaded to jcenter
test_build:
Torsten Grote's avatar
Torsten Grote committed
26 27 28
  stage: test
  script:
    - docker run ${TEST_IMAGE} ./build-tor.py
29 30 31 32 33 34 35 36 37
  except:
    - tags

test_verify:
  stage: test
  script:
    - docker run ${TEST_IMAGE} ./verify-tor.py ${CI_BUILD_REF_NAME}
  only:
    - tags
Torsten Grote's avatar
Torsten Grote committed
38 39 40 41 42 43 44 45 46

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