antelope-cli 1.2.3 → 1.2.5

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.
Files changed (37) hide show
  1. package/ansible/onboarding-ca/README.md +105 -105
  2. package/ansible/onboarding-ca/onboard-ca.yml +43 -51
  3. package/ansible/onboarding-ca/requirements.yml +8 -8
  4. package/ansible/onboarding-ca/roles/onboard_ca/defaults/main.yml +77 -49
  5. package/ansible/onboarding-ca/roles/onboard_ca/meta/main.yml +10 -10
  6. package/ansible/onboarding-ca/roles/onboard_ca/tasks/main.yml +311 -193
  7. package/ansible/onboarding-ca/roles/onboard_ca/tasks/per_branch.yml +114 -107
  8. package/ansible/onboarding-ca/roles/onboard_ca/vars/main.yml +9 -9
  9. package/ansible/onboarding-crm/README.md +107 -0
  10. package/ansible/onboarding-crm/onboard-crm.yml +57 -0
  11. package/ansible/onboarding-crm/requirements.yml +8 -0
  12. package/ansible/onboarding-crm/roles/onboard_crm/defaults/main.yml +98 -0
  13. package/ansible/onboarding-crm/roles/onboard_crm/meta/main.yml +10 -0
  14. package/ansible/onboarding-crm/roles/onboard_crm/tasks/main.yml +357 -0
  15. package/ansible/onboarding-crm/roles/onboard_crm/tasks/per_branch.yml +138 -0
  16. package/ansible/onboarding-crm/roles/onboard_crm/vars/main.yml +9 -0
  17. package/index.js +12 -12
  18. package/onboarding/brand.js +21 -21
  19. package/onboarding/createConfig.js +71 -71
  20. package/onboarding/favicon.js +24 -24
  21. package/onboarding/index.js +62 -62
  22. package/onboarding/logo.js +16 -16
  23. package/onboarding/themes.js +92 -92
  24. package/onboarding/translations.js +41 -41
  25. package/onboarding/variablesColors.js +58 -58
  26. package/onboarding-ca/brand.js +13 -13
  27. package/onboarding-ca/index.js +94 -94
  28. package/onboarding-ca/riskDisclaimer.js +27 -27
  29. package/onboarding-ca/scss.js +24 -24
  30. package/onboarding-ca/templates/risk-disclaimer.html +12 -12
  31. package/onboarding-crm/brand.js +22 -22
  32. package/onboarding-crm/brandLogos.js +31 -0
  33. package/onboarding-crm/createConfig.js +47 -40
  34. package/onboarding-crm/index.js +181 -171
  35. package/onboarding-crm/themes.js +92 -92
  36. package/onboarding-crm/variablesColors.js +53 -53
  37. package/package.json +30 -30
