Merge pull request #40913 from nextcloud/dependabot/npm_and_yarn/dockerode-4.0.0

chore(deps-dev): Bump dockerode from 3.3.5 to 4.0.0
pull/40965/head
Ferdinand Thiessen 2023-10-18 14:37:57 +07:00 committed by GitHub
commit e9d8095006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 38 deletions

@ -41,28 +41,38 @@ const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server'
export const startNextcloud = async function(branch: string = getCurrentGitBranch()): Promise<any> {
try {
// Pulling images
console.log('\nPulling images... ⏳')
await new Promise((resolve, reject): any => docker.pull(SERVER_IMAGE, (err, stream) => {
if (err) {
reject(err)
}
// https://github.com/apocas/dockerode/issues/357
docker.modem.followProgress(stream, onFinished)
/**
*
* @param err
*/
function onFinished(err) {
if (!err) {
resolve(true)
try {
// Pulling images
console.log('\nPulling images... ⏳')
await new Promise((resolve, reject): any => docker.pull(SERVER_IMAGE, (err, stream) => {
if (err) {
reject(err)
}
if (stream === null) {
reject(new Error('Could not connect to docker, ensure docker is running.'))
return
}
reject(err)
}
}))
console.log('└─ Done')
// https://github.com/apocas/dockerode/issues/357
docker.modem.followProgress(stream, onFinished)
/**
*
* @param err
*/
function onFinished(err) {
if (!err) {
resolve(true)
return
}
reject(err)
}
}))
console.log('└─ Done')
} catch (e) {
console.log('└─ Failed to pull images')
throw e
}
// Remove old container if exists
console.log('\nChecking running containers... 🔍')
@ -102,7 +112,7 @@ export const startNextcloud = async function(branch: string = getCurrentGitBranc
return ip
} catch (err) {
console.log('└─ Unable to start the container 🛑')
console.log(err)
console.log('\n', err, '\n')
stopNextcloud()
throw new Error('Unable to start the container')
}
@ -191,7 +201,7 @@ export const stopNextcloud = async function() {
* @param {Docker.Container} container the container to get the IP from
*/
export const getContainerIP = async function(
container = docker.getContainer(CONTAINER_NAME)
container = docker.getContainer(CONTAINER_NAME),
): Promise<string> {
let ip = ''
let tries = 0
@ -230,7 +240,7 @@ const runExec = async function(
container: Docker.Container,
command: string[],
verbose = false,
user = 'www-data'
user = 'www-data',
) {
const exec = await container.exec({
Cmd: command,

28
package-lock.json generated

@ -115,7 +115,7 @@
"css-loader": "^6.8.1",
"cypress": "^13.3.0",
"cypress-wait-until": "^2.0.1",
"dockerode": "^3.3.5",
"dockerode": "^4.0.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-es": "^4.1.0",
"exports-loader": "^4.0.0",
@ -9341,9 +9341,9 @@
}
},
"node_modules/cpu-features": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.8.tgz",
"integrity": "sha512-BbHBvtYhUhksqTjr6bhNOjGgMnhwhGTQmOoZGD+K7BCaQDCuZl/Ve1ZxUSMRwVC4D/rkCPQ2MAIeYzrWyK7eEg==",
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.9.tgz",
"integrity": "sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ==",
"dev": true,
"hasInstallScript": true,
"optional": true,
@ -10564,9 +10564,9 @@
}
},
"node_modules/docker-modem": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-3.0.8.tgz",
"integrity": "sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.0.tgz",
"integrity": "sha512-J1gOocUHrYOI0u5+SbM9eg84igD40NfUJoWL9Hc2a6hF3oN6PFA9fmzu2Ai8fddXrVUJbENx5STOlcvhTau4rA==",
"dev": true,
"dependencies": {
"debug": "^4.1.1",
@ -10579,13 +10579,13 @@
}
},
"node_modules/dockerode": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-3.3.5.tgz",
"integrity": "sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.0.tgz",
"integrity": "sha512-3LF7/3MPz5+9RsUo91rD0MCcx0yxjC9bnbtgtVjOLKyKxlZSJ7/Kk3OPAgARlwlWHqXwAGYhmkAHYx7IwD0tJQ==",
"dev": true,
"dependencies": {
"@balena/dockerignore": "^1.0.2",
"docker-modem": "^3.0.0",
"docker-modem": "^5.0.0",
"tar-fs": "~2.0.1"
},
"engines": {
@ -19328,9 +19328,9 @@
}
},
"node_modules/nan": {
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==",
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
"integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==",
"dev": true,
"optional": true
},

@ -142,7 +142,7 @@
"css-loader": "^6.8.1",
"cypress": "^13.3.0",
"cypress-wait-until": "^2.0.1",
"dockerode": "^3.3.5",
"dockerode": "^4.0.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-es": "^4.1.0",
"exports-loader": "^4.0.0",