diff --git a/Makefile b/Makefile index 03fb9c59..61d23035 100644 --- a/Makefile +++ b/Makefile @@ -51,9 +51,7 @@ list: check-reqs @set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add' bats: - git clone https://github.com/bats-core/bats-core bats ;\ - cd bats ;\ - git checkout v1.7.0 + git clone --branch v1.10.0 https://github.com/bats-core/bats-core bats prepare-test: bats check-reqs git submodule update --init --recursive @@ -79,10 +77,7 @@ test-%: prepare-test @make --silent build-$* # Execute the test harness and write result to a TAP file set -x - IMAGE=$* bats/bin/bats $(bats_flags) | tee target/results-$*.tap -# convert TAP to JUNIT - docker run --rm -v "$(CURDIR)":/usr/src/app -w /usr/src/app node:21.1.0-alpine3.18 \ - sh -c "npm install -g npm@10.2.3 && npm install tap-xunit -g && cat target/results-$*.tap | tap-xunit --package='jenkinsci.docker.$*' > target/junit-results-$*.xml" + IMAGE=$* bats/bin/bats --formatter junit $(bats_flags) | tee target/junit-results-$*.xml test: prepare-test @make --silent list | while read image; do make --silent "test-$${image}"; done diff --git a/updatecli/updatecli.d/node.yaml b/updatecli/updatecli.d/node.yaml deleted file mode 100644 index a5dd4dde..00000000 --- a/updatecli/updatecli.d/node.yaml +++ /dev/null @@ -1,80 +0,0 @@ ---- -name: Bumps the node docker images version - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - -sources: - nodeLatestVersion: - kind: githubrelease - spec: - owner: "nodejs" - repository: "node" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - transformers: - - trimprefix: "v" - alpineLatestVersion: - kind: githubrelease - name: "Get the latest Alpine Linux version" - spec: - owner: "alpinelinux" - repository: "aports" # Its release process follows Alpine's - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: semver - pattern: "~3" - transformers: - - findsubmatch: - pattern: >- - v(.*)(\.\d+) - captureindex: 1 - -conditions: - testNodeArg: - name: "Does the Makefile have a reference to the Node alpine image?" - kind: file - disablesourceinput: true - spec: - file: Makefile - matchpattern: >- - .*docker.*run.*node:.* - testNodeAlpineImagePublished: - name: "Test node:-alpine docker image tag" - kind: dockerimage - disablesourceinput: true - spec: - image: "node" - tag: '{{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }}' - -targets: - updateMakefile: - name: "Updates the value of the node docker image in the Makefile" - kind: file - sourceid: nodeLatestVersion - spec: - file: Makefile - matchpattern: >- - (.*docker.*run.*)node:.*( .*) - replacepattern: >- - ${1}node:{{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }}${2} - scmid: default - -actions: - default: - kind: github/pullrequest - scmid: default - title: Bump node alpine docker image version to {{ source "nodeLatestVersion" }}-alpine{{ source "alpineLatestVersion" }} - spec: - labels: - - chore # Because Node is only used for testing diff --git a/updatecli/updatecli.d/npm.yaml b/updatecli/updatecli.d/npm.yaml deleted file mode 100644 index 4c8533ca..00000000 --- a/updatecli/updatecli.d/npm.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: Bumps the npm version - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - -sources: - npmLatestVersion: - kind: githubrelease - spec: - owner: "npm" - repository: "cli" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: regex - pattern: >- - ^v\d+\.\d+.\d+$ - transformers: - - trimprefix: "v" - -conditions: - testNodeArg: - name: "Does the Makefile have a reference to npm?" - kind: file - disablesourceinput: true - spec: - file: Makefile - matchpattern: >- - .*npm.* install.*-g.*npm@.*.*npm.*install.* - -targets: - updateMakefile: - name: "Updates the value of the npm version in the Makefile" - kind: file - sourceid: npmLatestVersion - spec: - file: Makefile - matchpattern: >- - (.*sh -c "npm install -g npm@)(.*)( && npm install)(.*) - replacepattern: >- - ${1}{{ source "npmLatestVersion" }}${3}${{4}} - scmid: default - -actions: - default: - kind: github/pullrequest - scmid: default - title: 'chore(tests): Bump NPM version to {{ source "npmLatestVersion" }}' - spec: - labels: - - chore # Because NPM is only used for testing