@leverege/build-tools 2.36.0 → 2.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server/firebaseDeploy.js +5 -13
- package/lib/web/firebaseDeploy.js +5 -13
- package/package.json +1 -1
- package/src/dockreate +1 -1
- package/src/firebaseDeploy.mjs +5 -12
|
@@ -38,7 +38,11 @@ const INTERACTIVE_MODE = !TARGET;
|
|
|
38
38
|
let exited = false;
|
|
39
39
|
const SECRETS_DIR = 'secrets';
|
|
40
40
|
const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughException', 'unhandledRejection'];
|
|
41
|
-
const [firebaserc, firebaseJson,
|
|
41
|
+
const [firebaserc, firebaseJson, gitBranch] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), (0, _zx.$)`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`.then(({
|
|
42
|
+
stdout
|
|
43
|
+
}) => {
|
|
44
|
+
return stdout.split('\n')[0];
|
|
45
|
+
})]);
|
|
42
46
|
if (!firebaserc) {
|
|
43
47
|
console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
|
|
44
48
|
}
|
|
@@ -51,18 +55,6 @@ if (!firebaserc || !firebaseJson) {
|
|
|
51
55
|
const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
|
|
52
56
|
encoding: 'utf-8'
|
|
53
57
|
}));
|
|
54
|
-
|
|
55
|
-
// If in a git repo, fetch the name of the git branch to use as a default
|
|
56
|
-
// name in case a deployment channel is needed. Examining this file directly
|
|
57
|
-
// is less cumbersome then running an actual git command to fetch the
|
|
58
|
-
// branch name
|
|
59
|
-
let gitBranch;
|
|
60
|
-
if (git) {
|
|
61
|
-
const gitContent = (await _zx.fs.readFile(_zx.path.join(process.cwd(), '.git/HEAD'), {
|
|
62
|
-
encoding: 'utf-8'
|
|
63
|
-
}))?.split('/');
|
|
64
|
-
gitBranch = gitContent[gitContent?.length - 1]?.trimEnd('\n');
|
|
65
|
-
}
|
|
66
58
|
let maxSiteIdLength = 0;
|
|
67
59
|
const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
|
|
68
60
|
Object.entries(config.hosting).forEach(([siteId, aliases]) => {
|
|
@@ -38,7 +38,11 @@ const INTERACTIVE_MODE = !TARGET;
|
|
|
38
38
|
let exited = false;
|
|
39
39
|
const SECRETS_DIR = 'secrets';
|
|
40
40
|
const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughException', 'unhandledRejection'];
|
|
41
|
-
const [firebaserc, firebaseJson,
|
|
41
|
+
const [firebaserc, firebaseJson, gitBranch] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), (0, _zx.$)`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`.then(({
|
|
42
|
+
stdout
|
|
43
|
+
}) => {
|
|
44
|
+
return stdout.split('\n')[0];
|
|
45
|
+
})]);
|
|
42
46
|
if (!firebaserc) {
|
|
43
47
|
console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
|
|
44
48
|
}
|
|
@@ -51,18 +55,6 @@ if (!firebaserc || !firebaseJson) {
|
|
|
51
55
|
const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
|
|
52
56
|
encoding: 'utf-8'
|
|
53
57
|
}));
|
|
54
|
-
|
|
55
|
-
// If in a git repo, fetch the name of the git branch to use as a default
|
|
56
|
-
// name in case a deployment channel is needed. Examining this file directly
|
|
57
|
-
// is less cumbersome then running an actual git command to fetch the
|
|
58
|
-
// branch name
|
|
59
|
-
let gitBranch;
|
|
60
|
-
if (git) {
|
|
61
|
-
const gitContent = (await _zx.fs.readFile(_zx.path.join(process.cwd(), '.git/HEAD'), {
|
|
62
|
-
encoding: 'utf-8'
|
|
63
|
-
}))?.split('/');
|
|
64
|
-
gitBranch = gitContent[gitContent?.length - 1]?.trimEnd('\n');
|
|
65
|
-
}
|
|
66
58
|
let maxSiteIdLength = 0;
|
|
67
59
|
const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
|
|
68
60
|
Object.entries(config.hosting).forEach(([siteId, aliases]) => {
|
package/package.json
CHANGED
package/src/dockreate
CHANGED
|
@@ -392,7 +392,7 @@ rm -rf ./workspace && mkdir -p ./workspace
|
|
|
392
392
|
cp -rfp ${PKGTOP}/package*json ${PKGTOP}/dist/* ./workspace
|
|
393
393
|
|
|
394
394
|
# grab the npmrc token for the image
|
|
395
|
-
cp -f "$HOME/.npmrc
|
|
395
|
+
cp -f "$HOME/.npmrc" .npmrc
|
|
396
396
|
|
|
397
397
|
[ "$CIRCLECI" == "true" ] && exit 0
|
|
398
398
|
|
package/src/firebaseDeploy.mjs
CHANGED
|
@@ -42,11 +42,14 @@ const EXIT_EVENTS = [ 'SIGINT', 'exit', 'uncaughException', 'unhandledRejection'
|
|
|
42
42
|
const [
|
|
43
43
|
firebaserc,
|
|
44
44
|
firebaseJson,
|
|
45
|
-
|
|
45
|
+
gitBranch
|
|
46
46
|
] = await Promise.all( [
|
|
47
47
|
fs.exists( path.join( process.cwd(), '.firebaserc' ) ),
|
|
48
48
|
fs.exists( path.join( process.cwd(), 'firebase.json' ) ),
|
|
49
|
-
|
|
49
|
+
$`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`
|
|
50
|
+
.then( ( { stdout } ) => {
|
|
51
|
+
return stdout.split( '\n' )[0]
|
|
52
|
+
} )
|
|
50
53
|
] )
|
|
51
54
|
|
|
52
55
|
if ( !firebaserc ) {
|
|
@@ -63,16 +66,6 @@ if ( !firebaserc || !firebaseJson ) {
|
|
|
63
66
|
|
|
64
67
|
const firebasercContent = JSON.parse( await fs.readFile( path.join( process.cwd(), '.firebaserc' ), { encoding : 'utf-8' } ) )
|
|
65
68
|
|
|
66
|
-
// If in a git repo, fetch the name of the git branch to use as a default
|
|
67
|
-
// name in case a deployment channel is needed. Examining this file directly
|
|
68
|
-
// is less cumbersome then running an actual git command to fetch the
|
|
69
|
-
// branch name
|
|
70
|
-
let gitBranch
|
|
71
|
-
if ( git ) {
|
|
72
|
-
const gitContent = ( await fs.readFile( path.join( process.cwd(), '.git/HEAD' ), { encoding : 'utf-8' } ) )?.split( '/' )
|
|
73
|
-
gitBranch = gitContent[gitContent?.length - 1]?.trimEnd( '\n' )
|
|
74
|
-
}
|
|
75
|
-
|
|
76
69
|
let maxSiteIdLength = 0
|
|
77
70
|
|
|
78
71
|
const targets = Object
|