Upgrade to node 16 (#390)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Base image
|
||||
FROM node:15-buster-slim
|
||||
FROM node:16-buster-slim
|
||||
|
||||
# Copy repository
|
||||
COPY . /metrics
|
||||
|
||||
7737
package-lock.json
generated
7737
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -75,7 +75,7 @@ export default async function({log = true, nosettings = false, community = {}} =
|
||||
if ((Array.isArray(conf.settings.community.templates)) && (conf.settings.community.templates.length)) {
|
||||
//Clean remote repository
|
||||
logger(`metrics/setup > ${conf.settings.community.templates.length} community templates to install`)
|
||||
await fs.promises.rmdir(path.join(__templates, ".community"), {recursive:true})
|
||||
await fs.promises.rm(path.join(__templates, ".community"), {recursive:true, force:true})
|
||||
//Download community templates
|
||||
for (const template of conf.settings.community.templates) {
|
||||
try {
|
||||
@@ -88,7 +88,7 @@ export default async function({log = true, nosettings = false, community = {}} =
|
||||
processes.execSync(command, {stdio:"ignore"})
|
||||
//Extract template
|
||||
logger(`metrics/setup > extract ${name} from ${repo}@${branch}`)
|
||||
await fs.promises.rmdir(path.join(__templates, `@${name}`), {recursive:true})
|
||||
await fs.promises.rm(path.join(__templates, `@${name}`), {recursive:true, force:true})
|
||||
await fs.promises.rename(path.join(__templates, ".community/source/templates", name), path.join(__templates, `@${name}`))
|
||||
//JavaScript file
|
||||
if (trust)
|
||||
@@ -114,7 +114,7 @@ export default async function({log = true, nosettings = false, community = {}} =
|
||||
|
||||
//Clean remote repository
|
||||
logger(`metrics/setup > clean ${repo}@${branch}`)
|
||||
await fs.promises.rmdir(path.join(__templates, ".community"), {recursive:true})
|
||||
await fs.promises.rm(path.join(__templates, ".community"), {recursive:true, force:true})
|
||||
logger(`metrics/setup > loaded community template ${name}`)
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -24,7 +24,7 @@ export async function indepth({login, data, imports, repositories}, {skipped}) {
|
||||
//Process
|
||||
try {
|
||||
//Git clone into temporary directory
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
await imports.fs.mkdir(path, {recursive:true})
|
||||
const git = await imports.git(path)
|
||||
await git.clone(`https://github.com/${repo}`, ".").status()
|
||||
@@ -38,7 +38,7 @@ export async function indepth({login, data, imports, repositories}, {skipped}) {
|
||||
finally {
|
||||
//Cleaning
|
||||
console.debug(`metrics/compute/${login}/plugins > languages > indepth > cleaning temp dir ${path}`)
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
}
|
||||
}
|
||||
return results
|
||||
@@ -94,7 +94,7 @@ export async function recent({login, data, imports, rest, account}, {skipped = [
|
||||
//Process
|
||||
try {
|
||||
//Save patches in temporary directory matching respective repository and filename
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
await imports.fs.mkdir(path, {recursive:true})
|
||||
await Promise.all(patches.map(async ({name, directory, patch}) => {
|
||||
await imports.fs.mkdir(imports.paths.join(path, directory), {recursive:true})
|
||||
@@ -134,7 +134,7 @@ export async function recent({login, data, imports, rest, account}, {skipped = [
|
||||
finally {
|
||||
//Cleaning
|
||||
console.debug(`metrics/compute/${login}/plugins > languages > cleaning temp dir ${path}`)
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
|
||||
const path = imports.paths.join(imports.os.tmpdir(), `${repository.databaseId}`)
|
||||
//Create temporary directory
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > creating temp dir ${path}`)
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
await imports.fs.mkdir(path, {recursive:true})
|
||||
//Clone repository
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > cloning temp git repository ${repository.url} to ${path}`)
|
||||
@@ -67,7 +67,7 @@ export default async function({login, q, imports, data, graphql, queries, accoun
|
||||
)
|
||||
//Cleaning
|
||||
console.debug(`metrics/compute/${login}/plugins > licensed > cleaning temp dir ${path}`)
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
await imports.fs.rm(path, {recursive:true, force:true})
|
||||
}
|
||||
else
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > licensed not available`)
|
||||
|
||||
@@ -70,7 +70,7 @@ placeholder.run = async vars => {
|
||||
//Setup
|
||||
beforeAll(async () => {
|
||||
//Clean community template
|
||||
await fs.promises.rmdir(path.join(__dirname, "../source/templates/@classic"), { recursive: true })
|
||||
await fs.promises.rm(path.join(__dirname, "../source/templates/@classic"), { recursive: true, force:true })
|
||||
//Start web instance
|
||||
await web.start()
|
||||
})
|
||||
@@ -79,7 +79,7 @@ afterAll(async () => {
|
||||
//Stop web instance
|
||||
await web.stop()
|
||||
//Clean community template
|
||||
await fs.promises.rmdir(path.join(__dirname, "../source/templates/@classic"), { recursive: true })
|
||||
await fs.promises.rm(path.join(__dirname, "../source/templates/@classic"), { recursive: true, force:true })
|
||||
})
|
||||
|
||||
//Load metadata (as jest doesn't support ESM modules, we use this dirty hack)
|
||||
|
||||
Reference in New Issue
Block a user