Skip to content

Commit 9a9a1c3

Browse files
committed
add test case and manifest for Node.js
1 parent 947c711 commit 9a9a1c3

File tree

4 files changed

+99
-1
lines changed

4 files changed

+99
-1
lines changed

Diff for: Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ARG asciidoctor_revealjs_version=4.1.0
1212
ARG kramdown_asciidoc_version=2.0.0
1313
ARG asciidoctor_bibtex_version=0.8.0
1414
ARG asciidoctor_kroki_version=0.5.0
15+
ARG nodejs_version=16.14.0
1516
ARG asciidoctor_web_pdf_version=1.0.0-alpha.14
1617
ARG asciidoctor_kroki_npm_version=0.15.4
1718

@@ -26,6 +27,7 @@ ENV ASCIIDOCTOR_VERSION=${asciidoctor_version} \
2627
KRAMDOWN_ASCIIDOC_VERSION=${kramdown_asciidoc_version} \
2728
ASCIIDOCTOR_BIBTEX_VERSION=${asciidoctor_bibtex_version} \
2829
ASCIIDOCTOR_KROKI_VERSION=${asciidoctor_kroki_version} \
30+
NODEJS_VERSION=${nodejs_version} \
2931
ASCIIDOCTOR_WEB_PDF_VERSION=${asciidoctor_web_pdf_version} \
3032
ASCIIDOCTOR_KROKI_NPM_VERSION=${asciidoctor_kroki_npm_version}
3133

@@ -105,7 +107,7 @@ RUN apk add --no-cache \
105107
unzip \
106108
which \
107109
font-noto-cjk \
108-
nodejs
110+
nodejs=${NODEJS_VERSION}
109111

110112
# Installing Ruby Gems for additional functionality
111113
RUN apk add --no-cache --virtual .rubymakedepends \

Diff for: README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
:KRAMDOWN_ASCIIDOC_VERSION: 2.0.0
1111
:ASCIIDOCTOR_BIBTEX_VERSION: 0.8.0
1212
:ASCIIDOCTOR_KROKI_VERSION: 0.5.0
13+
:NODEJS_VERSION:16.14.0
1314
:ASCIIDOCTOR_WEB_PDF_VERSION: 1.0.0-alpha.14
1415
ifdef::env-github[]
1516
:tip-caption: :bulb:

Diff for: tests/asciidoctor.bats

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ teardown() {
5555
| grep "${ASCIIDOCTOR_WEB_PDF_VERSION}"
5656
}
5757

58+
@test "Node.js is installed and in version ${NODEJS_VERSION}" {
59+
docker run -t --rm "${DOCKER_IMAGE_NAME_TO_TEST}" node -v \
60+
| grep "${NODEJS_VERSION}"
61+
}
62+
5863
@test "asciidoctor-revealjs is callable without error" {
5964
docker run -t --rm "${DOCKER_IMAGE_NAME_TO_TEST}" asciidoctor-revealjs -v \
6065
| grep "${ASCIIDOCTOR_REVEALJS_VERSION}"

Diff for: updatecli/updatecli.d/nodejs.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: "Bump Node.js version"
3+
4+
scms:
5+
default:
6+
kind: github
7+
spec:
8+
user: "{{ .github.user }}"
9+
email: "{{ .github.email }}"
10+
owner: "{{ requiredEnv .github.owner }}"
11+
repository: "{{ requiredEnv .github.repository }}"
12+
token: "{{ requiredEnv .github.token }}"
13+
username: "{{ .github.username }}"
14+
branch: "{{ .github.branch }}"
15+
16+
sources:
17+
latestVersion:
18+
kind: githubRelease
19+
name: "Get the latest Node.js version"
20+
spec:
21+
owner: "nodejs"
22+
repository: "node"
23+
token: "{{ requiredEnv .github.token }}"
24+
username: "{{ .github.username }}"
25+
versionFilter:
26+
kind: LTS
27+
transformers:
28+
- trimPrefix: "v"
29+
30+
conditions:
31+
testDockerfileArgVersion:
32+
name: "Does the Dockerfile have an ARG instruction which key is nodejs_version?"
33+
kind: dockerfile
34+
spec:
35+
file: Dockerfile
36+
instruction:
37+
keyword: "ARG"
38+
matcher: "nodejs_version"
39+
testVersionInReadme:
40+
name: "Does the README.adoc have a variable NODEJS_VERSION"
41+
kind: file
42+
spec:
43+
file: README.adoc
44+
matchPattern: '(?m:^:NODEJS_VERSION:.*)'
45+
testVersionInTestHarness:
46+
name: "Does the test harness have variable NODEJS_VERSION"
47+
kind: file
48+
spec:
49+
file: tests/asciidoctor.bats
50+
matchPattern: '(?m:^NODEJS_VERSION=.*)'
51+
52+
targets:
53+
updateDockerfile:
54+
name: "Update the value of ARG nodejs_version in the Dockerfile"
55+
kind: dockerfile
56+
spec:
57+
file: Dockerfile
58+
instruction:
59+
keyword: "ARG"
60+
matcher: "nodejs_version"
61+
scmID: default
62+
updateTestHarness:
63+
name: "Update the key NODEJS_VERSION in the test harness"
64+
kind: file
65+
spec:
66+
file: tests/asciidoctor.bats
67+
matchPattern: '(?m:^NODEJS_VERSION=.*)'
68+
content: 'NODEJS_VERSION={{ source `latestVersion` }}'
69+
scmID: default
70+
updateReadme:
71+
name: "Update the key NODEJS_VERSION in the README.adoc file"
72+
kind: file
73+
spec:
74+
file: README.adoc
75+
matchPattern: '(?m:^:NODEJS_VERSION:.*)'
76+
content: ':NODEJS_VERSION: {{ source `latestVersion` }}'
77+
scmID: default
78+
79+
pullrequests:
80+
default:
81+
kind: github
82+
scmID: default
83+
targets:
84+
- updateDockerfile
85+
- updateTestHarness
86+
- updateReadme
87+
spec:
88+
labels:
89+
- chore
90+
- dependencies

0 commit comments

Comments
 (0)