.gitlab-ci.yml 1.12 KB
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
test_build:
Torsten Grote's avatar
Torsten Grote committed
25 26
  stage: test
  script:
27
    - docker run -v `pwd`:/opt/tor-reproducer ${TEST_IMAGE} /bin/bash -c "./build-tor.py && ./verify-tor.py"
28 29 30 31 32 33
  artifacts:
    paths:
    - tor-*.zip
    - tor-*.pom
    - tor-*-sources.jar
    expire_in: 1 week
34
    when: always
35
  allow_failure: true
36 37 38
  except:
    - tags

39
test_tag:
40 41
  stage: test
  script:
42
    - docker run -v `pwd`:/opt/tor-reproducer ${TEST_IMAGE} ./verify-tor.py ${CI_BUILD_REF_NAME}
43 44 45 46 47 48
  artifacts:
    paths:
    - tor-*.zip
    - tor-*.pom
    - tor-*-sources.jar
    expire_in: 1 week
49
    when: always
50 51
  only:
    - tags
Torsten Grote's avatar
Torsten Grote committed
52 53 54 55 56 57 58

release:
  stage: release
  script:
    - docker pull $TEST_IMAGE
    - docker tag $TEST_IMAGE $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
59
  when: on_success
Torsten Grote's avatar
Torsten Grote committed
60 61
  only:
    - master