Skip to content

Commit 07b58c4

Browse files
committed
update script
1 parent 86b3fec commit 07b58c4

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

.werft/integration-tests-startup.yaml

+34-21
Original file line numberDiff line numberDiff line change
@@ -35,43 +35,56 @@ pod:
3535
3636
function cleanup ()
3737
{
38-
werft run github -a namespace=staging-gitpod-test-main --remote-job-path .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main
39-
}
38+
werft log phase "cleanup preview environment" "cleanup preview environment"
39+
BUILD_ID=$(werft run github -a namespace=staging-gitpod-test-main -j .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main)
40+
41+
echo "start cleanup preview environment, job name: ${BUILD_ID}" | werft log slice "cleanup"
42+
werft log result -d "cleanup job" url "https://werft.gitpod-dev.com/job/${BUILD_ID}"
4043
44+
werft job logs ${BUILD_ID} | werft log slice "cleanup"
45+
}
4146
42-
echo "[prep] preparing config."
47+
echo "preparing config." | werft log slice prepare
4348
gcloud auth activate-service-account --key-file /mnt/secrets/gcp-sa/service-account.json
4449
export GOOGLE_APPLICATION_CREDENTIALS="/home/gitpod/.config/gcloud/legacy_credentials/[email protected]/adc.json"
4550
export DOCKER_HOST=tcp://$NODENAME:2375
46-
echo "[prep] copied config..."
47-
echo "[prep|DONE]"
51+
echo "copied config..." | werft log slice prepare
52+
werft log slice prepare --done
4853
54+
werft log phase "build preview environment" "build preview environment"
4955
# this is because we don't want to increate gitpod-build-main number, we can choose a name
5056
sudo cp .werft/build.yaml .werft/test.yaml
5157
# version is actual namespace that werft is build, --job-file should be same with above
52-
VERSION=$(werft run github -j .werft/test.yaml github.com/gitpod-io/gitpod:main)
53-
echo "[build test environment] start ${VERSION}"
58+
VERSION=$(werft run github -j .werft/test.yaml -s .werft/test.yaml github.com/gitpod-io/gitpod:main)
59+
echo "start build preview environment, job name: ${VERSION}, this will take long time" | werft log slice "build test environment"
60+
werft log result -d "build job" url "https://werft.gitpod-dev.com/job/${VERSION}"
61+
62+
if ! werft job logs ${VERSION} | werft log slice "build test environment";
63+
then
64+
echo "build failed" | werft log slice "build test environment"
65+
exit 1
66+
fi
67+
echo "build success" | werft log slice "build test environment"
68+
werft log slice "build test environment" --done
5469
5570
# clean preview environment when the script exits
5671
trap cleanup SIGINT SIGTERM EXIT
5772
58-
until werft job get ${VERSION} -o yaml | yq r - "phase" | grep '4' > /dev/null; do
59-
sleep 1
60-
done
61-
echo "[build test environment] done"
62-
echo "[build test environment|DONE]"
63-
73+
werft log phase "integration test" "integration test"
6474
# we need get integration-test version like: jp-run-integration-test.61
75+
INTEGRATION_VERSION=$(docker run eu.gcr.io/gitpod-core-dev/build/versions:${VERSION} cat versions.yaml | yq r - 'components.integrationTest.version')
6576
66-
# INTEGRATION_VERSION=$(docker run eu.gcr.io/gitpod-core-dev/build/versions:${VERSION} cat versions.yaml | yq r - 'components.integrationTest.version')
77+
echo "using integration-test image: ${INTEGRATION_VERSION}" | werft log slice "test"
6778
68-
# only for test now
69-
INTEGRATION_VERSION=jp-run-integration-test.80
70-
echo "[version] ${INTEGRATION_VERSION}"
7179
7280
TEST_BUILD_ID=$(werft run github -a version=${INTEGRATION_VERSION} -a namespace=staging-gitpod-test-main -j .werft/run-integration-tests-ide.yaml -a testPattern=ide.test github.com/gitpod-io/gitpod:main)
73-
until werft job get ${TEST_BUILD_ID} -o yaml | yq r - "phase" | grep '4' > /dev/null; do
74-
sleep 1
75-
done
7681
77-
werft job get ${TEST_BUILD_ID} -o yaml | yq r - "conditions.success" > /dev/null | grep "true"
82+
echo "running integration, job name: ${TEST_BUILD_ID}" | werft log slice "test"
83+
werft log result -d "integration test job" url "https://werft.gitpod-dev.com/job/${TEST_BUILD_ID}"
84+
85+
if ! werft job logs ${TEST_BUILD_ID} | werft log slice "test";
86+
then
87+
echo "ingetration test failed" | werft log slice "test"
88+
exit 1
89+
fi
90+
echo "ingetration test success" | werft log slice "test"

0 commit comments

Comments
 (0)