antelope-cli 1.2.2 → 1.2.3
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.
|
@@ -66,22 +66,22 @@ Note: pass token values literally (or via a shell variable as above). Do **not**
|
|
|
66
66
|
|
|
67
67
|
## Inputs
|
|
68
68
|
|
|
69
|
-
| var | required | example
|
|
70
|
-
|
|
71
|
-
| `brand_name` | yes | `Zenith Horizon Group`
|
|
72
|
-
| `jira_key_client_branding` | yes | `ATLP-47067`
|
|
73
|
-
| `bitbucket_token` | no* | *(secret)*
|
|
74
|
-
| `bitbucket_email` | yes | `jenkins@xsites.co.il`
|
|
75
|
-
| `dest_branches` | no | `develop,master-26.9`
|
|
76
|
-
| `consul_token` | no* | *(secret)*
|
|
77
|
-
| `brand_assets_folder` | no | `zenithhorizongroup`
|
|
78
|
-
| `reviewers` | no | *(auto)*
|
|
79
|
-
| `consul_url` | no | `https://consul.xsites.xyz`
|
|
69
|
+
| var | required | example | notes |
|
|
70
|
+
|-----|----------|---------------------------------------------------|-------|
|
|
71
|
+
| `brand_name` | yes | `Zenith Horizon Group` | display name → PR title |
|
|
72
|
+
| `jira_key_client_branding` | yes | `ATLP-47067` | PR title prefix + branch name |
|
|
73
|
+
| `bitbucket_token` | no* | *(secret)* | Atlassian API token (`ATATT…`) for the REST calls; sent via Basic auth. *Blank ⇒ fetched from 1Password (`jenkins@xsites.co.il` / `bitbucket_scoped_token`)* |
|
|
74
|
+
| `bitbucket_email` | yes | `jenkins@xsites.co.il` | account that owns the token (Basic-auth username); defaults to the Jenkins service account |
|
|
75
|
+
| `dest_branches` | no | `develop,master-26.9` | comma-separated override; **blank ⇒ derived from Consul** (see below). **One PR per branch** |
|
|
76
|
+
| `consul_token` | no* | *(secret)* | read scope on `version/*`. *Blank ⇒ `$CONSUL_HTTP_TOKEN`, else 1Password (`New_Consul_Token` / `password`)*. Unused when `dest_branches` is set |
|
|
77
|
+
| `brand_assets_folder` | no | `zenithhorizongroup` | folder name → CLI `--brand_assets_folder`, branch name; prompted separately. Blank ⇒ derived from `brand_name` (lowercased, spaces removed) |
|
|
78
|
+
| `reviewers` | no | *(auto)* | default: repo's Bitbucket default-reviewers (author excluded); override with `[{account_id: "..."}]` |
|
|
79
|
+
| `consul_url` | no | `https://consul.xsites.xyz` | Consul base URL for the version lookup |
|
|
80
80
|
| `onepassword_bitbucket_item` / `_field` | no | `jenkins@xsites.co.il` / `bitbucket_scoped_token` | 1Password source for the Bitbucket token |
|
|
81
|
-
| `onepassword_consul_item` / `_field` | no | `New_Consul_Token` / `password`
|
|
82
|
-
| `antelope_cli_version` | no | `1.2.
|
|
83
|
-
| `work_dir` | no | `/tmp/onboard-ca/web-client-area`
|
|
84
|
-
| `git_user_name` / `git_user_email` | no |
|
|
81
|
+
| `onepassword_consul_item` / `_field` | no | `New_Consul_Token` / `password` | 1Password source for the Consul token |
|
|
82
|
+
| `antelope_cli_version` | no | `1.2.3` | pinned published CLI version |
|
|
83
|
+
| `work_dir` | no | `/tmp/onboard-ca/web-client-area` | clone location |
|
|
84
|
+
| `git_user_name` / `git_user_email` | no | | commit identity |
|
|
85
85
|
|
|
86
86
|
## Behavior notes
|
|
87
87
|
|
|
@@ -29,11 +29,11 @@ const updateConfigFile = () => {
|
|
|
29
29
|
gaTrackingID: 'UA-70456753-2',
|
|
30
30
|
colorTheme: 'theme-${brand.connectedBrandName}',
|
|
31
31
|
templateTheme: 'theme-template-${brand.connectedBrandName}',
|
|
32
|
-
title: '${brand.
|
|
32
|
+
title: '${brand.brandName}',
|
|
33
33
|
favicon: '${brand.favicon}',
|
|
34
|
-
|
|
34
|
+
logo: '${brand.logo}',
|
|
35
35
|
FCMSenderId: '${brand.FCMSenderId}',
|
|
36
|
-
brandAssetsFolder: '${brand.connectedBrandName}'
|
|
36
|
+
brandAssetsFolder: '${brand.connectedBrandName}'
|
|
37
37
|
};`;
|
|
38
38
|
};
|
|
39
39
|
|
package/onboarding-crm/themes.js
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const brandModule = require('./brand.js');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const themesPath = 'src/ng1/assets/css/sass/materialism/themes.scss';
|
|
5
|
-
|
|
6
|
-
function addColorToMap(mapName, key, value, data) {
|
|
7
|
-
const mapRegex = new RegExp(`\\$${mapName}:\\s*\\(([\\s\\S]*?)\\)`);
|
|
8
|
-
const match = data.match(mapRegex);
|
|
9
|
-
if (match) {
|
|
10
|
-
const mapContent = match[1];
|
|
11
|
-
const newMapContent = `$${mapName}: (${mapContent},\n '${key}': ${value})`;
|
|
12
|
-
data = data.replace(mapRegex, newMapContent);
|
|
13
|
-
} else {
|
|
14
|
-
throw new Error(`Error: Could not find ${mapName} map in the file`);
|
|
15
|
-
}
|
|
16
|
-
return data;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Same edits as onboarding/themes.js, driven by resolved brand state (no prompts).
|
|
20
|
-
function start() {
|
|
21
|
-
const brand = brandModule.getBrand();
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
const themeVar = `
|
|
24
|
-
.theme-template-${brand.connectedBrandName} {
|
|
25
|
-
#logo {
|
|
26
|
-
display: inline-block;
|
|
27
|
-
width: 240px;
|
|
28
|
-
height: 120px;
|
|
29
|
-
background: url('${brand.logo}') no-repeat center center;
|
|
30
|
-
background-size: contain;
|
|
31
|
-
}
|
|
32
|
-
.navbar-toggle-container {
|
|
33
|
-
background: #222C38;
|
|
34
|
-
|
|
35
|
-
.icon-bar {
|
|
36
|
-
background: #fff !important;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.sidebar {
|
|
40
|
-
background: #222C38;
|
|
41
|
-
color: #ffffff;
|
|
42
|
-
|
|
43
|
-
ul a,
|
|
44
|
-
i {
|
|
45
|
-
color: #ffffff;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.brand-logo,
|
|
49
|
-
.brand-logo-text {
|
|
50
|
-
display: none;
|
|
51
|
-
}
|
|
52
|
-
.user-logged-in:after {
|
|
53
|
-
background: #26303C;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
\n`;
|
|
58
|
-
fs.readFile(themesPath, 'utf8', (err, data) => {
|
|
59
|
-
if (err) {
|
|
60
|
-
return reject(err);
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
data = addColorToMap(
|
|
64
|
-
'theme-colors',
|
|
65
|
-
brand.connectedBrandName,
|
|
66
|
-
brand.color ? `$${brand.connectedBrandName}` : '$corp',
|
|
67
|
-
data
|
|
68
|
-
);
|
|
69
|
-
data = addColorToMap(
|
|
70
|
-
'theme-secondary-colors',
|
|
71
|
-
brand.connectedBrandName,
|
|
72
|
-
brand.color ? `'${brand.connectedBrandName}'` : "'corp'",
|
|
73
|
-
data
|
|
74
|
-
);
|
|
75
|
-
} catch (mapError) {
|
|
76
|
-
return reject(mapError);
|
|
77
|
-
}
|
|
78
|
-
const insertionPoint = data.lastIndexOf('@each $color-name');
|
|
79
|
-
const newFileContent = data.slice(0, insertionPoint) + themeVar + data.slice(insertionPoint);
|
|
80
|
-
fs.writeFile(themesPath, newFileContent, 'utf8', (error) => {
|
|
81
|
-
if (error) {
|
|
82
|
-
reject(error);
|
|
83
|
-
} else {
|
|
84
|
-
console.log(chalk.cyan('themes.scss file updated successfully!'));
|
|
85
|
-
resolve(null);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
module.exports = { start };
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const brandModule = require('./brand.js');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const themesPath = 'src/ng1/assets/css/sass/materialism/themes.scss';
|
|
5
|
+
|
|
6
|
+
function addColorToMap(mapName, key, value, data) {
|
|
7
|
+
const mapRegex = new RegExp(`\\$${mapName}:\\s*\\(([\\s\\S]*?)\\)`);
|
|
8
|
+
const match = data.match(mapRegex);
|
|
9
|
+
if (match) {
|
|
10
|
+
const mapContent = match[1];
|
|
11
|
+
const newMapContent = `$${mapName}: (${mapContent.replace(/\s*$/, '')},\n '${key}': ${value}\n)`;
|
|
12
|
+
data = data.replace(mapRegex, newMapContent);
|
|
13
|
+
} else {
|
|
14
|
+
throw new Error(`Error: Could not find ${mapName} map in the file`);
|
|
15
|
+
}
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Same edits as onboarding/themes.js, driven by resolved brand state (no prompts).
|
|
20
|
+
function start() {
|
|
21
|
+
const brand = brandModule.getBrand();
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const themeVar = `
|
|
24
|
+
.theme-template-${brand.connectedBrandName} {
|
|
25
|
+
#logo {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
width: 240px;
|
|
28
|
+
height: 120px;
|
|
29
|
+
background: url('${brand.logo}') no-repeat center center;
|
|
30
|
+
background-size: contain;
|
|
31
|
+
}
|
|
32
|
+
.navbar-toggle-container {
|
|
33
|
+
background: #222C38;
|
|
34
|
+
|
|
35
|
+
.icon-bar {
|
|
36
|
+
background: #fff !important;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
.sidebar {
|
|
40
|
+
background: #222C38;
|
|
41
|
+
color: #ffffff;
|
|
42
|
+
|
|
43
|
+
ul a,
|
|
44
|
+
i {
|
|
45
|
+
color: #ffffff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.brand-logo,
|
|
49
|
+
.brand-logo-text {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
.user-logged-in:after {
|
|
53
|
+
background: #26303C;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
\n`;
|
|
58
|
+
fs.readFile(themesPath, 'utf8', (err, data) => {
|
|
59
|
+
if (err) {
|
|
60
|
+
return reject(err);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
data = addColorToMap(
|
|
64
|
+
'theme-colors',
|
|
65
|
+
brand.connectedBrandName,
|
|
66
|
+
brand.color ? `$${brand.connectedBrandName}` : '$corp',
|
|
67
|
+
data
|
|
68
|
+
);
|
|
69
|
+
data = addColorToMap(
|
|
70
|
+
'theme-secondary-colors',
|
|
71
|
+
brand.connectedBrandName,
|
|
72
|
+
brand.color ? `'${brand.connectedBrandName}'` : "'corp'",
|
|
73
|
+
data
|
|
74
|
+
);
|
|
75
|
+
} catch (mapError) {
|
|
76
|
+
return reject(mapError);
|
|
77
|
+
}
|
|
78
|
+
const insertionPoint = data.lastIndexOf('@each $color-name');
|
|
79
|
+
const newFileContent = data.slice(0, insertionPoint) + themeVar + data.slice(insertionPoint);
|
|
80
|
+
fs.writeFile(themesPath, newFileContent, 'utf8', (error) => {
|
|
81
|
+
if (error) {
|
|
82
|
+
reject(error);
|
|
83
|
+
} else {
|
|
84
|
+
console.log(chalk.cyan('themes.scss file updated successfully!'));
|
|
85
|
+
resolve(null);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
module.exports = { start };
|
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const brandModule = require('./brand.js');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const variablesColorsPath = 'src/ng1/assets/css/sass/variables-colors.scss';
|
|
5
|
-
const defaultColor = '$corp';
|
|
6
|
-
|
|
7
|
-
// Same edits as onboarding/variablesColors.js, driven by resolved brand state (no prompts).
|
|
8
|
-
function start() {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
try {
|
|
11
|
-
const { connectedBrandName, color: hexColor } = brandModule.getBrand();
|
|
12
|
-
let data = fs.readFileSync(variablesColorsPath, 'utf8');
|
|
13
|
-
|
|
14
|
-
// Check if $colors map exists in the file
|
|
15
|
-
const colorsRegex = /\$colors:\s*\(([\s\S]*?)\)/;
|
|
16
|
-
const match = data.match(colorsRegex);
|
|
17
|
-
if (match) {
|
|
18
|
-
const colorsMap = match[1];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'lighten-
|
|
33
|
-
'lighten-
|
|
34
|
-
'lighten-
|
|
35
|
-
'lighten-
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'darken-
|
|
39
|
-
'darken-
|
|
40
|
-
'darken-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
module.exports = { start };
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const brandModule = require('./brand.js');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const variablesColorsPath = 'src/ng1/assets/css/sass/variables-colors.scss';
|
|
5
|
+
const defaultColor = '$corp';
|
|
6
|
+
|
|
7
|
+
// Same edits as onboarding/variablesColors.js, driven by resolved brand state (no prompts).
|
|
8
|
+
function start() {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
try {
|
|
11
|
+
const { connectedBrandName, color: hexColor } = brandModule.getBrand();
|
|
12
|
+
let data = fs.readFileSync(variablesColorsPath, 'utf8');
|
|
13
|
+
|
|
14
|
+
// Check if $colors map exists in the file
|
|
15
|
+
const colorsRegex = /\$colors:\s*\(([\s\S]*?)\)/;
|
|
16
|
+
const match = data.match(colorsRegex);
|
|
17
|
+
if (match) {
|
|
18
|
+
const colorsMap = match[1];
|
|
19
|
+
|
|
20
|
+
const newColorsMap = `$colors: (${colorsMap.replace(/\s*$/, '')},\n '${connectedBrandName}': ${
|
|
21
|
+
hexColor ? '$' + connectedBrandName : defaultColor
|
|
22
|
+
}\n)`;
|
|
23
|
+
|
|
24
|
+
// Replace the $colors map in the file with the new one
|
|
25
|
+
data = data.replace(colorsRegex, newColorsMap);
|
|
26
|
+
} else {
|
|
27
|
+
return reject('Error: Could not find $colors map in the file');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const brandVar = `\$${connectedBrandName}: (
|
|
31
|
+
'lighten-5': lighten(${hexColor}, 25%),
|
|
32
|
+
'lighten-4': lighten(${hexColor}, 20%),
|
|
33
|
+
'lighten-3': lighten(${hexColor}, 15%),
|
|
34
|
+
'lighten-2': lighten(${hexColor}, 10%),
|
|
35
|
+
'lighten-1': lighten(${hexColor}, 5%),
|
|
36
|
+
'base': ${hexColor},
|
|
37
|
+
'darken-1': darken(${hexColor}, 5%),
|
|
38
|
+
'darken-2': darken(${hexColor}, 10%),
|
|
39
|
+
'darken-3': darken(${hexColor}, 15%),
|
|
40
|
+
'darken-4': darken(${hexColor}, 20%),
|
|
41
|
+
);\n`;
|
|
42
|
+
|
|
43
|
+
const newData = hexColor ? brandVar + data : data;
|
|
44
|
+
fs.writeFileSync(variablesColorsPath, newData, 'utf8');
|
|
45
|
+
console.log(chalk.cyan('\nvariables-colors.scss file updated successfully!'));
|
|
46
|
+
resolve(null);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
reject(error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
module.exports = { start };
|