aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-08-21 20:00:24 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-08-22 13:32:59 +0200
commit5a7e21187b57dc4ec745b287331e9da33cde8369 (patch)
tree6a3a4099048356695aa0c9ca86cdfcaf753120b2
parentb6bc28833ca7292aa6144fab9710868cf252925f (diff)
downloadnextcloud-server-5a7e21187b57dc4ec745b287331e9da33cde8369.tar.gz
nextcloud-server-5a7e21187b57dc4ec745b287331e9da33cde8369.zip
chore(cypress): put nextcloud into ram
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r--cypress/dockerNode.ts14
-rw-r--r--cypress/support/commands.ts4
2 files changed, 15 insertions, 3 deletions
diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts
index 33c2829c9d0..14ca7b936b1 100644
--- a/cypress/dockerNode.ts
+++ b/cypress/dockerNode.ts
@@ -82,7 +82,12 @@ export const startNextcloud = async function(branch: string = getCurrentGitBranc
Image: SERVER_IMAGE,
name: CONTAINER_NAME,
HostConfig: {
- Binds: [],
+ Mounts: [{
+ Target: '/var/www/html/data',
+ Source: '',
+ Type: 'tmpfs',
+ ReadOnly: false,
+ }],
},
Env: [
`BRANCH=${branch}`,
@@ -90,6 +95,13 @@ export const startNextcloud = async function(branch: string = getCurrentGitBranc
})
await container.start()
+ // Set proper permissions for the data folder
+ await runExec(container, ['chown', '-R', 'www-data:www-data', '/var/www/html/data'], false, 'root')
+ await runExec(container, ['chmod', '0770', '/var/www/html/data'], false, 'root')
+
+ // Init Nextcloud
+ // await runExec(container, ['initnc.sh'], true, 'root')
+
// Get container's IP
const ip = await getContainerIP(container)
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
index e5aa11df775..1574a03705f 100644
--- a/cypress/support/commands.ts
+++ b/cypress/support/commands.ts
@@ -290,12 +290,12 @@ Cypress.Commands.add('runOccCommand', (command: string, options?: Partial<Cypres
Cypress.Commands.add('backupDB', (): Cypress.Chainable<string> => {
const randomString = Math.random().toString(36).substring(7)
- cy.exec(`docker exec nextcloud-cypress-tests-server cp /var/www/html/data/owncloud.db /var/www/html/data/owncloud.db-${randomString}`)
+ cy.exec(`docker exec --user www-data nextcloud-cypress-tests-server cp /var/www/html/data/owncloud.db /var/www/html/data/owncloud.db-${randomString}`)
cy.log(`Created snapshot ${randomString}`)
return cy.wrap(randomString)
})
Cypress.Commands.add('restoreDB', (snapshot: string = 'init') => {
- cy.exec(`docker exec nextcloud-cypress-tests-server cp /var/www/html/data/owncloud.db-${snapshot} /var/www/html/data/owncloud.db`)
+ cy.exec(`docker exec --user www-data nextcloud-cypress-tests-server cp /var/www/html/data/owncloud.db-${snapshot} /var/www/html/data/owncloud.db`)
cy.log(`Restored snapshot ${snapshot}`)
})