.run-kitchen: image: ruby:2.6.3 stage: test tags: - saltstack-kitchen only: refs: - schedules variables: FORCE_FULL: 'true' GOLDEN_IMAGES_CI_BRANCH: master NOX_ENABLE_FROM_FILENAMES: 'true' NOX_ENV_NAME: runtests-zeromq NOX_PASSTHROUGH_OPTS: '--ssh-tests' SALT_KITCHEN_DRIVER: kitchen-conf/driver.yml SALT_KITCHEN_PLATFORMS: kitchen-conf/nox-platforms.yml SALT_KITCHEN_VERIFIER: kitchen-conf/nox-verifier.yml TEST_SUITE: py3 USE_SPOT_INSTANCES: 'true' script: - apt update - apt -y install moreutils rsync dos2unix - mkdir -p ~/.ssh - echo "${KITCHEN_SSHKEY}" | tr -d '\r' > ~/.ssh/kitchen.pem - chmod 700 ~/.ssh/ - chmod 600 ~/.ssh/kitchen.pem - git clone https://gitlab.com/saltstack/open/cicd/kitchen-conf.git - bundle install --with ec2 windows --without docker vagrant - t=$(shuf -i 30-150 -n 1); echo "Sleeping $t seconds"; sleep $t - if [ "${USE_SPOT_INSTANCES}" == "true" ]; then cp -f kitchen-conf/spot.yml .kitchen.local.yml; fi - 'bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM)' - bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM > kitchen-diagnose-info.txt - grep 'image_id:' kitchen-diagnose-info.txt - grep 'instance_type:' -A5 kitchen-diagnose-info.txt - rm -f kitchen-diagnose-info.txt - rm -f .kitchen.local.yml - ssh-agent /bin/bash -xc 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM' - TEST_EXIT_CODE=0 - 'DONT_DOWNLOAD_ARTEFACTS=1 bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM|ts -s || TEST_EXIT_CODE=$?' - 'ONLY_DOWNLOAD_ARTEFACTS=1 bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM|ts -s || true' - bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM - exit $TEST_EXIT_CODE artifacts: when: always paths: - artifacts/ - .kitchen/ expire_in: 6 months