mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #36221 from nextcloud/artonge/feat/cypress_git_branch
Use current git branch by default when setting up cypress container
This commit is contained in:
commit
cd72bef78b
1 changed files with 6 additions and 1 deletions
|
|
@ -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'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue