From be8c5f5142ffc5698f30c85d5acb759c2953898e Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 11:54:38 -0700 Subject: [PATCH 01/15] travis: avoid regex? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cf63f5212..75280cf91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ env: # Note: this only works for gnu sed, not, e.g., bsd sed as distributed with macos - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") -if: (branch = develop) OR ((branch = master) AND (tag =~ /^v.+$/)) +if: (branch = develop) OR ((branch = master) AND (tag IS present)) # branches: # only: From 7dc42c3d1519911dde2a5226cd4d19e64ff4087a Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 11:58:37 -0700 Subject: [PATCH 02/15] try conditional locally --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75280cf91..bce858d1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,9 @@ env: # Note: this only works for gnu sed, not, e.g., bsd sed as distributed with macos - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") -if: (branch = develop) OR ((branch = master) AND (tag IS present)) +#if: (branch = develop) OR ((branch = master) AND (tag IS present)) +# try this - revert to above before pushing to kbase +if: (branch = develop) AND (tag =~ /^v.+$/) # branches: # only: From 13711474cdfb5055add2c8ab0bc27c919efca979 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:01:10 -0700 Subject: [PATCH 03/15] try without regex --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bce858d1f..17e3d6709 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ env: #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase -if: (branch = develop) AND (tag =~ /^v.+$/) +if: (branch = develop) AND (tag IS present) # branches: # only: From 9c1f1a681f9eebb3139bdffeeba2df5cc4480b68 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:05:19 -0700 Subject: [PATCH 04/15] try again; curse you travis conditions --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 17e3d6709..22c821210 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ env: #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase -if: (branch = develop) AND (tag IS present) +if: branch = develop AND tag IS present # branches: # only: From 89453dfb6d7fd08c510cd3435510a53f7f6608fa Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:20:46 -0700 Subject: [PATCH 05/15] once more into the breach... --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 22c821210..c2488e82f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,10 +33,11 @@ env: # ... the tag! # Note: this only works for gnu sed, not, e.g., bsd sed as distributed with macos - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") + - REAL_TAG=$(git tag -l --points-at HEAD) #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase -if: branch = develop AND tag IS present +if: branch = develop AND env(REAL_TAG) IS present # branches: # only: From ca8640ca3ff48fd8f1d0f12205783546bd760cbd Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:23:34 -0700 Subject: [PATCH 06/15] add back regex --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c2488e82f..884d10fdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ env: #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase -if: branch = develop AND env(REAL_TAG) IS present +if: branch = develop AND env(REAL_TAG) =~ /^v.+$/ # branches: # only: From 36e1736620c98d4b5e49e468e5fe138fa7144182 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:29:36 -0700 Subject: [PATCH 07/15] try simpler regex --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 884d10fdc..fab4cf143 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,8 @@ env: #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase -if: branch = develop AND env(REAL_TAG) =~ /^v.+$/ +# regex doesn't work??? +if: branch = develop AND env(REAL_TAG) =~ /^v/ # branches: # only: From a631d96294ccf692cd72cc630995b681a6277391 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:32:27 -0700 Subject: [PATCH 08/15] remove regex - works? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fab4cf143..3bd12898c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ env: #if: (branch = develop) OR ((branch = master) AND (tag IS present)) # try this - revert to above before pushing to kbase # regex doesn't work??? -if: branch = develop AND env(REAL_TAG) =~ /^v/ +if: branch = develop AND env(REAL_TAG) IS present # branches: # only: From aa0ad8bb4b76d6b30d7ceda50aafb7b089565820 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:44:22 -0700 Subject: [PATCH 09/15] again --- .travis.yml | 6 ++++-- mutations/build.js | 6 ++++-- mutations/mutant.js | 25 +++++++++++++++++++++---- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bd12898c..8e827a547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,10 @@ env: - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") - REAL_TAG=$(git tag -l --points-at HEAD) -#if: (branch = develop) OR ((branch = master) AND (tag IS present)) +if: (branch = develop) OR ((branch = master) AND (tag=~ /^v/)) # try this - revert to above before pushing to kbase # regex doesn't work??? -if: branch = develop AND env(REAL_TAG) IS present +# if: branch = develop AND env(REAL_TAG) =~ /^v/ # branches: # only: @@ -62,3 +62,5 @@ after_success: scripts: - docker version - docker-compose version + - echo "REAL_BRANCH ${REAL_BRANCH}" + - echo "REAL_TAG ${REAL_TAG}" diff --git a/mutations/build.js b/mutations/build.js index 44f656318..2d697884b 100644 --- a/mutations/build.js +++ b/mutations/build.js @@ -612,14 +612,17 @@ function installPlugins(state) { cwd = cwds.split('/'), // Our actual cwd is mutations, so we need to escape one up to the // project root. - repoRoot = (plugin.source.directory.root && plugin.source.directory.root.split('/')) || ['..', '..'], + repoRoot = (plugin.source.directory.path && plugin.source.directory.path.split('/')) || ['..', '..'], source = repoRoot.concat([plugin.globalName]).concat(cwd), destination = root.concat(['build', 'client', 'modules', 'plugins', plugin.name]); + console.log('install plugin from directory', cwd, repoRoot, source) mutant.ensureDir(destination); + console.log('ensured!'); return mutant.copyFiles(source, destination, '**/*'); })); }) .then(function () { + console.log('PLUGINS COPIED'); return Promise.all(plugins .filter(function (plugin) { return (typeof plugin === 'string'); @@ -627,7 +630,6 @@ function installPlugins(state) { .map(function (plugin) { var source = root.concat(['plugins', plugin]), destination = root.concat(['build', 'client', 'modules', 'plugins', plugin]); - // console.log('internal plugin?', plugin, root, source.join('/'), destination.join('/')); mutant.ensureDir(destination); return mutant.copyFiles(source, destination, '**/*'); })); diff --git a/mutations/mutant.js b/mutations/mutant.js index 49fd4f743..6c75c5fa7 100644 --- a/mutations/mutant.js +++ b/mutations/mutant.js @@ -35,8 +35,22 @@ var findit = require('findit2'), // UTILS function copyFiles(tryFrom, tryTo, globExpr) { - return Promise.all([fs.realpathAsync(tryFrom.join('/')), fs.realpathAsync(tryTo.join('/'))]) + const fromPath = tryFrom.join('/'); + const toPath = tryTo.join('/'); + console.log('copying ', fromPath, toPath); + + try { + console.log('from...', typeof fromPath, fromPath); + const x = fs.realpathSync(fromPath); + console.log('is it?', fromPath, x); + } catch (ex) { + console.log('no, it is not!', ex); + throw ex; + } + + return Promise.all([fs.realpathAsync(fromPath), fs.realpathAsync(toPath)]) .spread(function (from, to) { + console.log('from/to:', from, to); return [from.split('/'), to.split('/'), glob(globExpr, { cwd: from, nodir: true @@ -44,8 +58,8 @@ function copyFiles(tryFrom, tryTo, globExpr) { }) .spread(function (from, to, matches) { return Promise.all(matches.map(function (match) { - var fromPath = from.concat([match]).join('/'), - toPath = to.concat([match]).join('/'); + const fromPath = from.concat([match]).join('/'); + const toPath = to.concat([match]).join('/'); return fs.copy(fromPath, toPath, {}); })); }); @@ -183,7 +197,10 @@ function mkdir(inPath, dirPath) { } function ensureDir(path) { - return fs.ensureDirSync(path.join('/')); + const dir = path.join('/'); + console.log('ensuring ' + dir); + + return fs.ensureDirSync(dir); } function copydir(fromRoot, fromDir, toRoot, toDir) { From 2110f96b20072c99294ede2f730c77414c01f918 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 12:59:24 -0700 Subject: [PATCH 10/15] travis: was it the branch not being set for tag-triggered build? --- .travis.yml | 4 ++-- mutations/build.js | 6 ++---- mutations/mutant.js | 25 ++++--------------------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e827a547..d41062a1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,10 @@ env: - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") - REAL_TAG=$(git tag -l --points-at HEAD) -if: (branch = develop) OR ((branch = master) AND (tag=~ /^v/)) +# if: (env(REAL_BRANCH) = develop) OR ((env(REAL_BRANCH) = master) AND (env(REAL_TAG) =~ /^v/)) # try this - revert to above before pushing to kbase # regex doesn't work??? -# if: branch = develop AND env(REAL_TAG) =~ /^v/ +if: env(REAL_BRANCH) = develop AND env(REAL_TAG) =~ /^v/ # branches: # only: diff --git a/mutations/build.js b/mutations/build.js index 2d697884b..44f656318 100644 --- a/mutations/build.js +++ b/mutations/build.js @@ -612,17 +612,14 @@ function installPlugins(state) { cwd = cwds.split('/'), // Our actual cwd is mutations, so we need to escape one up to the // project root. - repoRoot = (plugin.source.directory.path && plugin.source.directory.path.split('/')) || ['..', '..'], + repoRoot = (plugin.source.directory.root && plugin.source.directory.root.split('/')) || ['..', '..'], source = repoRoot.concat([plugin.globalName]).concat(cwd), destination = root.concat(['build', 'client', 'modules', 'plugins', plugin.name]); - console.log('install plugin from directory', cwd, repoRoot, source) mutant.ensureDir(destination); - console.log('ensured!'); return mutant.copyFiles(source, destination, '**/*'); })); }) .then(function () { - console.log('PLUGINS COPIED'); return Promise.all(plugins .filter(function (plugin) { return (typeof plugin === 'string'); @@ -630,6 +627,7 @@ function installPlugins(state) { .map(function (plugin) { var source = root.concat(['plugins', plugin]), destination = root.concat(['build', 'client', 'modules', 'plugins', plugin]); + // console.log('internal plugin?', plugin, root, source.join('/'), destination.join('/')); mutant.ensureDir(destination); return mutant.copyFiles(source, destination, '**/*'); })); diff --git a/mutations/mutant.js b/mutations/mutant.js index 6c75c5fa7..49fd4f743 100644 --- a/mutations/mutant.js +++ b/mutations/mutant.js @@ -35,22 +35,8 @@ var findit = require('findit2'), // UTILS function copyFiles(tryFrom, tryTo, globExpr) { - const fromPath = tryFrom.join('/'); - const toPath = tryTo.join('/'); - console.log('copying ', fromPath, toPath); - - try { - console.log('from...', typeof fromPath, fromPath); - const x = fs.realpathSync(fromPath); - console.log('is it?', fromPath, x); - } catch (ex) { - console.log('no, it is not!', ex); - throw ex; - } - - return Promise.all([fs.realpathAsync(fromPath), fs.realpathAsync(toPath)]) + return Promise.all([fs.realpathAsync(tryFrom.join('/')), fs.realpathAsync(tryTo.join('/'))]) .spread(function (from, to) { - console.log('from/to:', from, to); return [from.split('/'), to.split('/'), glob(globExpr, { cwd: from, nodir: true @@ -58,8 +44,8 @@ function copyFiles(tryFrom, tryTo, globExpr) { }) .spread(function (from, to, matches) { return Promise.all(matches.map(function (match) { - const fromPath = from.concat([match]).join('/'); - const toPath = to.concat([match]).join('/'); + var fromPath = from.concat([match]).join('/'), + toPath = to.concat([match]).join('/'); return fs.copy(fromPath, toPath, {}); })); }); @@ -197,10 +183,7 @@ function mkdir(inPath, dirPath) { } function ensureDir(path) { - const dir = path.join('/'); - console.log('ensuring ' + dir); - - return fs.ensureDirSync(dir); + return fs.ensureDirSync(path.join('/')); } function copydir(fromRoot, fromDir, toRoot, toDir) { From 09a2f7ac330ef05476388a68b3f3685cf46aa4a4 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 13:01:38 -0700 Subject: [PATCH 11/15] travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d41062a1b..405177dc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ env: # if: (env(REAL_BRANCH) = develop) OR ((env(REAL_BRANCH) = master) AND (env(REAL_TAG) =~ /^v/)) # try this - revert to above before pushing to kbase # regex doesn't work??? -if: env(REAL_BRANCH) = develop AND env(REAL_TAG) =~ /^v/ +if: env(REAL_BRANCH) = develop # branches: # only: From fd6933411b8ab6768addfb23620a26f1a1d38498 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 13:05:38 -0700 Subject: [PATCH 12/15] travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 405177dc7..2607042e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,15 @@ env: - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") - REAL_TAG=$(git tag -l --points-at HEAD) -# if: (env(REAL_BRANCH) = develop) OR ((env(REAL_BRANCH) = master) AND (env(REAL_TAG) =~ /^v/)) +if: branch = develop OR tag =~ /^v.+$/ # try this - revert to above before pushing to kbase # regex doesn't work??? -if: env(REAL_BRANCH) = develop +# if: env(REAL_BRANCH) = develop # branches: # only: # # builds for any PR merged into the develop branch -# - develop +# - develo # # builds when a release is tagged using a "v" prefixed semver tag. # # This is rough, but all we are after for is a trigger, not semver # # validation! From c1f51929662bad991b948e53fca43c245c5e2fb4 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 13:06:23 -0700 Subject: [PATCH 13/15] travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2607042e9..2eb80df59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,10 @@ env: - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") - REAL_TAG=$(git tag -l --points-at HEAD) -if: branch = develop OR tag =~ /^v.+$/ +# if: branch = develop OR tag =~ /^v.+$/ # try this - revert to above before pushing to kbase # regex doesn't work??? -# if: env(REAL_BRANCH) = develop +if: tag =~ /^v.+$/ # branches: # only: From b88097d54149dac825c16c280741ed764cf963af Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 13:09:58 -0700 Subject: [PATCH 14/15] travis: fix release build detection --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2eb80df59..abe3fd347 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,12 +33,11 @@ env: # ... the tag! # Note: this only works for gnu sed, not, e.g., bsd sed as distributed with macos - REAL_BRANCH=$(git ls-remote origin | sed -n "\|^$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") - - REAL_TAG=$(git tag -l --points-at HEAD) -# if: branch = develop OR tag =~ /^v.+$/ -# try this - revert to above before pushing to kbase -# regex doesn't work??? -if: tag =~ /^v.+$/ +# Note that when a travis build is triggered by a tag, the branch is undefined +# The previous travis config specified that the branch had to be master as well as tagged, +# but a change at Travis broke this unexpectedly. +if: branch = develop OR tag =~ /^v.+$/ # branches: # only: From ffb8e14aa4b922c9fe27f59892a2899750f2c944 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 4 Oct 2018 13:12:00 -0700 Subject: [PATCH 15/15] travis: cleanup --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index abe3fd347..b2259206e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,17 +39,6 @@ env: # but a change at Travis broke this unexpectedly. if: branch = develop OR tag =~ /^v.+$/ -# branches: -# only: -# # builds for any PR merged into the develop branch -# - develo -# # builds when a release is tagged using a "v" prefixed semver tag. -# # This is rough, but all we are after for is a trigger, not semver -# # validation! -# # master is tagged as a release after develop->master is merged -# - /^v.*$/ - - install: # Note that this will build the image appropriately, depending upon # whether the current branch is develop or master @@ -61,5 +50,3 @@ after_success: scripts: - docker version - docker-compose version - - echo "REAL_BRANCH ${REAL_BRANCH}" - - echo "REAL_TAG ${REAL_TAG}"