Skip to content

Commit

Permalink
feat: add NodeJS to windows and track its version (#864)
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal authored Oct 20, 2023
1 parent b0c3e37 commit 9d88b96
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions provisioning/windows-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ $downloads = [ordered]@{
& "choco.exe" install datadog-agent --yes --no-progress --limit-output --fail-on-error-output;
& "choco.exe" install vcredist2015 --yes --no-progress --limit-output --fail-on-error-output;
& "choco.exe" install trivy --yes --no-progress --limit-output --fail-on-error-output --version "${env:TRIVY_VERSION}";
& "choco.exe" install nodejs.install --yes --no-progress --limit-output --fail-on-error-output --version "${env:NODEJS_VERSION}";
# Installation of python3 for Launchable
& "choco.exe" install python3 --yes --no-progress --limit-output --fail-on-error-output --version "${env:PYTHON3_VERSION}";
# Installation of Launchable globally (no other python tool)
Expand Down
61 changes: 61 additions & 0 deletions updatecli/updatecli.d/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Bump NodeJS 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:
lastReleaseVersion:
kind: githubrelease
name: Get the latest NodeJS version
spec:
owner: nodejs
repository: node
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
pattern: v18.(\d*).(\d*)
transformers:
- trimprefix: v

conditions:
checkForPackage:
kind: shell
disablesourceinput: true # Do not pass source as argument to the command line
spec:
command: curl --fail --silent --show-error --location --head https://nodejs.org/dist/v{{ source "lastReleaseVersion" }}/node-v{{ source "lastReleaseVersion" }}.tar.gz
checkForChocolateyPackage:
kind: shell
disablesourceinput: true # Do not pass source as argument to the command line
spec:
command: curl --silent --show-error --location --fail --output /dev/null https://community.chocolatey.org/packages/nodejs.install/{{ source "lastReleaseVersion" }}

targets:
updateVersion:
name: Update the NodeJS version in provisioning environment
sourceid: lastReleaseVersion
kind: yaml
spec:
file: provisioning/tools-versions.yml
key: nodejs_version
scmid: default

actions:
default:
kind: github/pullrequest
title: Bump NodeJS version to {{ source "lastReleaseVersion" }}
scmid: default
spec:
labels:
- enhancement
- nodejs

0 comments on commit 9d88b96

Please sign in to comment.