From 341d6adc98c6061cd54238e4fd4d7eb225f8cb35 Mon Sep 17 00:00:00 2001 From: Michael Mendy Date: Wed, 7 Feb 2024 11:01:13 -0800 Subject: [PATCH] build(cloud): add Travis CI example Giving a working .travis.yml file for folks who use Travis CI as their CI platform. --- content/build/cloud/ci.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/content/build/cloud/ci.md b/content/build/cloud/ci.md index f22eb77a0a..f4b235e737 100644 --- a/content/build/cloud/ci.md +++ b/content/build/cloud/ci.md @@ -309,6 +309,38 @@ pipeline { } ``` +{{< /tab >}} +{{< tab name="Travis CI" >}} + +```yaml +language: minimal +dist: jammy + +services: + - docker + +env: + global: + - IMAGE_NAME=username/repo + +before_install: | + echo "$DOCKER_PAT" | docker login --username "$DOCKER_USER" --password-stdin + +install: | + set -e + BUILDX_URL=$(curl -s https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-lab-releases.json | jq -r ".latest.assets[] | select(endswith(\"linux-$TRAVIS_CPU_ARCH\"))") + mkdir -vp ~/.docker/cli-plugins/ + curl --silent -L --output ~/.docker/cli-plugins/docker-buildx $BUILDX_URL + chmod a+x ~/.docker/cli-plugins/docker-buildx + docker buildx create --use --driver cloud "/default" + +script: | + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --push \ + --tag "$IMAGE_NAME" . +``` + {{< /tab >}} {{< tab name="BitBucket Pipelines" >}}