This commit is contained in:
2017-05-15 15:54:09 +02:00
parent 3484575108
commit 29df49addb
4 changed files with 15 additions and 13 deletions

View File

@ -38,8 +38,8 @@ let checkToolsAvailable = async () => {
// check for yarn
await plugins.smartshell.which('yarn').then(
() => {
plugins.smartshell.exec(`yarn config set cache-folder ${plugins.path.join(paths.cwd, '.yarn')}`)
async () => {
await plugins.smartshell.exec(`yarn config set cache-folder ${plugins.path.join(paths.cwd, '.yarn')}`)
yarnAvailable.resolve(true)
},
() => { yarnAvailable.resolve(false) }

View File

@ -28,7 +28,7 @@ export let readDockerfiles = async (): Promise<Dockerfile[]> => {
console.log(fileTree)
for (let dockerfilePath of fileTree) {
let myDockerfile = new Dockerfile({
filePath: dockerfilePath,
filePath: plugins.path.join(paths.cwd, dockerfilePath),
read: true
})
readDockerfilesArray.push(myDockerfile)
@ -144,7 +144,7 @@ export class Dockerfile {
baseImage: string
localBaseImageDependent: boolean
localBaseDockerfile: Dockerfile
constructor(options: { filePath?: string, fileContents?: string | Buffer, read?: boolean }) {
constructor (options: { filePath?: string, fileContents?: string | Buffer, read?: boolean }) {
this.filePath = options.filePath
this.repo = NpmciEnv.repo.user + '/' + NpmciEnv.repo.repo
this.version = dockerFileVersion(plugins.path.parse(options.filePath).base)
@ -164,9 +164,10 @@ export class Dockerfile {
/**
* builds the Dockerfile
*/
async build() {
async build () {
plugins.beautylog.info('now building Dockerfile for ' + this.cleanTag)
await bashBare('docker build -t ' + this.buildTag + ' -f ' + this.filePath + ' .')
let buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} .`
await bashBare(buildCommand)
NpmciEnv.dockerFilesBuilt.push(this)
return
};