|
|
|
|
|
|
|
|
import Docker from 'dockerode' |
|
|
import Docker from 'dockerode' |
|
|
import waitOn from 'wait-on' |
|
|
import waitOn from 'wait-on' |
|
|
import tar from 'tar' |
|
|
import tar from 'tar' |
|
|
|
|
|
import { execSync } from 'child_process' |
|
|
|
|
|
|
|
|
export const docker = new Docker() |
|
|
export const docker = new Docker() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* |
|
|
* |
|
|
* @param {string} branch the branch of your current work |
|
|
* @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 { |
|
|
try { |
|
|
// Pulling images |
|
|
// Pulling images |
|
|
|
|
|
|
|
|
const sleep = function(milliseconds: number) { |
|
|
const sleep = function(milliseconds: number) { |
|
|
return new Promise((resolve) => setTimeout(resolve, milliseconds)) |
|
|
return new Promise((resolve) => setTimeout(resolve, milliseconds)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getCurrentGitBranch = function() { |
|
|
|
|
|
return execSync('git rev-parse --abbrev-ref HEAD').toString().trim() || 'master' |
|
|
|
|
|
} |