diff options
author | Louis Chemineau <louis@chmn.me> | 2023-01-18 17:00:24 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-01-18 17:17:06 +0100 |
commit | 535c228d57cbd44bdde0621411074de52c934881 (patch) | |
tree | f0e355a123b241a482fe77affcfd6ee0ee6eade9 /cypress | |
parent | 46dcbd3b77a6bc660b4aae95f4b1c71467721375 (diff) | |
download | nextcloud-server-535c228d57cbd44bdde0621411074de52c934881.tar.gz nextcloud-server-535c228d57cbd44bdde0621411074de52c934881.zip |
Use current git branch by default when setting up cypress container
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/dockerNode.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts index c9f53d50bf0..ae3948877b9 100644 --- a/cypress/dockerNode.ts +++ b/cypress/dockerNode.ts @@ -26,6 +26,7 @@ import Docker from 'dockerode' import waitOn from 'wait-on' import tar from 'tar' +import { execSync } from 'child_process' export const docker = new Docker() @@ -37,7 +38,7 @@ const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server' * * @param {string} branch the branch of your current work */ -export const startNextcloud = async function(branch = 'master'): Promise<any> { +export const startNextcloud = async function(branch: string = getCurrentGitBranch()): Promise<any> { try { // Pulling images @@ -245,3 +246,7 @@ const runExec = async function( const sleep = function(milliseconds: number) { return new Promise((resolve) => setTimeout(resolve, milliseconds)) } + +const getCurrentGitBranch = function() { + return execSync('git rev-parse --abbrev-ref HEAD').toString().trim() || 'master' +} |