diff options
author | Arnstein Ressem <aressem@yahooinc.com> | 2023-03-14 12:17:31 +0100 |
---|---|---|
committer | Arnstein Ressem <aressem@yahooinc.com> | 2023-03-15 10:39:00 +0100 |
commit | 4645af85f4b767d953de90fd3e88993b46c4bff4 (patch) | |
tree | 5bf02487de7ef110f6a8d6f256a59da5e7e71f2e | |
parent | 66df58b0c5783e231a8232f8d45e748d25ef30d1 (diff) |
Separate out quick start guide test and use the same both for regular and legacy image.
-rw-r--r-- | screwdriver.yaml | 13 | ||||
-rwxr-xr-x | screwdriver/release-container-image.sh | 5 | ||||
-rwxr-xr-x | screwdriver/test-quick-start-guide.sh | 25 |
3 files changed, 32 insertions, 11 deletions
diff --git a/screwdriver.yaml b/screwdriver.yaml index 16f4c9ac9f4..c9de232d893 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -296,17 +296,8 @@ jobs: - verify-container-image: | # Trick to be able to use the documentation testing to verify the image built locally buildah tag docker.io/$IMAGE_NAME:$VESPA_VERSION vespaengine/vespa:latest - # Clone and setup doc tests - git clone -q --depth 1 https://github.com/vespa-engine/documentation - cd documentation - python3 -m pip install -qqq -r test/requirements.txt --user - echo -e "urls:\n - en/vespa-quick-start.html" > test/_quick-start.yaml - # Get the required vespa CLI - VESPA_CLI_VERSION=$(curl -fsSL https://api.github.com/repos/vespa-engine/vespa/releases/latest | grep -Po '"tag_name": "v\K.*?(?=")') && \ - curl -fsSL https://github.com/vespa-engine/vespa/releases/download/v${VESPA_CLI_VERSION}/vespa-cli_${VESPA_CLI_VERSION}_linux_amd64.tar.gz | tar -zxf - -C /opt && \ - ln -sf /opt/vespa-cli_${VESPA_CLI_VERSION}_linux_amd64/bin/vespa /usr/local/bin/ - # Run test - test/test.py -c test/_quick-start.yaml + # Run quick start guide + $SD_SOURCE_DIR/screwdriver/test-quick-start-guide.sh - publish-test-image: | if [[ -z $SD_PULL_REQUEST ]]; then if curl -fsSL https://index.docker.io/v1/repositories/$IMAGE_NAME/tags/$VESPA_VERSION &> /dev/null; then diff --git a/screwdriver/release-container-image.sh b/screwdriver/release-container-image.sh index 6d8babe3dcc..a2a56313fb5 100755 --- a/screwdriver/release-container-image.sh +++ b/screwdriver/release-container-image.sh @@ -61,6 +61,11 @@ for data in "Dockerfile vespa"; do if curl -fsSL https://index.docker.io/v1/repositories/vespaengine/$IMAGE_NAME/tags/$VESPA_VERSION &> /dev/null; then echo "Container image docker.io/vespaengine/$IMAGE_NAME:$VESPA_VERSION aldready exists." else + # Build the image and run through the quick start guide + docker buildx build --progress plain --load --platform linux/amd64 --build-arg VESPA_VERSION=$VESPA_VERSION \ + --file $DOCKER_FILE --tag vespaengine/$IMAGE_NAME:latest . + $SD_SOURCE_DIR/screwdriver/test-quick-start-guide.sh + docker login --username aressem --password "$DOCKER_HUB_DEPLOY_KEY" docker buildx build --progress plain --push --platform linux/amd64,linux/arm64 --build-arg VESPA_VERSION=$VESPA_VERSION \ --file $DOCKER_FILE --tag docker.io/vespaengine/$IMAGE_NAME:$VESPA_VERSION \ diff --git a/screwdriver/test-quick-start-guide.sh b/screwdriver/test-quick-start-guide.sh new file mode 100755 index 00000000000..f3f12c229b0 --- /dev/null +++ b/screwdriver/test-quick-start-guide.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# This test will test the quick start guide that use the vespaengine/vespa:latest image. To test a locally +# generated image, make sure that the image is tagged as vespaengine/vespa:latest. +set -xeuo pipefail + +TESTDIR=$(mktemp -d) +trap "rm -rf $TESTDIR" EXIT + +cd $TESTDIR + +# Clone and setup doc tests +git clone -q --depth 1 https://github.com/vespa-engine/documentation +cd documentation +python3 -m pip install -qqq -r test/requirements.txt --user +echo -e "urls:\n - en/vespa-quick-start.html" > test/_quick-start.yaml + +# Get the required vespa CLI +VESPA_CLI_VERSION=$(curl -fsSL https://api.github.com/repos/vespa-engine/vespa/releases/latest | grep -Po '"tag_name": "v\K.*?(?=")') +curl -fsSL https://github.com/vespa-engine/vespa/releases/download/v${VESPA_CLI_VERSION}/vespa-cli_${VESPA_CLI_VERSION}_linux_amd64.tar.gz | tar -zxf - -C /opt +ln -sf /opt/vespa-cli_${VESPA_CLI_VERSION}_linux_amd64/bin/vespa /usr/local/bin/ + +# Run test +test/test.py -v -c test/_quick-start.yaml + |