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.
212 lines
7.3 KiB
212 lines
7.3 KiB
|
|
variables:
|
|
DOCKER_REPOSITORY: mendersoftware/mender-convert
|
|
S3_BUCKET_NAME: mender-convert-images
|
|
# These variables are present elsewhere in the repository too. Make sure to
|
|
# search for and change them too.
|
|
MENDER_ARTIFACT_VERSION: master
|
|
MENDER_CLIENT_VERSION: master
|
|
# Make sure to update the link in mender-docs to the new one when changing
|
|
# this.
|
|
RASPBIAN_URL: http://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2020-05-28/2020-05-27-raspios-buster-lite-armhf.zip
|
|
RASPBIAN_NAME: 2020-05-27-raspios-buster-lite-armhf
|
|
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'
|
|
- project: 'Northern.tech/Mender/mendertesting'
|
|
file: '.gitlab-ci-github-status-updates.yml'
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
- convert
|
|
- test_acceptance
|
|
- publish
|
|
|
|
build:
|
|
stage: build
|
|
image: docker:git
|
|
services:
|
|
- docker:19.03.5-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_convert_raspbian: &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:
|
|
- export AWS_ACCESS_KEY_ID=$TMP_STORAGE_AWS_ACCESS_KEY_ID
|
|
- export AWS_SECRET_ACCESS_KEY=$TMP_STORAGE_AWS_SECRET_ACCESS_KEY
|
|
|
|
- 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/${RASPBERRYPI_PLATFORM}_config
|
|
-c configs/images/raspberrypi_raspbian_config
|
|
-c mender_client_version_config
|
|
|
|
# Upload to temporary S3 bucket
|
|
- mv deploy ${RASPBERRYPI_PLATFORM}
|
|
- tar czf ${RASPBERRYPI_PLATFORM}.tar.gz ${RASPBERRYPI_PLATFORM}
|
|
- aws s3 cp ${RASPBERRYPI_PLATFORM}.tar.gz s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/${RASPBERRYPI_PLATFORM}.tar.gz
|
|
|
|
convert_raspbian_raspberrypi3:
|
|
<<: *convert_raspbian
|
|
variables:
|
|
RASPBERRYPI_PLATFORM: raspberrypi3
|
|
|
|
convert_raspbian_raspberrypi4:
|
|
<<: *convert_raspbian
|
|
variables:
|
|
RASPBERRYPI_PLATFORM: raspberrypi4
|
|
|
|
.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
|
|
timeout: 2h
|
|
before_script:
|
|
- export AWS_ACCESS_KEY_ID=$TMP_STORAGE_AWS_ACCESS_KEY_ID
|
|
- export AWS_SECRET_ACCESS_KEY=$TMP_STORAGE_AWS_SECRET_ACCESS_KEY
|
|
# 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
|
|
|
|
.template_test_acceptance_prebuilt_raspberrypi: &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/${RASPBERRYPI_PLATFORM}.tar.gz ${RASPBERRYPI_PLATFORM}.tar.gz
|
|
- tar xzf ${RASPBERRYPI_PLATFORM}.tar.gz
|
|
- mv ${RASPBERRYPI_PLATFORM} deploy
|
|
# Extract converted Raspbian artifacts
|
|
- unxz deploy/${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender.img.xz
|
|
- ./scripts/test/run-tests.sh --no-pull --prebuilt-image raspberrypi ${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender
|
|
|
|
test_acceptance_prebuilt_raspberrypi3:
|
|
<<: *test_acceptance_prebuilt_raspberrypi
|
|
dependencies:
|
|
- build
|
|
- convert_raspbian_raspberrypi3
|
|
variables:
|
|
RASPBERRYPI_PLATFORM: raspberrypi3
|
|
|
|
test_acceptance_prebuilt_raspberrypi4:
|
|
<<: *test_acceptance_prebuilt_raspberrypi
|
|
dependencies:
|
|
- build
|
|
- convert_raspbian_raspberrypi4
|
|
variables:
|
|
RASPBERRYPI_PLATFORM: raspberrypi4
|
|
|
|
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 raspberrypi3
|
|
|
|
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
|
|
|
|
publish:s3:
|
|
when: manual
|
|
stage: publish
|
|
image: debian:buster
|
|
before_script:
|
|
- export PUBLISH_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
|
|
- export PUBLISH_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
|
|
- export AWS_ACCESS_KEY_ID=$TMP_STORAGE_AWS_ACCESS_KEY_ID
|
|
- export AWS_SECRET_ACCESS_KEY=$TMP_STORAGE_AWS_SECRET_ACCESS_KEY
|
|
- apt update && apt install -yyq awscli
|
|
# Fetch artifacts from temporary S3 bucket
|
|
- for RASPBERRYPI_PLATFORM in raspberrypi3 raspberrypi4; do
|
|
- aws s3 cp s3://mender-gitlab-tmp-storage/$CI_PROJECT_NAME/$CI_PIPELINE_ID/${RASPBERRYPI_PLATFORM}.tar.gz ${RASPBERRYPI_PLATFORM}.tar.gz
|
|
- tar xzf ${RASPBERRYPI_PLATFORM}.tar.gz
|
|
- done
|
|
script:
|
|
# Prepare high privilege S3 keys (the TMP_STORAGE 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
|
|
|
|
- for RASPBERRYPI_PLATFORM in raspberrypi3 raspberrypi4; do
|
|
- PUBLISH_NAME=${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender-${MENDER_CLIENT_VERSION}.img.xz
|
|
- echo "Publishing ${PUBLISH_NAME} version to S3"
|
|
- aws s3 cp ${RASPBERRYPI_PLATFORM}/${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender.img.xz
|
|
s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${PUBLISH_NAME}
|
|
- aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME
|
|
--key ${RASPBIAN_NAME}/arm/${PUBLISH_NAME}
|
|
|
|
- PUBLISH_NAME=${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender-${MENDER_CLIENT_VERSION}.mender
|
|
- echo "Publishing ${PUBLISH_NAME} version to S3"
|
|
- aws s3 cp ${RASPBERRYPI_PLATFORM}/${RASPBIAN_NAME}-${RASPBERRYPI_PLATFORM}-mender.mender
|
|
s3://$S3_BUCKET_NAME/${RASPBIAN_NAME}/arm/${PUBLISH_NAME}
|
|
- aws s3api put-object-acl --acl public-read --bucket $S3_BUCKET_NAME
|
|
--key ${RASPBIAN_NAME}/arm/${PUBLISH_NAME}
|
|
- done
|
|
|
|
only:
|
|
- /^(master|[0-9]+\.[0-9]+\.x)$/
|
|
|