Skip to content

Commit b75747b

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

File tree

5 files changed

+102
-2
lines changed

5 files changed

+102
-2
lines changed

Diff for: Dockerfile

+2
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-r0
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

Diff for: README.adoc

+2-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:
@@ -42,7 +43,7 @@ This Docker image provides:
4243
* https://github.com/asciidoctor/asciidoctor-confluence[Asciidoctor Confluence] {ASCIIDOCTOR_CONFLUENCE_VERSION}
4344
* https://github.com/asciidoctor/asciidoctor-bibtex[Asciidoctor Bibtex] {ASCIIDOCTOR_BIBTEX_VERSION}
4445
* https://github.com/Mogztter/asciidoctor-kroki[Asciidoctor Kroki] {ASCIIDOCTOR_KROKI_VERSION}
45-
* https://github.com/Mogztter/asciidoctor-web-pdf[Asciidoctor Web PDF] {ASCIIDOCTOR_WEB_PDF_VERSION}
46+
* https://github.com/Mogztter/asciidoctor-web-pdf[Asciidoctor Web PDF] {ASCIIDOCTOR_WEB_PDF_VERSION} -- This is an unofficial project.
4647

4748

4849
This image uses Alpine Linux {ALPINE_VERSION} as base image.

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This Docker image provides:
2828

2929
- [Asciidoctor Kroki](https://github.com/Mogztter/asciidoctor-kroki) 0.5.0
3030

31-
- [Asciidoctor Web PDF](https://github.com/Mogztter/asciidoctor-web-pdf) 1.0.0-alpha.14
31+
- [Asciidoctor Web PDF](https://github.com/Mogztter/asciidoctor-web-pdf) 1.0.0-alpha.14 -- This is an unofficial project.
3232

3333
This image uses Alpine Linux 3.13.5 as base image.
3434

Diff for: tests/asciidoctor.bats

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ASCIIDOCTOR_REVEALJS_VERSION=4.1.0
1313
KRAMDOWN_ASCIIDOC_VERSION=2.0.0
1414
ASCIIDOCTOR_BIBTEX_VERSION=0.8.0
1515
ASCIIDOCTOR_KROKI_VERSION=0.5.0
16+
NODEJS_VERSION=16.14.0
1617
ASCIIDOCTOR_WEB_PDF_VERSION=1.0.0-alpha.14
1718
DOCKER_IMAGE_NAME_TO_TEST="${IMAGE_NAME:-asciidoctor}"
1819

@@ -55,6 +56,11 @@ teardown() {
5556
| grep "${ASCIIDOCTOR_WEB_PDF_VERSION}"
5657
}
5758

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

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

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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: regex
27+
pattern: '*LTS*'
28+
transformers:
29+
- trimPrefix: "v"
30+
31+
conditions:
32+
testDockerfileArgVersion:
33+
name: "Does the Dockerfile have an ARG instruction which key is nodejs_version?"
34+
kind: dockerfile
35+
spec:
36+
file: Dockerfile
37+
instruction:
38+
keyword: "ARG"
39+
matcher: "nodejs_version"
40+
testVersionInReadme:
41+
name: "Does the README.adoc have a variable NODEJS_VERSION"
42+
kind: file
43+
spec:
44+
file: README.adoc
45+
matchPattern: '(?m:^:NODEJS_VERSION:.*)'
46+
testVersionInTestHarness:
47+
name: "Does the test harness have variable NODEJS_VERSION"
48+
kind: file
49+
spec:
50+
file: tests/asciidoctor.bats
51+
matchPattern: '(?m:^NODEJS_VERSION=.*)'
52+
53+
targets:
54+
updateDockerfile:
55+
name: "Update the value of ARG nodejs_version in the Dockerfile"
56+
kind: dockerfile
57+
spec:
58+
file: Dockerfile
59+
instruction:
60+
keyword: "ARG"
61+
matcher: "nodejs_version"
62+
scmID: default
63+
updateTestHarness:
64+
name: "Update the key NODEJS_VERSION in the test harness"
65+
kind: file
66+
spec:
67+
file: tests/asciidoctor.bats
68+
matchPattern: '(?m:^NODEJS_VERSION=.*)'
69+
content: 'NODEJS_VERSION={{ source `latestVersion` }}'
70+
scmID: default
71+
updateReadme:
72+
name: "Update the key NODEJS_VERSION in the README.adoc file"
73+
kind: file
74+
spec:
75+
file: README.adoc
76+
matchPattern: '(?m:^:NODEJS_VERSION:.*)'
77+
content: ':NODEJS_VERSION: {{ source `latestVersion` }}'
78+
scmID: default
79+
80+
pullrequests:
81+
default:
82+
kind: github
83+
scmID: default
84+
targets:
85+
- updateDockerfile
86+
- updateTestHarness
87+
- updateReadme
88+
spec:
89+
labels:
90+
- chore
91+
- dependencies

0 commit comments

Comments
 (0)