Skip to content

Commit e062450

Browse files
authored
Merge pull request #2479 from nschonni/eslint-cleanup
chore: typos and ESLint items
2 parents 36ab1db + d1dbe6e commit e062450

3 files changed

Lines changed: 27 additions & 31 deletions

File tree

functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Utlity functions
3+
# Utility functions
44
# Don't change this file unless needed
55
# The GitHub Action for automating new builds rely on this file
66

@@ -19,7 +19,7 @@ fatal() {
1919
#
2020
# This is used to get the target architecture for docker image.
2121
# For crossing building, we need a way to specify the target
22-
# architecutre manually.
22+
# architecture manually.
2323
function get_arch() {
2424
local arch
2525
case $(uname -m) in

genMatrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ const getChildDirectories = (parent) => fs.readdirSync(parent, { withFileTypes:
1717
.filter((dirent) => dirent.isDirectory())
1818
.map(({ name }) => path.resolve(parent, name));
1919

20-
const getNodeVerionDirs = (base) => getChildDirectories(base)
20+
const getNodeVersionDirs = (base) => getChildDirectories(base)
2121
.filter((childPath) => nodeDirRegex.test(path.basename(childPath)));
2222

2323
// Returns the paths of Dockerfiles that are at: base/*/Dockerfile
2424
const getDockerfilesInChildDirs = (base) => getChildDirectories(base)
2525
.map((childDir) => path.resolve(childDir, 'Dockerfile'));
2626

27-
const getAllDockerfiles = (base) => getNodeVerionDirs(base).flatMap(getDockerfilesInChildDirs);
27+
const getAllDockerfiles = (base) => getNodeVersionDirs(base).flatMap(getDockerfilesInChildDirs);
2828

2929
const getAffectedDockerfiles = (filesAdded, filesModified, filesRenamed) => {
3030
const files = [

stackbrew.js

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ const versions = Object.keys(config).reverse()
2828
let midnight = new Date()
2929
midnight.setHours(0, 0, 0, 0)
3030
const now = midnight.getTime()
31-
const aplineRE = new RegExp(/alpine*/);
31+
const alpineRE = new RegExp(/alpine*/);
3232
const slimRE = new RegExp(/\*-slim/);
3333
let foundLTS = false;
3434
let foundCurrent = false;
3535

36-
for (version of versions) {
36+
for (const version of versions) {
3737
let lts = new Date(`${config[version].lts}T00:00:00.00`).getTime();
38-
let maintenance = new Date(`${config[version].maintenance}T00:00:00.00`).getTime();
3938
let isCurrent = foundCurrent ? false : isNaN(lts) || lts >= now;
4039
foundCurrent = isCurrent || foundCurrent;
4140
let isLTS = foundLTS ? false : (now >= lts);
@@ -44,53 +43,52 @@ for (version of versions) {
4443
let defaultAlpine = config[version]['alpine-default']
4544
let defaultDebian = config[version]['debian-default']
4645
let variants = config[version].variants
47-
let fullversion;
48-
for (variant in variants) {
46+
for (const variant in variants) {
4947
let dockerfilePath = path.join(version, variant, 'Dockerfile');
50-
let isAlpine = aplineRE.test(variant)
48+
let isAlpine = alpineRE.test(variant)
5149
let isSlim = slimRE.test(variant)
5250
let isDefaultSlim = new RegExp(`${defaultDebian}-slim`).test(variant)
5351

5452
// Get full version from the Dockerfile
5553
let dockerfile = fs.readFileSync(dockerfilePath, 'utf-8')
56-
fullversion = dockerfile.match(/ENV NODE_VERSION=(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/)
54+
let fullVersion = dockerfile.match(/ENV NODE_VERSION=(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/)
5755

5856
let tags = [
59-
`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}-${variant}`,
60-
`${fullversion.groups.major}.${fullversion.groups.minor}-${variant}`,
61-
`${fullversion.groups.major}-${variant}`,
57+
`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}-${variant}`,
58+
`${fullVersion.groups.major}.${fullVersion.groups.minor}-${variant}`,
59+
`${fullVersion.groups.major}-${variant}`,
6260
]
6361

6462
if (codename) {
6563
tags.push(`${codename}-${variant}`)
6664
}
6765

6866
if (variant === defaultAlpine) {
69-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}-alpine`)
70-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}-alpine`)
71-
tags.push(`${fullversion.groups.major}-alpine`)
67+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}-alpine`)
68+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}-alpine`)
69+
tags.push(`${fullVersion.groups.major}-alpine`)
7270
if (codename) {
7371
tags.push(`${codename}-alpine`)
7472
}
7573
}
7674

7775
if (variant === defaultDebian) {
78-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}`)
79-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}`)
80-
tags.push(`${fullversion.groups.major}`)
76+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}`)
77+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}`)
78+
tags.push(`${fullVersion.groups.major}`)
8179
if (isSlim) {
82-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}-slim`)
83-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}-slim`)
84-
tags.push(`${fullversion.groups.major}-slim`)
80+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}-slim`)
81+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}-slim`)
82+
tags.push(`${fullVersion.groups.major}-slim`)
8583
}
8684
if (codename) {
8785
tags.push(`${codename}`)
8886
}
8987
}
9088
if (isDefaultSlim) {
91-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}-slim`)
92-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}-slim`)
93-
tags.push(`${fullversion.groups.major}-slim`)
89+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}-slim`)
90+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}-slim`)
91+
tags.push(`${fullVersion.groups.major}-slim`)
9492
if (codename) {
9593
tags.push(`${codename}-slim`)
9694
}
@@ -99,9 +97,9 @@ for (version of versions) {
9997
if (isCurrent) {
10098
if (variant === defaultAlpine) {
10199
tags.push(variant)
102-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}.${fullversion.groups.patch}-alpine`)
103-
tags.push(`${fullversion.groups.major}.${fullversion.groups.minor}-alpine`)
104-
tags.push(`${fullversion.groups.major}-alpine`)
100+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}.${fullVersion.groups.patch}-alpine`)
101+
tags.push(`${fullVersion.groups.major}.${fullVersion.groups.minor}-alpine`)
102+
tags.push(`${fullVersion.groups.major}-alpine`)
105103
tags.push('alpine')
106104
tags.push('current-alpine')
107105
}
@@ -126,8 +124,6 @@ for (version of versions) {
126124

127125
if (isLTS) {
128126
tags.push(`lts-${variant}`)
129-
if (variant === defaultAlpine) {
130-
}
131127
if (variant === defaultDebian) {
132128
tags.push('lts')
133129
if (codename) {

0 commit comments

Comments
 (0)