You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
5.0 KiB
156 lines
5.0 KiB
image: docker:git
|
|
|
|
variables:
|
|
DOCKER_REPOSITORY: mendersoftware/mender-convert
|
|
S3_BUCKET_NAME: mender-convert-images
|
|
MENDER_ARTIFACT_VERSION: master
|
|
MENDER_CLIENT_VERSION: master
|
|
RASPBIAN_URL: http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip
|
|
RASPBIAN_NAME: 2019-09-26-raspbian-buster-lite
|
|
MENDER_IMAGE_TESTS_REV: master
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
include:
|
|
- project: 'Northern.tech/Mender/mendertesting'
|
|
file: '.gitlab-ci-check-commits.yml'
|
|
- project: 'Northern.tech/Mender/mendertesting'
|
|
file: '.gitlab-ci-check-license.yml'
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
- convert
|
|
- test_acceptance
|
|
- publish
|
|
|
|
build:
|
|
stage: build
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- IMAGE_NAME=$DOCKER_REPOSITORY:pr ./docker-build --build-arg MENDER_ARTIFACT_VERSION=${MENDER_ARTIFACT_VERSION}
|
|
- docker save $DOCKER_REPOSITORY:pr > image.tar
|
|
artifacts:
|
|
expire_in: 2w
|
|
paths:
|
|
- image.tar
|
|
|
|
.template_test_acceptance: &test_acceptance
|
|
stage: test_acceptance
|
|
image: teracy/ubuntu:18.04-dind-18.09.9
|
|
services:
|
|
- docker:18-dind
|
|
tags:
|
|
- mender-qa-slave
|
|
dependencies:
|
|
- build
|
|
- convert_raspbian
|
|
timeout: 2h
|
|
before_script:
|
|
# Install dependencies
|
|
- apt update
|
|
- apt install -qyy bash wget git util-linux mtools python3 python3-pip
|
|
gcc python3-dev libffi-dev liblzo2-dev libc-dev libssl-dev make sudo
|
|
awscli unzip
|
|
# Python3 dependencies
|
|
- pip3 install -r https://raw.githubusercontent.com/mendersoftware/meta-mender/master/tests/acceptance/requirements_py3.txt
|
|
# Load image under test
|
|
- export IMAGE_NAME=$DOCKER_REPOSITORY:pr
|
|
- docker load -i image.tar
|
|
# Set submodule to correct version
|
|
- ( cd tests/mender-image-tests && git submodule update --init --remote && git checkout origin/${MENDER_IMAGE_TESTS_REV} )
|
|
artifacts:
|
|
expire_in: 2w
|
|
when: always
|
|
paths:
|
|
- results_*.xml
|
|
- report_*.html
|
|
reports:
|
|
junit: results_*.xml
|
|
|
|
test_acceptance_prebuilt_raspberrypi:
|
|
<<: *test_acceptance
|
|
script:
|
|
# Fetch artifacts from temporary S3 bucket
|
|
- aws s3 cp s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/deploy.tar.gz deploy.tar.gz
|
|
- tar xzf deploy.tar.gz
|
|
# Extract converted Raspbian artifacts
|
|
- unxz deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}-mender.img.xz
|
|
- ./scripts/test/run-tests.sh --no-pull --prebuilt-image raspberrypi ${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}
|
|
|
|
test_acceptance_qemux86_64:
|
|
<<: *test_acceptance
|
|
script:
|
|
- ./scripts/test/run-tests.sh --no-pull --only qemux86_64
|
|
|
|
test_acceptance_raspberrypi:
|
|
<<: *test_acceptance
|
|
script:
|
|
- ./scripts/test/run-tests.sh --no-pull --only raspberrypi
|
|
|
|
test_acceptance_linaro-alip:
|
|
<<: *test_acceptance
|
|
script:
|
|
- ./scripts/test/run-tests.sh --no-pull --only linaro-alip
|
|
|
|
test_acceptance_beaglebone:
|
|
<<: *test_acceptance
|
|
script:
|
|
- ./scripts/test/run-tests.sh --no-pull --only beaglebone
|
|
|
|
test_acceptance_ubuntu:
|
|
<<: *test_acceptance
|
|
script:
|
|
- ./scripts/test/run-tests.sh --no-pull --only ubuntu
|
|
|
|
convert_raspbian:
|
|
stage: convert
|
|
image: teracy/ubuntu:18.04-dind-18.09.9
|
|
services:
|
|
- docker:18-dind
|
|
tags:
|
|
- mender-qa-slave
|
|
dependencies:
|
|
- build
|
|
before_script:
|
|
- apt update && apt install -yy bash wget unzip awscli
|
|
|
|
- export IMAGE_NAME=$DOCKER_REPOSITORY:pr
|
|
- docker load -i image.tar
|
|
|
|
- wget -q ${RASPBIAN_URL}
|
|
- unzip ${RASPBIAN_NAME}.zip
|
|
|
|
script:
|
|
- echo "MENDER_CLIENT_VERSION=${MENDER_CLIENT_VERSION}" > mender_client_version_config
|
|
- env MENDER_ARTIFACT_NAME=${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}
|
|
./docker-mender-convert -d ${RASPBIAN_NAME}.img
|
|
-c configs/raspberrypi3_config
|
|
-c configs/images/raspberrypi3_raspbian_config
|
|
-c mender_client_version_config
|
|
|
|
# Upload to temporary S3 bucket
|
|
- tar czf deploy.tar.gz deploy
|
|
- aws s3 cp deploy.tar.gz s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/deploy.tar.gz
|
|
|
|
publish:s3:
|
|
when: manual
|
|
stage: publish
|
|
image: debian:buster
|
|
before_script:
|
|
- apt update && apt install -yyq awscli
|
|
# Fetch artifacts from temporary S3 bucket
|
|
- aws s3 cp s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/deploy.tar.gz deploy.tar.gz
|
|
- tar xzf deploy.tar.gz
|
|
script:
|
|
- echo "Publishing ${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz version to S3"
|
|
# Prepare high privilege S3 keys (the base keys are for the tmp storage only)
|
|
- export AWS_ACCESS_KEY_ID=$PUBLISH_AWS_ACCESS_KEY_ID
|
|
- export AWS_SECRET_ACCESS_KEY=$PUBLISH_AWS_SECRET_ACCESS_KEY
|
|
- aws s3 cp deploy/raspberrypi-${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}-mender.img.xz
|
|
s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz
|
|
- aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME
|
|
--key ${RASPBIAN_NAME}/arm/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz
|
|
only:
|
|
- /^(master|[0-9]+\.[0-9]+\.x)$/
|
|
|