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.
 
 
 
 

119 lines
3.5 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
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
- test_acceptance
- convert
- 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
test_acceptance:
stage: test_acceptance
image: docker:18-dind
tags:
- mender-qa-slave
dependencies:
- build
before_script:
# Start up Docker (DonD)
- /usr/local/bin/dockerd-entrypoint.sh &
- sleep 10
- export DOCKER_HOST="unix:///var/run/docker.sock"
- docker version
# Install dependencies
- apk --update --no-cache add bash wget git util-linux mtools python3 py3-pip
gcc python3-dev libffi-dev lzo-dev libc-dev openssl-dev make sudo
# 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
script:
- ./scripts/test/run-tests.sh
artifacts:
expire_in: 2w
when: always
paths:
- results_*.xml
- report_*.html
reports:
junit: results_*.xml
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
- 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=mender-raspbian
./docker-mender-convert -d ${RASPBIAN_NAME}.img
-c configs/raspberrypi3_config
-c configs/images/raspberrypi3_raspbian_config
-c mender_client_version_config
- cp deploy/raspberrypi-mender-raspbian.sdimg.xz deploy/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz
- unxz deploy/raspberrypi-mender-raspbian.sdimg.xz
# Verify converted image
- . ./scripts/test/test-utils.sh
- run_tests raspbian mender-raspbian "-k TestMenderInstalled"
after_script:
- mkdir -p output
- mv deploy/*.img.xz output
artifacts:
paths:
- output
expire_in: 2 weeks
publish:s3:
when: manual
stage: publish
image: debian:buster
before_script:
- apt update && apt install -yyq awscli
script:
- echo "Publishing ${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.img.xz version to S3"
- aws s3 cp output/${RASPBIAN_NAME}-mender-${MENDER_CLIENT_VERSION}.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