Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.14 KiB
Newer Older
Torsten Grote's avatar
Torsten Grote committed
image: docker:git

services:
- docker:dind

stages:
- build
- test
- release

variables:
  TEST_IMAGE: briar/go-reproducer:${CI_COMMIT_REF_NAME}
Torsten Grote's avatar
Torsten Grote committed
  RELEASE_IMAGE: briar/go-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

Torsten Grote's avatar
Torsten Grote committed
  stage: test
  script:
    - docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./build-binary.py lyrebird && ./verify-binary.py lyrebird"
akwizgran's avatar
akwizgran committed
  allow_failure: true
  artifacts:
    paths:
Torsten Grote's avatar
Torsten Grote committed
  except:
    - tags

    - docker run -v `pwd`/output:/opt/go-reproducer/output ${TEST_IMAGE} /bin/bash -c "./verify-binary.py lyrebird ${CI_COMMIT_REF_NAME}"
Torsten Grote's avatar
Torsten Grote committed
release:
  stage: release
  script:
    - docker pull $TEST_IMAGE
    - docker tag $TEST_IMAGE $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
  when: on_success
Torsten Grote's avatar
Torsten Grote committed
  only:
    - master