From 42a70beebdcc284aa19c176b604353a5f9007b33 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sat, 15 Aug 2020 00:45:33 -0400 Subject: [PATCH 1/3] chore: Generate Docker file GitHub Actions --- .github/workflows/10-alpine3.10.yml | 24 ++++ .github/workflows/10-alpine3.11.yml | 24 ++++ .github/workflows/10-alpine3.9.yml | 24 ++++ .github/workflows/10-buster-slim.yml | 24 ++++ .github/workflows/10-buster.yml | 24 ++++ .github/workflows/10-stretch-slim.yml | 24 ++++ .github/workflows/10-stretch.yml | 24 ++++ .github/workflows/12-alpine3.10.yml | 24 ++++ .github/workflows/12-alpine3.11.yml | 24 ++++ .github/workflows/12-alpine3.12.yml | 24 ++++ .github/workflows/12-alpine3.9.yml | 24 ++++ .github/workflows/12-buster-slim.yml | 24 ++++ .github/workflows/12-buster.yml | 24 ++++ .github/workflows/12-stretch-slim.yml | 24 ++++ .github/workflows/12-stretch.yml | 24 ++++ .github/workflows/14-alpine3.10.yml | 24 ++++ .github/workflows/14-alpine3.11.yml | 24 ++++ .github/workflows/14-alpine3.12.yml | 24 ++++ .github/workflows/14-buster-slim.yml | 24 ++++ .github/workflows/14-buster.yml | 24 ++++ .github/workflows/14-stretch-slim.yml | 24 ++++ .github/workflows/14-stretch.yml | 24 ++++ .travis.yml | 183 -------------------------- travis.yml.template | 29 ---- update.sh | 55 +++++--- 25 files changed, 563 insertions(+), 232 deletions(-) create mode 100644 .github/workflows/10-alpine3.10.yml create mode 100644 .github/workflows/10-alpine3.11.yml create mode 100644 .github/workflows/10-alpine3.9.yml create mode 100644 .github/workflows/10-buster-slim.yml create mode 100644 .github/workflows/10-buster.yml create mode 100644 .github/workflows/10-stretch-slim.yml create mode 100644 .github/workflows/10-stretch.yml create mode 100644 .github/workflows/12-alpine3.10.yml create mode 100644 .github/workflows/12-alpine3.11.yml create mode 100644 .github/workflows/12-alpine3.12.yml create mode 100644 .github/workflows/12-alpine3.9.yml create mode 100644 .github/workflows/12-buster-slim.yml create mode 100644 .github/workflows/12-buster.yml create mode 100644 .github/workflows/12-stretch-slim.yml create mode 100644 .github/workflows/12-stretch.yml create mode 100644 .github/workflows/14-alpine3.10.yml create mode 100644 .github/workflows/14-alpine3.11.yml create mode 100644 .github/workflows/14-alpine3.12.yml create mode 100644 .github/workflows/14-buster-slim.yml create mode 100644 .github/workflows/14-buster.yml create mode 100644 .github/workflows/14-stretch-slim.yml create mode 100644 .github/workflows/14-stretch.yml diff --git a/.github/workflows/10-alpine3.10.yml b/.github/workflows/10-alpine3.10.yml new file mode 100644 index 000000000..1e27cc11f --- /dev/null +++ b/.github/workflows/10-alpine3.10.yml @@ -0,0 +1,24 @@ +name: 10 on alpine3.10 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.10/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.10/Dockerfile + +jobs: + build: + name: 10 on alpine3.10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 alpine3.10 diff --git a/.github/workflows/10-alpine3.11.yml b/.github/workflows/10-alpine3.11.yml new file mode 100644 index 000000000..e7f459afe --- /dev/null +++ b/.github/workflows/10-alpine3.11.yml @@ -0,0 +1,24 @@ +name: 10 on alpine3.11 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.11/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.11/Dockerfile + +jobs: + build: + name: 10 on alpine3.11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 alpine3.11 diff --git a/.github/workflows/10-alpine3.9.yml b/.github/workflows/10-alpine3.9.yml new file mode 100644 index 000000000..cfc60915a --- /dev/null +++ b/.github/workflows/10-alpine3.9.yml @@ -0,0 +1,24 @@ +name: 10 on alpine3.9 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.9/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/alpine3.9/Dockerfile + +jobs: + build: + name: 10 on alpine3.9 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 alpine3.9 diff --git a/.github/workflows/10-buster-slim.yml b/.github/workflows/10-buster-slim.yml new file mode 100644 index 000000000..7d1b53e9a --- /dev/null +++ b/.github/workflows/10-buster-slim.yml @@ -0,0 +1,24 @@ +name: 10 on buster-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/buster-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/buster-slim/Dockerfile + +jobs: + build: + name: 10 on buster-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 buster-slim diff --git a/.github/workflows/10-buster.yml b/.github/workflows/10-buster.yml new file mode 100644 index 000000000..648f5f7b9 --- /dev/null +++ b/.github/workflows/10-buster.yml @@ -0,0 +1,24 @@ +name: 10 on buster + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/buster/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/buster/Dockerfile + +jobs: + build: + name: 10 on buster + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 buster diff --git a/.github/workflows/10-stretch-slim.yml b/.github/workflows/10-stretch-slim.yml new file mode 100644 index 000000000..846ec74de --- /dev/null +++ b/.github/workflows/10-stretch-slim.yml @@ -0,0 +1,24 @@ +name: 10 on stretch-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/stretch-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/stretch-slim/Dockerfile + +jobs: + build: + name: 10 on stretch-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 stretch-slim diff --git a/.github/workflows/10-stretch.yml b/.github/workflows/10-stretch.yml new file mode 100644 index 000000000..7a9dc1b22 --- /dev/null +++ b/.github/workflows/10-stretch.yml @@ -0,0 +1,24 @@ +name: 10 on stretch + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/stretch/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 10/stretch/Dockerfile + +jobs: + build: + name: 10 on stretch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 10 stretch diff --git a/.github/workflows/12-alpine3.10.yml b/.github/workflows/12-alpine3.10.yml new file mode 100644 index 000000000..e81565fe7 --- /dev/null +++ b/.github/workflows/12-alpine3.10.yml @@ -0,0 +1,24 @@ +name: 12 on alpine3.10 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.10/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.10/Dockerfile + +jobs: + build: + name: 12 on alpine3.10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 alpine3.10 diff --git a/.github/workflows/12-alpine3.11.yml b/.github/workflows/12-alpine3.11.yml new file mode 100644 index 000000000..531a09680 --- /dev/null +++ b/.github/workflows/12-alpine3.11.yml @@ -0,0 +1,24 @@ +name: 12 on alpine3.11 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.11/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.11/Dockerfile + +jobs: + build: + name: 12 on alpine3.11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 alpine3.11 diff --git a/.github/workflows/12-alpine3.12.yml b/.github/workflows/12-alpine3.12.yml new file mode 100644 index 000000000..f18fc554e --- /dev/null +++ b/.github/workflows/12-alpine3.12.yml @@ -0,0 +1,24 @@ +name: 12 on alpine3.12 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.12/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.12/Dockerfile + +jobs: + build: + name: 12 on alpine3.12 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 alpine3.12 diff --git a/.github/workflows/12-alpine3.9.yml b/.github/workflows/12-alpine3.9.yml new file mode 100644 index 000000000..385ff52a2 --- /dev/null +++ b/.github/workflows/12-alpine3.9.yml @@ -0,0 +1,24 @@ +name: 12 on alpine3.9 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.9/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/alpine3.9/Dockerfile + +jobs: + build: + name: 12 on alpine3.9 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 alpine3.9 diff --git a/.github/workflows/12-buster-slim.yml b/.github/workflows/12-buster-slim.yml new file mode 100644 index 000000000..04f8e8b11 --- /dev/null +++ b/.github/workflows/12-buster-slim.yml @@ -0,0 +1,24 @@ +name: 12 on buster-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/buster-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/buster-slim/Dockerfile + +jobs: + build: + name: 12 on buster-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 buster-slim diff --git a/.github/workflows/12-buster.yml b/.github/workflows/12-buster.yml new file mode 100644 index 000000000..0b16ee6a9 --- /dev/null +++ b/.github/workflows/12-buster.yml @@ -0,0 +1,24 @@ +name: 12 on buster + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/buster/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/buster/Dockerfile + +jobs: + build: + name: 12 on buster + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 buster diff --git a/.github/workflows/12-stretch-slim.yml b/.github/workflows/12-stretch-slim.yml new file mode 100644 index 000000000..608160eeb --- /dev/null +++ b/.github/workflows/12-stretch-slim.yml @@ -0,0 +1,24 @@ +name: 12 on stretch-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/stretch-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/stretch-slim/Dockerfile + +jobs: + build: + name: 12 on stretch-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 stretch-slim diff --git a/.github/workflows/12-stretch.yml b/.github/workflows/12-stretch.yml new file mode 100644 index 000000000..8019f3e1f --- /dev/null +++ b/.github/workflows/12-stretch.yml @@ -0,0 +1,24 @@ +name: 12 on stretch + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/stretch/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 12/stretch/Dockerfile + +jobs: + build: + name: 12 on stretch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 12 stretch diff --git a/.github/workflows/14-alpine3.10.yml b/.github/workflows/14-alpine3.10.yml new file mode 100644 index 000000000..e0d04a271 --- /dev/null +++ b/.github/workflows/14-alpine3.10.yml @@ -0,0 +1,24 @@ +name: 14 on alpine3.10 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.10/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.10/Dockerfile + +jobs: + build: + name: 14 on alpine3.10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 alpine3.10 diff --git a/.github/workflows/14-alpine3.11.yml b/.github/workflows/14-alpine3.11.yml new file mode 100644 index 000000000..c401f9389 --- /dev/null +++ b/.github/workflows/14-alpine3.11.yml @@ -0,0 +1,24 @@ +name: 14 on alpine3.11 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.11/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.11/Dockerfile + +jobs: + build: + name: 14 on alpine3.11 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 alpine3.11 diff --git a/.github/workflows/14-alpine3.12.yml b/.github/workflows/14-alpine3.12.yml new file mode 100644 index 000000000..3a20d9520 --- /dev/null +++ b/.github/workflows/14-alpine3.12.yml @@ -0,0 +1,24 @@ +name: 14 on alpine3.12 + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.12/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/alpine3.12/Dockerfile + +jobs: + build: + name: 14 on alpine3.12 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 alpine3.12 diff --git a/.github/workflows/14-buster-slim.yml b/.github/workflows/14-buster-slim.yml new file mode 100644 index 000000000..b7d027f93 --- /dev/null +++ b/.github/workflows/14-buster-slim.yml @@ -0,0 +1,24 @@ +name: 14 on buster-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/buster-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/buster-slim/Dockerfile + +jobs: + build: + name: 14 on buster-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 buster-slim diff --git a/.github/workflows/14-buster.yml b/.github/workflows/14-buster.yml new file mode 100644 index 000000000..4481aadc2 --- /dev/null +++ b/.github/workflows/14-buster.yml @@ -0,0 +1,24 @@ +name: 14 on buster + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/buster/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/buster/Dockerfile + +jobs: + build: + name: 14 on buster + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 buster diff --git a/.github/workflows/14-stretch-slim.yml b/.github/workflows/14-stretch-slim.yml new file mode 100644 index 000000000..d7c68f026 --- /dev/null +++ b/.github/workflows/14-stretch-slim.yml @@ -0,0 +1,24 @@ +name: 14 on stretch-slim + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/stretch-slim/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/stretch-slim/Dockerfile + +jobs: + build: + name: 14 on stretch-slim + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 stretch-slim diff --git a/.github/workflows/14-stretch.yml b/.github/workflows/14-stretch.yml new file mode 100644 index 000000000..dfbfea496 --- /dev/null +++ b/.github/workflows/14-stretch.yml @@ -0,0 +1,24 @@ +name: 14 on stretch + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/stretch/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - 14/stretch/Dockerfile + +jobs: + build: + name: 14 on stretch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh 14 stretch diff --git a/.travis.yml b/.travis.yml index 83ca542b9..31ee9716a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,35 +6,8 @@ dist: xenial language: minimal -services: - - docker - -.before_script: &auto_skip -- | - if [ "false" != "$TRAVIS_PULL_REQUEST" ]; then - TRAVIS_COMMIT_RANGE="$TRAVIS_BRANCH..$TRAVIS_PULL_REQUEST_SHA" - fi - if [ "default" = "$VARIANT" ]; then - Dockerfile="$NODE_VERSION/Dockerfile" - else - Dockerfile="$NODE_VERSION/$VARIANT/Dockerfile" - fi - if [ "" = "$TRAVIS_COMMIT_RANGE" ]; then - echo "This is a new branch" - elif ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- &> /dev/null; then - echo "Change range not recognized: '$TRAVIS_COMMIT_RANGE'" - elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile$"; then - echo "Change of $Dockerfile detected." - else - echo "Skip build of $Dockerfile as it's not changed." - exit - fi - -script: ./test-build.sh $NODE_VERSION $VARIANT - stages: - Test - - Build - name: Deploy if: branch = master AND type IN (push) @@ -64,159 +37,3 @@ jobs: fi script: - ./generate-stackbrew-pr.sh "$TRAVIS_COMMIT_RANGE" - - # Docker Build # - - - stage: Build - before_script: *auto_skip - name: 10 on stretch - env: - - NODE_VERSION="10" - - VARIANT="stretch" - - - stage: Build - before_script: *auto_skip - name: 10 on stretch-slim - env: - - NODE_VERSION="10" - - VARIANT="stretch-slim" - - - stage: Build - before_script: *auto_skip - name: 10 on buster - env: - - NODE_VERSION="10" - - VARIANT="buster" - - - stage: Build - before_script: *auto_skip - name: 10 on buster-slim - env: - - NODE_VERSION="10" - - VARIANT="buster-slim" - - - stage: Build - before_script: *auto_skip - name: 10 on alpine3.9 - env: - - NODE_VERSION="10" - - VARIANT="alpine3.9" - - - stage: Build - before_script: *auto_skip - name: 10 on alpine3.10 - env: - - NODE_VERSION="10" - - VARIANT="alpine3.10" - - - stage: Build - before_script: *auto_skip - name: 10 on alpine3.11 - env: - - NODE_VERSION="10" - - VARIANT="alpine3.11" - - - stage: Build - before_script: *auto_skip - name: 12 on stretch - env: - - NODE_VERSION="12" - - VARIANT="stretch" - - - stage: Build - before_script: *auto_skip - name: 12 on stretch-slim - env: - - NODE_VERSION="12" - - VARIANT="stretch-slim" - - - stage: Build - before_script: *auto_skip - name: 12 on buster - env: - - NODE_VERSION="12" - - VARIANT="buster" - - - stage: Build - before_script: *auto_skip - name: 12 on buster-slim - env: - - NODE_VERSION="12" - - VARIANT="buster-slim" - - - stage: Build - before_script: *auto_skip - name: 12 on alpine3.9 - env: - - NODE_VERSION="12" - - VARIANT="alpine3.9" - - - stage: Build - before_script: *auto_skip - name: 12 on alpine3.10 - env: - - NODE_VERSION="12" - - VARIANT="alpine3.10" - - - stage: Build - before_script: *auto_skip - name: 12 on alpine3.11 - env: - - NODE_VERSION="12" - - VARIANT="alpine3.11" - - - stage: Build - before_script: *auto_skip - name: 12 on alpine3.12 - env: - - NODE_VERSION="12" - - VARIANT="alpine3.12" - - - stage: Build - before_script: *auto_skip - name: 14 on stretch - env: - - NODE_VERSION="14" - - VARIANT="stretch" - - - stage: Build - before_script: *auto_skip - name: 14 on stretch-slim - env: - - NODE_VERSION="14" - - VARIANT="stretch-slim" - - - stage: Build - before_script: *auto_skip - name: 14 on buster - env: - - NODE_VERSION="14" - - VARIANT="buster" - - - stage: Build - before_script: *auto_skip - name: 14 on buster-slim - env: - - NODE_VERSION="14" - - VARIANT="buster-slim" - - - stage: Build - before_script: *auto_skip - name: 14 on alpine3.10 - env: - - NODE_VERSION="14" - - VARIANT="alpine3.10" - - - stage: Build - before_script: *auto_skip - name: 14 on alpine3.11 - env: - - NODE_VERSION="14" - - VARIANT="alpine3.11" - - - stage: Build - before_script: *auto_skip - name: 14 on alpine3.12 - env: - - NODE_VERSION="14" - - VARIANT="alpine3.12" diff --git a/travis.yml.template b/travis.yml.template index 0aa5a08dc..346b2b81f 100644 --- a/travis.yml.template +++ b/travis.yml.template @@ -4,35 +4,8 @@ dist: xenial language: minimal -services: - - docker - -.before_script: &auto_skip -- | - if [ "false" != "$TRAVIS_PULL_REQUEST" ]; then - TRAVIS_COMMIT_RANGE="$TRAVIS_BRANCH..$TRAVIS_PULL_REQUEST_SHA" - fi - if [ "default" = "$VARIANT" ]; then - Dockerfile="$NODE_VERSION/Dockerfile" - else - Dockerfile="$NODE_VERSION/$VARIANT/Dockerfile" - fi - if [ "" = "$TRAVIS_COMMIT_RANGE" ]; then - echo "This is a new branch" - elif ! git diff --name-only "$TRAVIS_COMMIT_RANGE" -- &> /dev/null; then - echo "Change range not recognized: '$TRAVIS_COMMIT_RANGE'" - elif git diff --name-only "$TRAVIS_COMMIT_RANGE" -- | grep -Eq "^$Dockerfile$"; then - echo "Change of $Dockerfile detected." - else - echo "Skip build of $Dockerfile as it's not changed." - exit - fi - -script: ./test-build.sh $NODE_VERSION $VARIANT - stages: - Test - - Build - name: Deploy if: branch = master AND type IN (push) @@ -62,5 +35,3 @@ jobs: fi script: - ./generate-stackbrew-pr.sh "$TRAVIS_COMMIT_RANGE" - - # Docker Build # diff --git a/update.sh b/update.sh index 87f1c863a..8b66a6e55 100755 --- a/update.sh +++ b/update.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + set -ue function usage() { @@ -17,26 +18,26 @@ function usage() { - update.sh 8 buster-slim,buster # Update only buster's slim and buster variants for version 8 - update.sh -s 8 stretch # Update only stretch variant for version 8, skip updating Alpine and Yarn - update.sh . alpine # Update the alpine variant for all versions - - update.sh -t # Update .travis.yml only + - update.sh -b # Update CI files only OPTIONS: -s Security update; skip updating the yarn and alpine versions. - -t Travis CI config update only + -b CI config update only -h Show this message EOF } SKIP=false -TRAVIS_CI_ONLY=false -while getopts "sth" opt; do +CI_ONLY=false +while getopts "sbh" opt; do case "${opt}" in s) SKIP=true shift ;; - t) - TRAVIS_CI_ONLY=true + b) + CI_ONLY=true shift ;; h) @@ -195,25 +196,39 @@ function add_stage() { local variant=${1} shift - echo ' - - stage: Build - before_script: *auto_skip - name: '"${version}"' on '"${variant}"' - env: - - NODE_VERSION="'"${version}"'" - - VARIANT="'"${variant}"'"' >> .travis.yml + echo "name: ${version} on ${variant} + +on: + push: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - ${version}/${variant}/Dockerfile + pull_request: + paths: + - functions.sh + - test-build.sh + - test-image.bats + - ${version}/${variant}/Dockerfile + +jobs: + build: + name: ${version} on ${variant} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install bats + - run: ./test-build.sh ${version} ${variant}" > ".github/workflows/${version}-${variant}.yml" } -echo '# DO NOT MODIFY. THIS FILE IS AUTOGENERATED # -' | cat - travis.yml.template > .travis.yml - for version in "${versions[@]}"; do parentpath=$(dirname "${version}") versionnum=$(basename "${version}") baseuri=$(get_config "${parentpath}" "baseuri") update_version=$(in_versions_to_update "${version}") - [ "${update_version}" -eq 0 ] && [ true != "$TRAVIS_CI_ONLY" ] && info "Updating version ${version}..." + [ "${update_version}" -eq 0 ] && [ true != "$CI_ONLY" ] && info "Updating version ${version}..." # Get supported variants according the target architecture # See details in function.sh @@ -221,7 +236,7 @@ for version in "${versions[@]}"; do if [ -f "${version}/Dockerfile" ]; then add_stage "${baseuri}" "${version}" "default" - [ true = "$TRAVIS_CI_ONLY" ] && continue + [ true = "$CI_ONLY" ] && continue if [ "${update_version}" -eq 0 ]; then update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile.template" "${version}/Dockerfile" & @@ -232,7 +247,7 @@ for version in "${versions[@]}"; do # Skip non-docker directories [ -f "${version}/${variant}/Dockerfile" ] || continue add_stage "${baseuri}" "${version}" "${variant}" - [ true = "$TRAVIS_CI_ONLY" ] && continue + [ true = "$CI_ONLY" ] && continue update_variant=$(in_variants_to_update "${variant}") template_file="${parentpath}/Dockerfile-${variant}.template" From 867a5671453b58325a4a34622e8a707a10d0b7ee Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 7 Jan 2020 02:41:22 -0500 Subject: [PATCH 2/3] chore: Switch pipeline generation test to Actions --- .github/workflows/dockerfiles.yml | 11 +++++++++++ .travis.yml | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/dockerfiles.yml diff --git a/.github/workflows/dockerfiles.yml b/.github/workflows/dockerfiles.yml new file mode 100644 index 000000000..a9da1ab7e --- /dev/null +++ b/.github/workflows/dockerfiles.yml @@ -0,0 +1,11 @@ +name: Check for out of sync YAML pipeline files + +on: [pull_request] + +jobs: + regen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: ./update.sh -t + - run: git diff --color --exit-code diff --git a/.travis.yml b/.travis.yml index 31ee9716a..69242a0f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,20 +7,11 @@ dist: xenial language: minimal stages: - - Test - name: Deploy if: branch = master AND type IN (push) jobs: - fast_finish: true - include: - - stage: Test - name: .travis.yml and travis.yml.template consistency - script: - - ./update.sh -t - - git diff --stat --exit-code .travis.yml - - stage: Deploy before_script: - | From a84ff50223f7df081247c122d8566bf91f036be5 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 20 Feb 2020 00:22:14 -0500 Subject: [PATCH 3/3] fix: Remove -it from BATS testing Interactive shell doesn't seem to work on Actions --- test-image.bats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-image.bats b/test-image.bats index 0ed164867..b424b95a4 100755 --- a/test-image.bats +++ b/test-image.bats @@ -1,17 +1,17 @@ #!/usr/bin/env bats @test "Test for node and version" { - run docker run --rm -it node:"$full_tag" node -e "process.stdout.write(process.versions.node)" + run docker run --rm node:"$full_tag" node -e "process.stdout.write(process.versions.node)" [ "$status" -eq 0 ] [ "$output" == "${full_version}" ] } @test "Test for npm" { - run docker run --rm -it node:"$full_tag" npm --version + run docker run --rm node:"$full_tag" npm --version [ "$status" -eq 0 ] } @test "Test for yarn" { - run docker run --rm -it node:"$full_tag" yarn --version + run docker run --rm node:"$full_tag" yarn --version [ "$status" -eq 0 ] }