Skip to content

Commit

Permalink
fix: update openwhisk standalone config for new node-20 runtime and t…
Browse files Browse the repository at this point in the history
…ags (#741)
  • Loading branch information
shazron committed Nov 1, 2023
1 parent 2d9e9f5 commit 8863c0c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 31 deletions.
54 changes: 28 additions & 26 deletions bin/openwhisk-standalone-config/get-runtimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,39 @@ const DOCKER_REPOS = { // repo-name:kind
'adobe-action-nodejs-v12': 'nodejs:12',
'adobe-action-nodejs-v14': 'nodejs:14',
'adobe-action-nodejs-v16': 'nodejs:16',
'adobe-action-nodejs-v18': 'nodejs:18'
'adobe-action-nodejs-v18': 'nodejs:18',
'adobe-action-nodejs-v20': 'nodejs:20'
}

const DEFAULT_KIND = 'nodejs:18'

async function main() {
const nodejs = []

for ([repoName, kind] of Object.entries(DOCKER_REPOS)) {
const data = await fetch(`https://registry.hub.docker.com/v2/repositories/${DOCKER_ORG}/${repoName}/tags`)
const json = await data.json()
const defaultKind = (kind === DEFAULT_KIND)? true : undefined

nodejs.push({
kind,
default: defaultKind,
image: {
prefix: DOCKER_ORG,
name: repoName,
tag: json.results[0].name
}
})
}

const output = {
runtimes: {
nodejs
/** @private */
async function main () {
const nodejs = []

for (const [repoName, kind] of Object.entries(DOCKER_REPOS)) {
const data = await fetch(`https://registry.hub.docker.com/v2/repositories/${DOCKER_ORG}/${repoName}/tags`)
const json = await data.json()
const defaultKind = (kind === DEFAULT_KIND) ? true : undefined

nodejs.push({
kind,
default: defaultKind,
image: {
prefix: DOCKER_ORG,
name: repoName,
tag: json.results[0].name
}
})
}

const output = {
runtimes: {
nodejs
}
console.log(JSON.stringify(output, null, 2))
}
console.log(JSON.stringify(output, null, 2))
}

main()

main()
.catch(console.error)
18 changes: 13 additions & 5 deletions bin/openwhisk-standalone-config/runtimes.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v10",
"tag": "3.0.37"
"tag": "3.0.39"
}
},
{
"kind": "nodejs:12",
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v12",
"tag": "3.0.37"
"tag": "3.0.39"
}
},
{
"kind": "nodejs:14",
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v14",
"tag": "3.0.37"
"tag": "3.0.39"
}
},
{
"kind": "nodejs:16",
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v16",
"tag": "3.0.37"
"tag": "3.0.39"
}
},
{
Expand All @@ -39,7 +39,15 @@
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v18",
"tag": "3.0.37"
"tag": "3.0.39"
}
},
{
"kind": "nodejs:20",
"image": {
"prefix": "adobeapiplatform",
"name": "adobe-action-nodejs-v20",
"tag": "3.0.39"
}
}
]
Expand Down

0 comments on commit 8863c0c

Please sign in to comment.