From b20f3a39e11a314b3b24ba693c23fdc2939f92b8 Mon Sep 17 00:00:00 2001 From: Nikkoura Date: Sun, 29 Dec 2019 15:57:41 +0100 Subject: [PATCH] feat(ci-build): Initial travis / semantic release scripts --- .gitmodules | 3 +++ build | 1 + travis.yml | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 .gitmodules create mode 160000 build create mode 100644 travis.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3ebf32e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "build"] + path = build + url = https://github.com/nikkoura/semantic-release-ci-docker.git diff --git a/build b/build new file mode 160000 index 0000000..9e08f56 --- /dev/null +++ b/build @@ -0,0 +1 @@ +Subproject commit 9e08f5686db492e00bf98cdb085115fd3c817a1d diff --git a/travis.yml b/travis.yml new file mode 100644 index 0000000..cc2b806 --- /dev/null +++ b/travis.yml @@ -0,0 +1,65 @@ +language: shell + +env: + global: + - IMAGE_BASE_NAME=${IMAGE_BASE_NAME} + +jobs: + include: + - stage: "build and test" + name: build-amd64 + arch: amd64 + workspaces: + create: + name: docker-image-amd64 + paths: + - image-amd64.tar + os: linux + language: shell + script: + - IMAGE_VERSION=${TRAVIS_BRANCH} build/build-arch.sh + #TODO: call test script if available + - name: build-arm64 + arch: arm64 + workspaces: + create: + name: docker-image-arm64 + paths: + - image-arm64.tar + os: linux + language: shell + script: + - IMAGE_VERSION=${TRAVIS_BRANCH} build/build-arch.sh + #TODO: call test script if available + + - stage: auto-tag + language: node_js + arch: amd64 + os: linux + node_js: lts/* + if: tag IS blank AND branch = master AND type != pull_request AND fork = false + script: + - build/autotag.sh + + - stage: push + arch: amd64 + os: linux + language: shell + if: tag IS present and fork = false + workspaces: + use: + - docker-image-amd64 + - docker-image-arm64 + script: + - docker image load -i image-amd64.tar + - IMAGE_VERSION=${TRAVIS_TAG} TARGET_ARCH=amd64 build/push-arch.sh + - docker image load -i image-arm64.tar + - IMAGE_VERSION=${TRAVIS_TAG} TARGET_ARCH=arm64 build/push-arch.sh + + - stage: manifest + language: shell + arch: amd64 + os: linux + if: tag IS present and fork = false + script: + - IMAGE_VERSION=${TRAVIS_TAG} build/manifest.sh