Browse Source

Repair docker CI

merge-requests/225/head
Jonas Zohren 4 years ago
parent
commit
89ffcd36e5
No known key found for this signature in database
GPG Key ID: FE3ED5D90A175463
  1. 38
      .gitlab-ci.yml

38
.gitlab-ci.yml

@ -9,7 +9,6 @@ variables: @@ -9,7 +9,6 @@ variables:
FF_USE_FASTZIP: 1
CACHE_COMPRESSION_LEVEL: fastest
# --------------------------------------------------------------------- #
# Cargo: Compiling for different architectures #
# --------------------------------------------------------------------- #
@ -20,12 +19,12 @@ variables: @@ -20,12 +19,12 @@ variables:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "next"'
- if: '$CI_COMMIT_TAG'
- if: "$CI_COMMIT_TAG"
# TODO: Remove this before merging:
- if: '$CI_COMMIT_BRANCH == "better-multiarch-building-the-second-attempt"'
interruptible: true
image: "rust:latest"
tags: [ "docker" ]
tags: ["docker"]
cache:
paths:
- cargohome
@ -37,7 +36,7 @@ variables: @@ -37,7 +36,7 @@ variables:
before_script:
- 'echo "Building for target $TARGET"'
- 'mkdir -p cargohome && CARGOHOME="cargohome"'
- "rustc --version && cargo --version && rustup show" # Print version info for debugging
- "rustc --version && cargo --version && rustup show" # Print version info for debugging
- "rustup target add $TARGET"
script:
- time cargo build --target $TARGET --release
@ -103,7 +102,6 @@ build:release:cargo:aarch64-unknown-linux-musl: @@ -103,7 +102,6 @@ build:release:cargo:aarch64-unknown-linux-musl:
- "conduit-aarch64-unknown-linux-musl"
expose_as: "Conduit for aarch64-unknown-linux-musl"
.cargo-debug-shared-settings:
extends: ".build-cargo-shared-settings"
rules:
@ -127,12 +125,10 @@ build:debug:cargo:x86_64-unknown-linux-musl: @@ -127,12 +125,10 @@ build:debug:cargo:x86_64-unknown-linux-musl:
- "conduit-debug-x86_64-unknown-linux-musl"
expose_as: "Conduit DEBUG for x86_64-unknown-linux-musl"
# --------------------------------------------------------------------- #
# Cargo: Compiling deb packages for different architectures #
# --------------------------------------------------------------------- #
#.build-cargo-deb-shared-settings:
# stage: "build"
# needs: [ ]
@ -177,11 +173,10 @@ build:debug:cargo:x86_64-unknown-linux-musl: @@ -177,11 +173,10 @@ build:debug:cargo:x86_64-unknown-linux-musl:
# Create and publish docker image #
# --------------------------------------------------------------------- #
build:docker:new-way-of-building:
build:docker:
stage: "build docker image"
image: jdrouet/docker-with-buildx:stable
tags: [ "docker" ]
tags: ["docker"]
services:
- docker:dind
needs:
@ -213,8 +208,7 @@ build:docker:new-way-of-building: @@ -213,8 +208,7 @@ build:docker:new-way-of-building:
- mkdir -p linux/arm/ && mv ./conduit-armv7-unknown-linux-musleabihf linux/arm/v7
- mkdir -p linux/arm64/ && mv ./conduit-aarch64-unknown-linux-musl linux/arm64/v8
# Actually create multiarch image:
- docker buildx build --pull --squash --push --platform $PLATFORMS --tag $IMAGE_TAG --file $DOCKER_FILE .
- docker buildx build --pull --push --platform $PLATFORMS --tag $IMAGE_TAG --file $DOCKER_FILE .
## Build a docker image by packaging up the x86_64-unknown-linux-musl binary into an alpine image
#.docker-shared-settings:
@ -258,16 +252,15 @@ build:docker:new-way-of-building: @@ -258,16 +252,15 @@ build:docker:new-way-of-building:
#
#
# --------------------------------------------------------------------- #
# Run tests #
# --------------------------------------------------------------------- #
test:cargo:
stage: "test"
needs: [ ]
needs: []
image: "rust:latest"
tags: [ "docker" ]
tags: ["docker"]
variables:
CARGO_HOME: "cargohome"
cache:
@ -282,7 +275,7 @@ test:cargo: @@ -282,7 +275,7 @@ test:cargo:
- apt-get install -yqq --no-install-recommends build-essential libssl-dev pkg-config
- rustup component add clippy rustfmt
script:
- rustc --version && cargo --version # Print version info for debugging
- rustc --version && cargo --version # Print version info for debugging
- cargo fmt --all -- --check
- cargo test --workspace --verbose --locked
- cargo clippy
@ -294,8 +287,8 @@ test:sytest: @@ -294,8 +287,8 @@ test:sytest:
- "build:debug:cargo:x86_64-unknown-linux-musl"
image:
name: "valkum/sytest-conduit:latest"
entrypoint: [ "" ]
tags: [ "docker" ]
entrypoint: [""]
tags: ["docker"]
variables:
PLUGINS: "https://github.com/valkum/sytest_conduit/archive/master.tar.gz"
before_script:
@ -308,7 +301,7 @@ test:sytest: @@ -308,7 +301,7 @@ test:sytest:
script:
- "SYTEST_EXIT_CODE=0"
- "/bootstrap.sh conduit || SYTEST_EXIT_CODE=1"
- "perl /sytest/tap-to-junit-xml.pl --puretap --input /logs/results.tap --output $CI_PROJECT_DIR/sytest.xml \"Sytest\" && cp /logs/results.tap $CI_PROJECT_DIR/results.tap"
- 'perl /sytest/tap-to-junit-xml.pl --puretap --input /logs/results.tap --output $CI_PROJECT_DIR/sytest.xml "Sytest" && cp /logs/results.tap $CI_PROJECT_DIR/results.tap'
- "exit $SYTEST_EXIT_CODE"
artifacts:
when: always
@ -318,7 +311,6 @@ test:sytest: @@ -318,7 +311,6 @@ test:sytest:
reports:
junit: "$CI_PROJECT_DIR/sytest.xml"
# --------------------------------------------------------------------- #
# Store binaries as package so they have download urls #
# --------------------------------------------------------------------- #
@ -334,9 +326,9 @@ publish:package: @@ -334,9 +326,9 @@ publish:package:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "next"'
- if: '$CI_COMMIT_TAG'
- if: "$CI_COMMIT_TAG"
image: curlimages/curl:latest
tags: [ "docker" ]
tags: ["docker"]
variables:
GIT_STRATEGY: "none" # Don't need a clean copy of the code, we just operate on artifacts
script:
@ -345,5 +337,3 @@ publish:package: @@ -345,5 +337,3 @@ publish:package:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-arm-unknown-linux-musleabihf "${BASE_URL}/conduit-arm-unknown-linux-musleabihf"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-armv7-unknown-linux-musleabihf "${BASE_URL}/conduit-armv7-unknown-linux-musleabihf"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file conduit-aarch64-unknown-linux-musl "${BASE_URL}/conduit-aarch64-unknown-linux-musl"'

Loading…
Cancel
Save