@@ -1,107 +1,114 @@
1
- ---
2
- # Runs once per destination branch. `dest_branch` is the loop var.
3
-
4
- - name: "[{{ dest_branch }}] Compose source branch name"
5
- ansible.builtin.set_fact:
6
- branch_prefix: "{{ 'hotfix' if dest_branch is match('(master|release)') else 'feature' }}"
7
-
8
- - name: "[{{ dest_branch }}] Set source branch"
9
- ansible.builtin.set_fact:
10
- source_branch: "{{ branch_prefix }}/{{ jira_key_client_branding }}-onboarding-{{ brand_assets_folder }}"
11
-
12
- - name: "[{{ dest_branch }}] Fetch all remote branches"
13
- ansible.builtin.command:
14
- cmd: git fetch origin --prune
15
- chdir: "{{ work_dir }}"
16
- changed_when: false
17
-
18
- - name: "[{{ dest_branch }}] Does the source branch already exist on origin?"
19
- ansible.builtin.command:
20
- cmd: "git ls-remote --exit-code --heads origin {{ source_branch }}"
21
- chdir: "{{ work_dir }}"
22
- register: remote_src
23
- failed_when: false
24
- changed_when: false
25
-
26
- # Base the working branch on its own remote head if it already exists (idempotent re-run),
27
- # otherwise on the destination branch.
28
- - name: "[{{ dest_branch }}] Check out the working branch"
29
- ansible.builtin.command:
30
- cmd: >-
31
- git checkout -B {{ source_branch }}
32
- {{ ('origin/' + source_branch) if remote_src.rc == 0 else ('origin/' + dest_branch) }}
33
- chdir: "{{ work_dir }}"
34
-
35
- - name: "[{{ dest_branch }}] Generate brand files via antelope-cli"
36
- ansible.builtin.command:
37
- argv:
38
- - npx
39
- - "antelope-cli@{{ antelope_cli_version }}"
40
- - onboarding-ca
41
- - --brand_assets_folder
42
- - "{{ brand_assets_folder }}"
43
- chdir: "{{ work_dir }}"
44
- environment:
45
- CI: "true"
46
- changed_when: true
47
-
48
- - name: "[{{ dest_branch }}] Stage changes"
49
- ansible.builtin.command:
50
- cmd: git add -A
51
- chdir: "{{ work_dir }}"
52
- changed_when: false
53
-
54
- - name: "[{{ dest_branch }}] Detect staged changes"
55
- ansible.builtin.command:
56
- cmd: git diff --cached --quiet
57
- chdir: "{{ work_dir }}"
58
- register: staged
59
- failed_when: false
60
- changed_when: false
61
-
62
- - name: "[{{ dest_branch }}] Commit"
63
- ansible.builtin.command:
64
- cmd: >-
65
- git -c user.name="{{ git_user_name }}" -c user.email="{{ git_user_email }}"
66
- commit -m "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
67
- chdir: "{{ work_dir }}"
68
- when: staged.rc == 1
69
-
70
- - name: "[{{ dest_branch }}] Push source branch"
71
- ansible.builtin.command:
72
- cmd: "git push -u origin {{ source_branch }}"
73
- chdir: "{{ work_dir }}"
74
- when: staged.rc == 1
75
-
76
- - name: "[{{ dest_branch }}] Open pull request"
77
- ansible.builtin.uri:
78
- url: "{{ api_base }}/repositories/{{ workspace }}/{{ repo_slug }}/pullrequests"
79
- method: POST
80
- url_username: "{{ bitbucket_email }}"
81
- url_password: "{{ bitbucket_token }}"
82
- force_basic_auth: true
83
- body_format: json
84
- body:
85
- title: "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
86
- description: "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
87
- source:
88
- branch:
89
- name: "{{ source_branch }}"
90
- destination:
91
- branch:
92
- name: "{{ dest_branch }}"
93
- reviewers: "{{ reviewers }}"
94
- close_source_branch: true
95
- return_content: true
96
- status_code: [201, 400] # 400 tolerated: a PR for this source->dest already exists
97
- register: pr_response
98
-
99
- - name: "[{{ dest_branch }}] Record PR result"
100
- ansible.builtin.set_fact:
101
- pr_results: >-
102
- {{ (pr_results | default([])) + [{
103
- 'destination': dest_branch,
104
- 'source': source_branch,
105
- 'status': pr_response.status,
106
- 'url': (pr_response.json.links.html.href | default('(already exists or not created)'))
107
- }] }}
1
+ ---
2
+ # Runs once per destination branch. `dest_branch` is the loop var.
3
+
4
+ - name: "[{{ dest_branch }}] Compose source branch name"
5
+ ansible.builtin.set_fact:
6
+ branch_prefix: "{{ 'hotfix' if dest_branch is match('(master|release)') else 'feature' }}"
7
+
8
+ # Suffix the release version onto master/release targets so each destination gets its OWN
9
+ # source branch. Without it, master-27.0 and master-27.1 (both present during a staged
10
+ # release, e.g. after a code freeze) collapse to one hotfix branch → the 2nd PR reuses the
11
+ # 1st's branch (wrong base) and close_source_branch on either merge kills the other PR.
12
+ - name: "[{{ dest_branch }}] Set source branch"
13
+ ansible.builtin.set_fact:
14
+ source_branch: >-
15
+ {{ branch_prefix }}/{{ jira_key_client_branding }}-onboarding-{{ brand_assets_folder }}{{
16
+ ('-' ~ (dest_branch | regex_replace('^(master|release)-', '')))
17
+ if dest_branch is match('(master|release)') else '' }}
18
+
19
+ - name: "[{{ dest_branch }}] Fetch all remote branches"
20
+ ansible.builtin.command:
21
+ cmd: git fetch origin --prune
22
+ chdir: "{{ work_dir }}"
23
+ changed_when: false
24
+
25
+ - name: "[{{ dest_branch }}] Does the source branch already exist on origin?"
26
+ ansible.builtin.command:
27
+ cmd: "git ls-remote --exit-code --heads origin {{ source_branch }}"
28
+ chdir: "{{ work_dir }}"
29
+ register: remote_src
30
+ failed_when: false
31
+ changed_when: false
32
+
33
+ # Base the working branch on its own remote head if it already exists (idempotent re-run),
34
+ # otherwise on the destination branch.
35
+ - name: "[{{ dest_branch }}] Check out the working branch"
36
+ ansible.builtin.command:
37
+ cmd: >-
38
+ git checkout -B {{ source_branch }}
39
+ {{ ('origin/' + source_branch) if remote_src.rc == 0 else ('origin/' + dest_branch) }}
40
+ chdir: "{{ work_dir }}"
41
+
42
+ - name: "[{{ dest_branch }}] Generate brand files via antelope-cli"
43
+ ansible.builtin.command:
44
+ argv:
45
+ - npx
46
+ - "antelope-cli@{{ antelope_cli_version }}"
47
+ - onboarding-ca
48
+ - --brand_assets_folder
49
+ - "{{ brand_assets_folder }}"
50
+ chdir: "{{ work_dir }}"
51
+ environment:
52
+ CI: "true"
53
+ changed_when: true
54
+
55
+ - name: "[{{ dest_branch }}] Stage changes"
56
+ ansible.builtin.command:
57
+ cmd: git add -A
58
+ chdir: "{{ work_dir }}"
59
+ changed_when: false
60
+
61
+ - name: "[{{ dest_branch }}] Detect staged changes"
62
+ ansible.builtin.command:
63
+ cmd: git diff --cached --quiet
64
+ chdir: "{{ work_dir }}"
65
+ register: staged
66
+ failed_when: false
67
+ changed_when: false
68
+
69
+ - name: "[{{ dest_branch }}] Commit"
70
+ ansible.builtin.command:
71
+ cmd: >-
72
+ git -c user.name="{{ git_user_name }}" -c user.email="{{ git_user_email }}"
73
+ commit -m "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
74
+ chdir: "{{ work_dir }}"
75
+ when: staged.rc == 1
76
+
77
+ - name: "[{{ dest_branch }}] Push source branch"
78
+ ansible.builtin.command:
79
+ cmd: "git push -u origin {{ source_branch }}"
80
+ chdir: "{{ work_dir }}"
81
+ when: staged.rc == 1
82
+
83
+ - name: "[{{ dest_branch }}] Open pull request"
84
+ ansible.builtin.uri:
85
+ url: "{{ api_base }}/repositories/{{ workspace }}/{{ repo_slug }}/pullrequests"
86
+ method: POST
87
+ url_username: "{{ bitbucket_email }}"
88
+ url_password: "{{ bitbucket_token }}"
89
+ force_basic_auth: true
90
+ body_format: json
91
+ body:
92
+ title: "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
93
+ description: "{{ jira_key_client_branding }}: On-Boarding {{ brand_name }} Client Branding"
94
+ source:
95
+ branch:
96
+ name: "{{ source_branch }}"
97
+ destination:
98
+ branch:
99
+ name: "{{ dest_branch }}"
100
+ reviewers: "{{ reviewers }}"
101
+ close_source_branch: true
102
+ return_content: true
103
+ status_code: [201, 400] # 400 tolerated: a PR for this source->dest already exists
104
+ register: pr_response
105
+
106
+ - name: "[{{ dest_branch }}] Record PR result"
107
+ ansible.builtin.set_fact:
108
+ pr_results: >-
109
+ {{ (pr_results | default([])) + [{
110
+ 'destination': dest_branch,
111
+ 'source': source_branch,
112
+ 'status': pr_response.status,
113
+ 'url': (pr_response.json.links.html.href | default('(already exists or not created)'))
114
+ }] }}
@@ -1,9 +1,9 @@
1
- ---
2
- # Constants — the target repository for Client Area onboarding.
3
- api_base: "https://api.bitbucket.org/2.0"
4
- workspace: "xsitesinc"
5
- repo_slug: "web-client-area"
6
- repo_ssh_url: "git@bitbucket.org:xsitesinc/web-client-area.git"
7
-
8
- # Consul (v2 cluster) — source of the release train used to derive destination branches.
9
- consul_url: "https://consul.xsites.xyz"
1
+ ---
2
+ # Constants — the target repository for Client Area onboarding.
3
+ api_base: "https://api.bitbucket.org/2.0"
4
+ workspace: "xsitesinc"
5
+ repo_slug: "web-client-area"
6
+ repo_ssh_url: "git@bitbucket.org:xsitesinc/web-client-area.git"
7
+
8
+ # Consul (v2 cluster) — source of the release train used to derive destination branches.
9
+ consul_url: "https://consul.xsites.xyz"
@@ -0,0 +1,107 @@
1
+ # CRM brand onboarding (Ansible)
2
+
3
+ Automates onboarding a new CRM brand into
4
+ [`web-crm`](https://bitbucket.org/xsitesinc/web-crm): it creates the brand assets and opens
5
+ the pull request(s). Sister automation to [`../onboarding-ca`](../onboarding-ca) — same
6
+ clone / branch / commit / push / PR + Consul-derived branches + 1Password tokens + Jira
7
+ Fix Version pattern, targeting `web-crm` instead of `web-client-area`.
8
+
9
+ Per brand, in the target repo (all delegated to `npx antelope-cli@<version> onboarding-crm`):
10
+
11
+ - `src/ng1/assets/css/sass/variables-colors.scss` — `$<id>` shades + `$colors` entry
12
+ - `src/ng1/assets/css/sass/materialism/themes.scss` — theme maps + `.theme-template-<id>` block
13
+ - `src/assets/brands/<id>/languages/<lang>.json` — one empty file per language
14
+ - `src/configs/configs.ts` — rewritten for the brand (copy into the env's Consul config; gitignored, not committed)
15
+ - `src/configs/brand-logos.json` — `"theme-template-<id>": "<logo_url>"` entry (the committed logo registry)
16
+ - `BRAND_LOCATIONS.md` — sprint-tracking row `<name> -> <id>`
17
+
18
+ This role owns cloning, branching, committing, pushing and PR creation.
19
+
20
+ ## Preconditions (control node)
21
+
22
+ - `git`, Node.js (engines `^16.20.2`) and `npx` on `PATH`.
23
+ - An **SSH key authorized to push** to `xsitesinc/web-crm` (push is over SSH).
24
+ - An **Atlassian API token** (`ATATT…`) for the account in `bitbucket_email`, carrying Bitbucket
25
+ scopes `read:user`, `read:repository`, `read:pullrequest`, `write:pullrequest`. Used only for the
26
+ REST calls (reviewer lookup + PR creation) via **HTTP Basic auth** (`email:token`) — these tokens
27
+ are **not** Bearer tokens. Provide via `--extra-vars` / Ansible Vault, or leave it blank and let
28
+ the playbook fetch it from 1Password (item `jenkins@xsites.co.il`, field `bitbucket_scoped_token`).
29
+ - A **Consul token** with `read` scope on `version/*` (v2 cluster) — used to derive the destination
30
+ branches. Provide via `-e consul_token=…`, `$CONSUL_HTTP_TOKEN`, or the 1Password item
31
+ `New_Consul_Token` / `password`. Not needed when you pass an explicit `dest_branches` override.
32
+ - A **Jira token** (personal ATATT, `jira_email` owns it) for the Fix Version step — see below. Blank
33
+ ⇒ fetched from 1Password (`xvouzkhjw55xffdwyzk5npi2mu` / `my_attlasian_token`). The jenkins service
34
+ account has **no Jira seat**, so its tokens 401 on Jira — use a personal Jira-enabled token.
35
+ - A **signed-in `op` CLI** (`op signin`, or `OP_SERVICE_ACCOUNT_TOKEN`) if you rely on the 1Password
36
+ fallbacks above instead of passing the tokens explicitly.
37
+ - The **`community.general`** collection: `ansible-galaxy collection install -r requirements.yml`.
38
+
39
+ ## Usage
40
+
41
+ Interactive (prompts for the inputs):
42
+
43
+ ```bash
44
+ ansible-playbook onboard-crm.yml
45
+ ```
46
+
47
+ Non-interactive (tokens fall back to 1Password; branches derived from Consul):
48
+
49
+ ```bash
50
+ ansible-playbook onboard-crm.yml \
51
+ -e antelope_id=xyzxx \
52
+ -e brand_name="Zenith Horizon Group" \
53
+ -e crm_type=CORP_FL \
54
+ -e logo_url=https://.../logo.png \
55
+ -e favicon_url=https://.../favicon.png \
56
+ -e languages=en,ar \
57
+ -e fcm_sender_id=123456789 \
58
+ -e jira_key_crm_branding=ATLP-47067
59
+ ```
60
+
61
+ Note: pass token values literally (or via a shell variable). Do **not** prefix a raw `ATATT…`
62
+ token with `$` — the shell would try to expand it and send an empty token.
63
+
64
+ ## Inputs
65
+
66
+ | var | required | example | notes |
67
+ |-----|----------|---------|-------|
68
+ | `antelope_id` | yes | `xyzxx` | Antelope ID → CLI `--brand_id`; keys every generated file + the branch name (normalized lowercase/no-spaces) |
69
+ | `brand_name` | yes | `Zenith Horizon Group` | → CLI `--brand_name`, PR title, configs title |
70
+ | `crm_type` | yes | `CORP_FL` | → CLI `--type`; one of `CORP_FL`, `IB_FL`, `CORP_AFF_FL`, `CORP_AFF_IB_PORTAL`, `CORP_AFF_MSQ` |
71
+ | `logo_url` | yes | *(url)* | → CLI `--logo_url` (black-background logo) |
72
+ | `favicon_url` | yes | *(url)* | → CLI `--favicon_url` |
73
+ | `languages` | yes | `en,ar` | → CLI `--languages`; CSV string **or** a YAML list (`[en, ar]`) |
74
+ | `fcm_sender_id` | yes | `123456789` | → CLI `--fcm_sender_id` (Firebase) |
75
+ | `jira_key_crm_branding` | yes | `ATLP-47067` | PR title prefix + branch name + Jira Fix Version target |
76
+ | `color` | no | `#1a2b3c` | → CLI `--color`; blank ⇒ default `$corp` palette |
77
+ | `base_url` | no | *(url)* | → CLI `--base_url` (configs.ts baseUrl); blank ⇒ CLI default (dev URL) |
78
+ | `bitbucket_token` | no* | *(secret)* | Bitbucket API token; *blank ⇒ 1Password (`jenkins@xsites.co.il` / `bitbucket_scoped_token`)* |
79
+ | `bitbucket_email` | yes | `jenkins@xsites.co.il` | account that owns the token; defaults to the Jenkins service account |
80
+ | `dest_branches` | no | `develop,master-27.0` | comma-separated override; **blank ⇒ derived from Consul**. One PR per branch |
81
+ | `consul_token` | no* | *(secret)* | read scope on `version/*`; *blank ⇒ `$CONSUL_HTTP_TOKEN`, else 1Password (`New_Consul_Token` / `password`)*. Unused when `dest_branches` is set |
82
+ | `jira_token` / `jira_email` | no* | *(secret)* / `eldadp@…` | Jira Basic auth for the Fix Version step; *blank token ⇒ 1Password (`xvouzkhjw55xffdwyzk5npi2mu` / `my_attlasian_token`)* |
83
+ | `manage_jira_fix_version` | no | `true` | set `false` to skip the Fix Version stamping |
84
+ | `reviewers` | no | *(auto)* | default: repo's Bitbucket default-reviewers (author excluded) |
85
+ | `antelope_cli_version` | no | `1.2.3` | pinned published CLI version |
86
+ | `work_dir` | no | `/tmp/onboard-crm/web-crm` | clone location |
87
+
88
+ ## Behavior notes
89
+
90
+ - **Destination branches are derived from the release train in Consul** (unless `dest_branches`
91
+ is passed): `develop` always; `master-<version/prod>`; and `master-<version/staging>` too while a
92
+ release is staged (`version/staging != version/prod`).
93
+ - **One PR per destination branch.** `develop` → `feature/<jira>-onboarding-crm-<id>`;
94
+ `master-*`/`release-*` → `hotfix/<jira>-onboarding-crm-<id>-<ver>` (the `-<ver>` suffix keeps the
95
+ two master branches of a staged release from colliding onto one source branch).
96
+ - **Jira Fix Version** `V<version/prod>` (+ `V<version/staging>` when staged) is stamped on
97
+ `jira_key_crm_branding` **before** the push, so the web-crm DangerJS pipeline is green on first run.
98
+ Additive/idempotent; non-fatal if the token/version is missing (warns and skips).
99
+ - **Reviewers** come from the repo's Bitbucket *Default reviewers* config; the authenticating account
100
+ is excluded (Bitbucket rejects a PR whose author is a reviewer).
101
+ - **Idempotent:** re-running recreates the identical files on the existing source branch, detects no
102
+ staged changes, skips commit/push, and tolerates the "PR already exists" 400.
103
+
104
+ ## Scope
105
+
106
+ CRM only (`web-crm`). Client-Area onboarding is the separate [`../onboarding-ca`](../onboarding-ca)
107
+ playbook.
@@ -0,0 +1,57 @@
1
+ ---
2
+ # Onboard a CRM brand into web-crm and open the PR(s).
3
+ #
4
+ # Destination branches are derived from the release train in Consul (no manual input):
5
+ # develop is always onboarded; master-<version/prod> tracks the live release; while a
6
+ # new release is staged (version/staging != version/prod) its master-<version/staging>
7
+ # exists too and is onboarded as well. Pass -e dest_branches=... to override the lookup.
8
+ #
9
+ # Interactive:
10
+ # ansible-playbook onboard-crm.yml
11
+ #
12
+ # Non-interactive (e.g. from another playbook / CI), pass everything as extra-vars:
13
+ # ansible-playbook onboard-crm.yml \
14
+ # -e antelope_id=xyzxx \
15
+ # -e brand_name="Zenith Horizon Group" \
16
+ # -e crm_type=CORP_FL \
17
+ # -e logo_url=https://.../logo.png \
18
+ # -e favicon_url=https://.../favicon.png \
19
+ # -e languages=en,ar \
20
+ # -e fcm_sender_id=123456789 \
21
+ # -e jira_key_crm_branding=ATLP-47067 \
22
+ # -e consul_token="$CONSUL_HTTP_TOKEN" \ # read scope on version/*; used to derive dest branches
23
+ # -e bitbucket_email=jenkins@xsites.co.il \
24
+ # -e bitbucket_token=ATATT3x... # Atlassian API token WITHOUT a leading '$' (it is a literal, not a shell var)
25
+
26
+ # Preconditions on the control node: git + Node (>=16) + npx, an SSH key authorized to
27
+ # push to xsitesinc/web-crm, and an Atlassian API token (ATATT…) owned by bitbucket_email,
28
+ # carrying Bitbucket scopes read:user / read:repository / read+write:pullrequest. The token
29
+ # is used via HTTP Basic auth (email:token).
30
+ - name: Onboard a CRM brand (web-crm)
31
+ hosts: localhost
32
+ connection: local
33
+ gather_facts: false
34
+
35
+ # Only the required, non-defaulted inputs are prompted. Everything else comes from role
36
+ # defaults: favicon_url + base_url derive from antelope_id/brand_name/crm_server_url; color
37
+ # blank => default palette; bitbucket_email = jenkins service account; bitbucket/consul/jira
38
+ # tokens from 1Password. Override any with -e (e.g. -e base_url=… when crm_server_url is unset).
39
+ vars_prompt:
40
+ - name: antelope_id
41
+ prompt: "Brand Antelope ID — the code identifier used everywhere (e.g. xyzxx)"
42
+ private: false
43
+ - name: brand_name
44
+ prompt: "Brand display name — recorded in BRAND_LOCATIONS.md / configs title (e.g. Zenith Horizon Group)"
45
+ private: false
46
+ - name: crm_type
47
+ prompt: "CRM type (one of: CORP_FL, IB_FL, CORP_AFF_FL, CORP_AFF_IB_PORTAL, CORP_AFF_MSQ)"
48
+ private: false
49
+ - name: languages
50
+ prompt: "Languages — 2-letter codes, comma-separated (e.g. en,ar)"
51
+ private: false
52
+ - name: jira_key_crm_branding
53
+ prompt: "Jira key (e.g. ATLP-47067)"
54
+ private: false
55
+
56
+ roles:
57
+ - onboard_crm
@@ -0,0 +1,8 @@
1
+ ---
2
+ # Ansible collection dependencies for the onboarding-ca playbook.
3
+ # Install with: ansible-galaxy collection install -r requirements.yml
4
+ collections:
5
+ # Provides the community.general.dict_kv filter used to build the Bitbucket
6
+ # reviewers array (roles/onboard_ca/tasks/main.yml).
7
+ - name: community.general
8
+ version: ">=8.0.0"
@@ -0,0 +1,98 @@
1
+ ---
2
+ # Pinned published antelope-cli version that provides the `onboarding-crm` command.
3
+ antelope_cli_version: "1.2.4"
4
+
5
+ # Where web-crm is cloned on the control node.
6
+ work_dir: "/tmp/onboard-crm/web-crm"
7
+
8
+ # --- CRM brand inputs (map to the `onboarding-crm` CLI flags) ------------------------
9
+ # antelope_id => --brand_id (connectedBrandName; keys theme/folder/devBrandName/favicon in configs.ts).
10
+ # REQUIRED: antelope_id, brand_name, crm_type, logo_url, languages. base_url + affiliates_api_url
11
+ # derive from the brand vars in create_brand; pass -e for a standalone run. configs.ts favicon is
12
+ # DERIVED by the CLI (logos-<id>/favicon-<name>.png) and FCMSenderId is always '' (both placeholders).
13
+ antelope_id: ""
14
+ color: "" # --color hex; blank => default palette
15
+ logo_url: "https://logos-{{ antelope_id }}.s3.eu-west-1.amazonaws.com/logo-{{ brand_name }}.png" # brand-logos.json entry; override with -e
16
+ languages: "" # --languages: CSV "en,ar" or a YAML list [en, ar]
17
+ crm_type: "" # --type: one of allowed_crm_types (per-brand; from group_vars derivation)
18
+ # baseUrl uses the BE/CRM domain; affiliatesApiUrl uses the FE/CA domain (fe_server_url_list.0).
19
+ base_url: "{{ ('https://' ~ crm_server_url ~ '/SignalsCRM/') if (crm_server_url | default('') | length > 0) else '' }}"
20
+ affiliates_api_url: "{{ fe_server_url_list.0 | default('') }}"
21
+ arctic_brand: false # --arctic_brand => configs.ts isArcticBrand
22
+ # Consul KV key the generated configs.ts is PUT to (the env CRM config). Needs a consul_token
23
+ # with write on this path. brand_name = the Consul namespace segment (e.g. Antelope/excelttra/crm_env).
24
+ crm_env_consul_key: "Antelope/{{ brand_name }}/crm_env"
25
+ manage_consul_crm_env: true
26
+ # Kept in sync with ALLOWED_TYPES in antelope-cli/onboarding-crm/index.js.
27
+ allowed_crm_types:
28
+ - CORP_FL
29
+ - IB_FL
30
+ - CORP_AFF_FL
31
+ - CORP_AFF_IB_PORTAL
32
+ - CORP_AFF_MSQ
33
+
34
+ # Reviewers for the PR. Empty => auto-fetched from the repo's Bitbucket "Default reviewers"
35
+ # config (the authenticating account is excluded automatically). Override with an explicit
36
+ # list, e.g. [{ account_id: "..." }] or [{ uuid: "{...}" }], to bypass the lookup.
37
+ reviewers: []
38
+
39
+ # Identity used for the commit (control-node git may have no global config).
40
+ git_user_name: "Jenkins"
41
+ git_user_email: "jenkins@xsites.co.il"
42
+
43
+ # Atlassian API token (ATATT…) for the reviewer lookup + PR creation. Sent via HTTP
44
+ # Basic auth together with bitbucket_email — these tokens are NOT Bearer tokens and
45
+ # must carry Bitbucket scopes (read:user, read:repository, read/write:pullrequest).
46
+ # Empty => fetched from 1Password (see onepassword_bitbucket_* below). Provide via
47
+ # --extra-vars or Ansible Vault to skip the lookup; never commit a real value.
48
+ bitbucket_token: ""
49
+
50
+ # Email of the Atlassian account that owns bitbucket_token (the Basic-auth username).
51
+ # Defaults to the Jenkins service account; override via --extra-vars for a different account.
52
+ bitbucket_email: "jenkins@xsites.co.il"
53
+
54
+ # Consul token with read scope on version/* (v2 cluster). Used to derive the destination
55
+ # branches from the release train (version/prod, version/staging). Empty => resolved from
56
+ # $CONSUL_HTTP_TOKEN, else from 1Password (see onepassword_consul_* below). Not needed when
57
+ # an explicit dest_branches override is passed. Never commit a real value.
58
+ consul_token: ""
59
+
60
+ # Explicit destination-branch override (comma-separated). Empty => derived from Consul:
61
+ # develop + master-<version/prod> [+ master-<version/staging> while a release is staged].
62
+ # Set this to bypass the Consul lookup entirely, e.g. dest_branches=develop,master-26.9.
63
+ dest_branches: ""
64
+
65
+ # 1Password fallbacks — used only when the corresponding token is not otherwise provided.
66
+ # Require a signed-in `op` CLI on the control node (op signin, or OP_SERVICE_ACCOUNT_TOKEN).
67
+ # Service-account auth requires an explicit vault for `op item get` by name (op errors
68
+ # with "a vault query must be provided" otherwise) — the items live in the DevOps vault.
69
+ onepassword_vault: "DevOps"
70
+ onepassword_bitbucket_item: "Bitbucket API - jenkins@xsites.co.il"
71
+ onepassword_bitbucket_field: "credential"
72
+ onepassword_consul_item: "New_Consul_Token"
73
+ onepassword_consul_field: "password"
74
+
75
+ # --- Jira automation (DangerJS Fix Version gate) -------------------------------------
76
+ # The web-crm DangerJS pipeline FAILS any PR whose linked Jira issue has no Fix
77
+ # Version ("ATLP-XXXXX doesn't have a fix version") — develop feature branches included,
78
+ # not only hotfix→master. This step stamps the release Fix Version on
79
+ # jira_key_crm_branding BEFORE the branches are pushed (so the pipeline is green on its
80
+ # first run). Non-fatal: a missing jira_token / unmatched version just warns and skips.
81
+ manage_jira_fix_version: true
82
+ jira_base_url: "https://xsites.atlassian.net"
83
+ # Project key — defaults to the prefix of the Jira key (ATLP-47269 -> ATLP).
84
+ jira_project_key: "{{ (jira_key_crm_branding | default('')).split('-')[0] }}"
85
+ # Release version name = jira_version_prefix + <version/prod> (e.g. 27.0 -> V27.0).
86
+ jira_version_prefix: "V"
87
+ # Atlassian API token (ATATT) that carries JIRA scopes + the email that owns it (Basic
88
+ # auth). This is SEPARATE from bitbucket_token, which is Bitbucket-scoped only. Empty =>
89
+ # fetched from 1Password (onepassword_jira_* below). Override via --extra-vars in CI.
90
+ jira_token: ""
91
+ # NOTE: jira_email must own jira_token (Atlassian Basic auth = email:token). jenkins@xsites.co.il
92
+ # now has a Jira seat (2026-07-16) with BROWSE_PROJECTS + EDIT_ISSUES on ATLP; its token is a
93
+ # CLASSIC (unscoped) Atlassian API token stored in the DevOps note 'Jira API - jenkins@xsites.co.il'
94
+ # (field credential). Verified /myself 200 + fixVersions add. NB scoped tokens 401 on Jira REST —
95
+ # must be the classic unscoped kind. (eldadp personal my_attlasian_token still works as a fallback.)
96
+ jira_email: "jenkins@xsites.co.il"
97
+ onepassword_jira_item: "Jira API - jenkins@xsites.co.il"
98
+ onepassword_jira_field: "credential"
@@ -0,0 +1,10 @@
1
+ ---
2
+ galaxy_info:
3
+ role_name: onboard_crm
4
+ author: Antelope Systems
5
+ description: >-
6
+ Onboard a CRM brand: create the brand assets in web-crm
7
+ (via antelope-cli onboarding-crm) and open the pull request(s).
8
+ license: ISC
9
+ min_ansible_version: "2.12"
10
+ dependencies: []