Skip to content

Commit a91c682

Browse files
Clarity-89joanlopezaangelisc
authored
Chore: Upgrade to Node 18 (#448)
* Update dependencies * Update docker iamges * Use the latest CI image * Sign & lint .drone.yml * Add .nvmrc * Update plugin-ci image * Update drone * update node version * Fix security scanning step * Install zip in package step --------- Co-authored-by: Joan López de la Franca Beltran <[email protected]> Co-authored-by: Andreas Christou <[email protected]>
1 parent 434277f commit a91c682

File tree

11 files changed

+526
-454
lines changed

11 files changed

+526
-454
lines changed

.drone.yml

Lines changed: 209 additions & 230 deletions
Large diffs are not rendered by default.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.13.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine AS base
1+
FROM node:18-alpine AS base
22

33
ENV CHROME_BIN="/usr/bin/chromium-browser"
44
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

debian.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-slim AS base
1+
FROM node:18-slim AS base
22

33
ENV CHROME_BIN="/usr/bin/google-chrome-stable"
44
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"winston": "^3.8.2"
4545
},
4646
"devDependencies": {
47-
"@grafana/eslint-config": "5.0.0",
47+
"@grafana/eslint-config": "^6.0.0",
4848
"@types/dompurify": "2.3.4",
4949
"@types/express": "^4.17.14",
5050
"@types/jsdom": "20.0.0",
@@ -56,7 +56,7 @@
5656
"cross-env": "7.0.3",
5757
"eslint": "8.23.1",
5858
"eslint-config-prettier": "8.5.0",
59-
"eslint-plugin-jsdoc": "39.3.6",
59+
"eslint-plugin-jsdoc": "^46.5.0",
6060
"eslint-plugin-prettier": "4.2.1",
6161
"eslint-plugin-react": "7.31.8",
6262
"eslint-plugin-react-hooks": "4.6.0",
@@ -81,6 +81,6 @@
8181
},
8282
"bin": "build/app.js",
8383
"engines": {
84-
"node": ">= 16"
84+
"node": ">= 18"
8585
}
8686
}

scripts/archive_target.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ fi
99

1010
OUT="${2:-plugin-${ARCH}}"
1111

12+
apt-get update && apt-get install zip -y
1213
mkdir -p artifacts
13-
(cd dist && zip -yqr ../artifacts/${OUT}.zip ${OUT})
14+
(cd dist && zip -yqr ../artifacts/${OUT}.zip ${OUT})

scripts/drone/common.star

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
load('scripts/drone/utils.star', 'ci_image')
2-
load('scripts/drone/grabpl.star', 'download_grabpl_step')
3-
load('scripts/drone/promotion.star', 'publish_to_docker')
4-
load('scripts/drone/utils.star', 'pipeline')
52
load('scripts/drone/vault.star', 'from_secret')
63

74
def install_deps_step():
85
return {
96
'name': 'yarn-install',
107
'image': ci_image,
118
'commands': [
9+
'. ~/.init-nvm.sh',
1210
'yarn install --frozen-lockfile --no-progress',
1311
],
1412
'depends_on': [
@@ -21,6 +19,7 @@ def build_step():
2119
'name': 'yarn-build',
2220
'image': ci_image,
2321
'commands': [
22+
'. ~/.init-nvm.sh',
2423
'yarn build',
2524
],
2625
'depends_on': [
@@ -50,6 +49,7 @@ def package_step(arch, name='', skip_chromium=False, override_output='', skip_er
5049
'name': name,
5150
'image': ci_image,
5251
'commands': [
52+
'. ~/.init-nvm.sh',
5353
pkg_cmd,
5454
bpm_cmd,
5555
arc_cmd,
@@ -67,8 +67,8 @@ def security_scan_step():
6767
'name': 'security-scan',
6868
'image': ci_image,
6969
'commands': [
70+
'. ~/.init-nvm.sh',
7071
'echo "Starting veracode scan..."',
71-
'apk add curl',
7272
'# Increase heap size or the scanner will die.',
7373
'export _JAVA_OPTIONS=-Xmx4g',
7474
'mkdir -p ci/jobs/security_scan',

scripts/drone/promotion.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load('scripts/drone/utils.star', 'docker_image', 'ci_image', 'publisher_image')
1+
load('scripts/drone/utils.star', 'docker_image', 'ci_image')
22
load('scripts/drone/vault.star', 'from_secret')
33

44
def publish_gh_release():
@@ -49,6 +49,7 @@ def publish_to_gcom():
4949
'name': 'publish_to_gcom',
5050
'image': ci_image,
5151
'commands': [
52+
'. ~/.init-nvm.sh',
5253
'yarn run create-gcom-plugin-json ${DRONE_COMMIT}',
5354
'sh scripts/push-to-gcom.sh',
5455
],

scripts/drone/utils.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load('scripts/drone/vault.star', 'pull_secret')
22

3-
ci_image = 'grafana/grafana-plugin-ci:1.6.1-alpine'
3+
ci_image = 'grafana/grafana-plugin-ci:1.9.0'
44
docker_image = 'grafana/grafana-image-renderer'
55
publisher_image = 'grafana/integration-grafana-publisher:v9'
66

scripts/pkg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ if(platform === 'macos' && (arch.includes('arm'))) {
3131
const outputPath = "dist/" + (process.argv[3] || `plugin-${archArg}`);
3232
const outputNodeModules = `${outputPath}/node_modules`
3333

34-
childProcess.execSync(`"./node_modules/.bin/pkg" -t node16-${platform}-${arch} . --out-path ${outputPath} --no-native-build`, {stdio: 'inherit'});
34+
childProcess.execSync(`"./node_modules/.bin/pkg" -t node18-${platform}-${arch} . --out-path ${outputPath} --no-native-build`, {stdio: 'inherit'});
3535

3636
childProcess.execSync(`rm -rf ${outputNodeModules}`)

0 commit comments

Comments
 (0)