--- stages: - code-check - build - tests - package - benchmark variables: DOCKER_DRIVER: overlay # Cache a folder between builds. # Tox sets it to be our pip cache. cache: untracked: true key: soledad-shared-pip-cache paths: - .cache/ before_script: - echo "Running on ${HOST_HOSTNAME:=$(hostname)}" .job_template: &job_definition stage: package image: "0xacab.org:4567/leap/gitlab-buildpackage:build_${DIST}_${ARCH}" script: - "if [ -z \"$(git remote | grep upstream)\" ]; then git remote add upstream https://0xacab.org/leap/soledad; fi" - "git fetch --tags upstream" - "pwd; git describe" - build-build-package # Test the package with lintian - build-test-lintian - "if [ -n \"${SSH_PRIVATE_KEY}\" ]; then upload-package; else echo \"Skipping package upload because SSH_PRIVATE_KEY is not set.\"; fi" # sleep 1h to allow debugging of running container # - sleep 3600 artifacts: expire_in: 1w paths: - '*_*.xz' - '*_*.dsc' - '*_amd64.changes' - '*.deb' - 'results/*' code-check: stage: code-check image: 0xacab.org:4567/leap/soledad:latest script: - tox -e code-check tests: stage: tests image: 0xacab.org:4567/leap/soledad:latest services: - couchdb script: - tox -- --couch-url http://couchdb:5984 time-cpu: stage: benchmark image: 0xacab.org:4567/leap/soledad:latest tags: - benchmark services: - couchdb script: - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && git checkout origin/master scripts/benchmark/setup-all-commits-env.sh' - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && ./scripts/benchmark/setup-all-commits-env.sh' - curl -s couchdb:5984 # You can provide a $NETRC variable containing the creds for your # elasticsearch instance so it's protected from being leaked in the # CI console # We can't get it working inside docker for unknown reasons. # - echo "$NETRC" > /root/.netrc && chmod 600 /root/.netrc # # Add $PYTEST_OPTS to pytest.ini to allow posting benchmark tests # to an elasticsearch instance - echo "addopts=$PYTEST_OPTS" >> pytest.ini && chmod 600 pytest.ini - /usr/bin/unbuffer tox --recreate -e benchmark-time-cpu -- --couch-url http://couchdb:5984 | /usr/bin/ts -s # Output locally saved benchmarks if they exist - 'if [ -d .benchmarks ]; then find .benchmarks -type f -exec cat {} \; ; fi' memory: stage: benchmark image: 0xacab.org:4567/leap/soledad:latest tags: - benchmark services: - couchdb script: - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && git checkout origin/master scripts/benchmark/setup-all-commits-env.sh' - '[ -n "${BENCHMARK_ALL_COMMITS}" ] && ./scripts/benchmark/setup-all-commits-env.sh' - curl -s couchdb:5984 # You can provide a $NETRC variable containing the creds for your # elasticsearch instance so it's protected from being leaked in the # CI console # We can't get it working inside docker for unknown reasons. # - echo "$NETRC" > /root/.netrc && chmod 600 /root/.netrc # # Add $PYTEST_OPTS to pytest.ini to allow posting benchmark tests # to an elasticsearch instance - echo "addopts=$PYTEST_OPTS" >> pytest.ini && chmod 600 pytest.ini - /usr/bin/unbuffer tox --recreate -e benchmark-memory -- --couch-url http://couchdb:5984 | /usr/bin/ts -s # Output locally saved benchmarks if they exist - 'if [ -d .benchmarks ]; then find .benchmarks -type f -exec cat {} \; ; fi' responsiveness: stage: benchmark image: 0xacab.org:4567/leap/soledad:latest tags: - benchmark services: - couchdb script: - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" - curl -s couchdb:5984 - echo "addopts=--elasticsearch-url=\"$ELASTICSEARCH_URL\"" >> pytest.ini && chmod 600 pytest.ini - /usr/bin/unbuffer tox --recreate -e responsiveness -- --couch-url http://couchdb:5984 | /usr/bin/ts -s build_docker_image: stage: build image: 0xacab.org:4567/leap/soledad:latest services: - docker:dind tags: - docker-in-docker script: - scripts/docker/build-docker-image.sh package:amd64_jessie: variables: ARCH: "amd64" DIST: "jessie" REPONAMES: "platform,client" # Default is to fail on warnings, we disable it here # unless a manpage is included (see #8895) LINTIAN_OPTS: "-X filename-length" <<: *job_definition package:amd64_stretch: variables: ARCH: "amd64" DIST: "stretch" REPONAMES: "platform,client" # Default is to fail on warnings, we disable it here # unless a manpage is included (see #8895) LINTIAN_OPTS: "-X filename-length" <<: *job_definition package:amd64_zesty: variables: ARCH: "amd64" DIST: "zesty" REPONAMES: "platform,client" # Default is to fail on warnings, we disable it here # unless a manpage is included (see #8895) LINTIAN_OPTS: "-X filename-length" <<: *job_definition