--- stages: - test - e2e - publish variables: DOCKER_DRIVER: overlay # Cache gems in between stages for this pipeline only cache: key: "$CI_RUNNER_TAGS-$CI_COMMIT_REF_SLUG" paths: - .tox/py27-dev linux_test: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: test script: # In this first job, recreate the tox venv from scratch # on start of every pipeline - dpkg -l tox > /dev/null || apt-get -y --no-install-recommends install tox - tox --recreate -e py27-dev tags: - linux osx_test: stage: test allow_failure: true script: - ls -la /usr/bin/gpg - /usr/local/bin/tox --recreate -e py27-dev tags: - yosemite - osx # disabling latest builds for now. should enable them when I can test # the new docker builder w/o virtualenvs. # bitmask_latest_bundle: # image: 0xacab.org:4567/leap/docker/bitmask-bundler:latest # stage: publish # script: # - pkg/build_bundle_with_venv.sh # - mv "dist/bitmask-`cat pkg/next-version`" . # artifacts: # paths: # - "bitmask-`cat pkg/next-version`" # name: "Bitmask_linux64_latest_${CI_BUILD_REF}" # expire_in: 1 month # tags: # - linux e2e_test_mail: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: e2e script: - dpkg -l tox gnupg1 haveged > /dev/null || apt-get -y --no-install-recommends install tox gnupg1 haveged - tox -e py27-dev --notest - source .tox/py27-dev/bin/activate - make dev-latest-backend - mkdir -p /root/.config/leap/ - make install_helpers - make test_e2e_mail tags: - linux e2e_test_vpn: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: e2e script: - dpkg -l tox gnupg1 haveged > /dev/null || apt-get -y --no-install-recommends install tox gnupg1 haveged - tox -e py27-dev --notest - source .tox/py27-dev/bin/activate - make dev-latest-backend - mkdir -p /root/.config/leap/ - make install_helpers - make test_e2e_vpn tags: - linux e2e_test_conditional_downloads: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: e2e allow_failure: true script: - dpkg -l tox gnupg1 haveged > /dev/null || apt-get -y --no-install-recommends install tox gnupg1 haveged - tox -e py27-dev --notest - source .tox/py27-dev/bin/activate - make dev-latest-backend - mkdir -p /root/.config/leap/ - make install_helpers - make test_e2e_conditional_downloads tags: - linux functional_tests: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: e2e before_script: - dpkg -l tox > /dev/null || apt-get -y --no-install-recommends install tox - tox -e py27-dev --notest - source .tox/py27-dev/bin/activate - make dev-latest-all - make test_functional_setup script: - make test_functional artifacts: when: on_failure paths: - failures name: "Bitmask_linux64_${CI_BUILD_REF}_e2e_screenshots" expire_in: 1 month tags: - linux # This is Work In Progress #functional_test_bundle: # image: 0xacab.org:4567/leap/bitmask-dev:latest # stage: test_bundle # allow_failure: true # script: # - TEST_MODE='bundle_ci' make test_functional # artifacts: # when: on_failure # paths: # - failures # name: "Bitmask_linux64_${CI_BUILD_REF}_e2e_screenshots" # expire_in: 1 month # tags: # - linux build_ui: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: e2e script: - cd ui && make dev-build tags: - linux cache: paths: - ui/node_modules/ build_docker_image: image: 0xacab.org:4567/leap/bitmask-dev:latest stage: publish services: - docker:dind tags: - docker-in-docker only: - branches@leap/bitmask-dev before_script: - > export LAST_COMMIT=$(curl -s --header "PRIVATE-TOKEN: ${LEAP_CODE_O_MATIC_PRIVATE_TOKEN}" https://0xacab.org/api/v4/projects/574/pipelines | python -c "import sys, json; print json.load(sys.stdin)[1]['sha']") script: - > if git diff $LAST_COMMIT HEAD --name-only | egrep '(tests/docker|.gitlab)' || [ "$CI_JOB_MANUAL" == "true" ] ; then if [ "$CI_COMMIT_REF_SLUG" == "master" ] then TAG='latest' else TAG="$CI_COMMIT_REF_SLUG" fi docker --version docker info docker login -u gitlab-ci-token -e sysdev@leap.se -p $CI_JOB_TOKEN $CI_REGISTRY docker build -t ${CI_REGISTRY_IMAGE}:${TAG} tests/docker docker push ${CI_REGISTRY_IMAGE}:${TAG} fi build_docker_bundle_image: image: 0xacab.org:4567/leap/docker/bitmask-bundler:latest stage: publish services: - docker:dind tags: - docker-in-docker only: - branches@leap/bitmask-dev before_script: - > export LAST_COMMIT=$(curl -s --header "PRIVATE-TOKEN: ${LEAP_CODE_O_MATIC_PRIVATE_TOKEN}" https://0xacab.org/api/v4/projects/574/pipelines | python -c "import sys, json; print json.load(sys.stdin)[1]['sha']") script: - > if git diff $LAST_COMMIT HEAD --name-only | egrep '(pkg/docker_bundle|.gitlab)' || [ "$CI_JOB_MANUAL" == "true" ] ; then if [ "$CI_COMMIT_REF_SLUG" == "master" ] then TAG='latest' else TAG="$CI_COMMIT_REF_SLUG" fi docker --version docker info docker login -u gitlab-ci-token -e sysdev@leap.se -p $CI_JOB_TOKEN $CI_REGISTRY docker build -t ${CI_REGISTRY_IMAGE}:${TAG} pkg/docker_bundle docker push ${CI_REGISTRY_IMAGE}:${TAG} fi .job_template: &job_definition stage: publish # Only build packages for https://0xacab.org/leap/bitmask-dev, not # for forks only: - master@leap/bitmask-dev - tags@leap/bitmask-dev image: "0xacab.org:4567/leap/gitlab-buildpackage:build_${DIST}_${ARCH}" script: - "pwd; git describe" - build-build-package # Test the package with lintian - build-test-lintian - upload-package # sleep 1h to allow debugging of running container #- sleep 3600 artifacts: expire_in: 1w paths: - '*_*.xz' - '*_*.dsc' - '*_amd64.changes' - '*.deb' - 'results/*' package:amd64_stretch: variables: ARCH: "amd64" DIST: "stretch" REPONAMES: "client" # Default is to fail on warnings, we disable it here # unless all lintian warnings are fixed (#9033) LINTIAN_OPTS: "-X filename-length, --suppress-tags newer-standards-version" <<: *job_definition package:amd64_buster: variables: ARCH: "amd64" DIST: "buster" REPONAMES: "client" # Default is to fail on warnings, we disable it here # unless all lintian warnings are fixed (#9033) LINTIAN_OPTS: "-X filename-length" <<: *job_definition package:amd64_sid: variables: ARCH: "amd64" DIST: "sid" REPONAMES: "client" # Default is to fail on warnings, we disable it here # unless all lintian warnings are fixed (#9033) LINTIAN_OPTS: "-X filename-length, --suppress-tags newer-standards-version" <<: *job_definition package:amd64_artful: variables: ARCH: "amd64" DIST: "artful" REPONAMES: "client" # Default is to fail on warnings, we disable it here # unless all lintian warnings are fixed (#9033) LINTIAN_OPTS: "-X filename-length, --suppress-tags newer-standards-version" <<: *job_definition package:amd64_bionic: variables: ARCH: "amd64" DIST: "bionic" REPONAMES: "client" # Default is to fail on warnings, we disable it here # unless all lintian warnings are fixed (#9033) LINTIAN_OPTS: "-X filename-length, --suppress-tags newer-standards-version" <<: *job_definition