@unisphere/nx 1.24.1 → 1.24.2
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/dist/migrations/1-24-2/force-always-for-applications.d.ts +3 -0
- package/dist/migrations/1-24-2/force-always-for-applications.d.ts.map +1 -0
- package/dist/migrations/1-24-2/force-always-for-applications.js +36 -0
- package/dist/migrations/1-24-2/templates/_publish-artifacts.template +306 -0
- package/migrations.json +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force-always-for-applications.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-24-2/force-always-for-applications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
async function update(tree) {
|
|
8
|
+
devkit_1.logger.info('🔄 force deploy of applications even when not having runtimes in the repo');
|
|
9
|
+
// Ensure .github/workflows directory exists
|
|
10
|
+
if (!tree.exists('.github')) {
|
|
11
|
+
tree.write('.github/.gitkeep', '');
|
|
12
|
+
devkit_1.logger.info('✅ Created .github directory');
|
|
13
|
+
}
|
|
14
|
+
if (!tree.exists('.github/workflows')) {
|
|
15
|
+
tree.write('.github/workflows/.gitkeep', '');
|
|
16
|
+
devkit_1.logger.info('✅ Created .github/workflows directory');
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
// Update _publish-artifacts.yml
|
|
20
|
+
const publishArtifactsWorkflowPath = '.github/workflows/_publish-artifacts.yml';
|
|
21
|
+
const publishArtifactsTemplatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
|
|
22
|
+
const publishArtifactsTemplateContent = (0, fs_1.readFileSync)(publishArtifactsTemplatePath, 'utf-8');
|
|
23
|
+
const publishArtifactsExists = tree.exists(publishArtifactsWorkflowPath);
|
|
24
|
+
tree.write(publishArtifactsWorkflowPath, publishArtifactsTemplateContent);
|
|
25
|
+
if (publishArtifactsExists) {
|
|
26
|
+
devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath} `);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
devkit_1.logger.error(`❌ Failed to update GitHub workflows: ${error?.message || 'Unknown error'}`);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
name: Shared Deployment Jobs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check-elements:
|
|
8
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
9
|
+
outputs:
|
|
10
|
+
has_packages: ${{ steps.check.outputs.has_packages }}
|
|
11
|
+
has_runtimes: ${{ steps.check.outputs.has_runtimes }}
|
|
12
|
+
has_applications: ${{ steps.check.outputs.has_applications }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Repo
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
18
|
+
fetch-tags: true
|
|
19
|
+
|
|
20
|
+
- name: Check elements in .unisphere
|
|
21
|
+
id: check
|
|
22
|
+
run: |
|
|
23
|
+
if [ -f .unisphere ]; then
|
|
24
|
+
PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
|
|
25
|
+
RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
|
|
26
|
+
APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
|
|
27
|
+
|
|
28
|
+
if [ "$PACKAGES" -gt 0 ]; then
|
|
29
|
+
echo "has_packages=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ "$RUNTIMES" -gt 0 ]; then
|
|
35
|
+
echo "has_runtimes=true" >> $GITHUB_OUTPUT
|
|
36
|
+
else
|
|
37
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ "$APPLICATIONS" -gt 0 ]; then
|
|
41
|
+
echo "has_applications=true" >> $GITHUB_OUTPUT
|
|
42
|
+
else
|
|
43
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
44
|
+
fi
|
|
45
|
+
else
|
|
46
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
48
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
prepare-runtimes:
|
|
52
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
53
|
+
if: needs.check-elements.outputs.has_runtimes == 'true'
|
|
54
|
+
needs: check-elements
|
|
55
|
+
outputs:
|
|
56
|
+
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
57
|
+
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
58
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout Repo
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
with:
|
|
63
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
64
|
+
fetch-tags: true
|
|
65
|
+
- name: Setup Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version-file: '.nvmrc'
|
|
69
|
+
- name: Clean workspace
|
|
70
|
+
run: git reset --hard HEAD
|
|
71
|
+
- name: Clean npm cache
|
|
72
|
+
run: npm cache clean --force
|
|
73
|
+
|
|
74
|
+
- name: Setup JFrog
|
|
75
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
76
|
+
id: setup-jfrog
|
|
77
|
+
env:
|
|
78
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
79
|
+
with:
|
|
80
|
+
oidc-provider-name: ovp-github-oidc
|
|
81
|
+
|
|
82
|
+
- name: Install dependencies
|
|
83
|
+
run: npm ci --ignore-scripts
|
|
84
|
+
env:
|
|
85
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
87
|
+
|
|
88
|
+
- name: Prepare Unisphere Elements
|
|
89
|
+
id: prepare-runtimes
|
|
90
|
+
run: npx unisphere runtime publish prepare --verbose
|
|
91
|
+
- name: Capture Commit SHA
|
|
92
|
+
id: capture_commit_sha
|
|
93
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
94
|
+
- name: Set commit_sha as output
|
|
95
|
+
id: set_commit_sha
|
|
96
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
97
|
+
- uses: actions/upload-artifact@v4
|
|
98
|
+
id: upload-unisphere-elements-artifacts
|
|
99
|
+
with:
|
|
100
|
+
name: unisphere-elements
|
|
101
|
+
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
102
|
+
retention-days: 1
|
|
103
|
+
|
|
104
|
+
deploy-packages:
|
|
105
|
+
if: needs.check-elements.outputs.has_packages == 'true'
|
|
106
|
+
needs: check-elements
|
|
107
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
108
|
+
steps:
|
|
109
|
+
- name: Checkout Repo
|
|
110
|
+
uses: actions/checkout@v4
|
|
111
|
+
with:
|
|
112
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
113
|
+
fetch-tags: true
|
|
114
|
+
- name: Setup Node.js
|
|
115
|
+
uses: actions/setup-node@v4
|
|
116
|
+
with:
|
|
117
|
+
node-version-file: '.nvmrc'
|
|
118
|
+
|
|
119
|
+
- name: Setup JFrog
|
|
120
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
121
|
+
id: setup-jfrog
|
|
122
|
+
env:
|
|
123
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
124
|
+
with:
|
|
125
|
+
oidc-provider-name: ovp-github-oidc
|
|
126
|
+
|
|
127
|
+
- name: Install dependencies
|
|
128
|
+
run: |
|
|
129
|
+
npm ci --ignore-scripts
|
|
130
|
+
|
|
131
|
+
env:
|
|
132
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
134
|
+
|
|
135
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
136
|
+
id: get-npm-token
|
|
137
|
+
run: |
|
|
138
|
+
NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:eu-central-1:785328604905:secret:unisphere-secrets-um86Cs --query SecretString --output text | jq -r '."NPM_UNISPHERE_TOKEN"')
|
|
139
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
140
|
+
# Debug token existence (safely)
|
|
141
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
142
|
+
- name: Deploy to registry
|
|
143
|
+
run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
144
|
+
|
|
145
|
+
deploy-runtimes:
|
|
146
|
+
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
147
|
+
needs: prepare-runtimes
|
|
148
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
149
|
+
strategy:
|
|
150
|
+
matrix:
|
|
151
|
+
envs_regions:
|
|
152
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
153
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
154
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
155
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
156
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
157
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
158
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
159
|
+
fail-fast: false
|
|
160
|
+
|
|
161
|
+
steps:
|
|
162
|
+
- name: Check available disk space
|
|
163
|
+
run: df -h
|
|
164
|
+
- name: Checkout Repo at specific commit
|
|
165
|
+
uses: actions/checkout@v4
|
|
166
|
+
with:
|
|
167
|
+
ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
|
|
168
|
+
fetch-tags: true
|
|
169
|
+
- name: Setup Node.js
|
|
170
|
+
uses: actions/setup-node@v4
|
|
171
|
+
with:
|
|
172
|
+
node-version-file: '.nvmrc'
|
|
173
|
+
|
|
174
|
+
- name: Setup JFrog
|
|
175
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
176
|
+
id: setup-jfrog
|
|
177
|
+
env:
|
|
178
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
179
|
+
with:
|
|
180
|
+
oidc-provider-name: ovp-github-oidc
|
|
181
|
+
|
|
182
|
+
- name: Install dependencies
|
|
183
|
+
run: |
|
|
184
|
+
npm ci --ignore-scripts
|
|
185
|
+
env:
|
|
186
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
187
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
188
|
+
|
|
189
|
+
- name: Download artifacts folder
|
|
190
|
+
uses: actions/download-artifact@v4
|
|
191
|
+
with:
|
|
192
|
+
name: unisphere-elements
|
|
193
|
+
path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
|
|
194
|
+
- name: Sync S3 bucket
|
|
195
|
+
run: |
|
|
196
|
+
npx unisphere runtime publish execute \
|
|
197
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
198
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
199
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
200
|
+
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
201
|
+
--verbose
|
|
202
|
+
|
|
203
|
+
prepare-applications:
|
|
204
|
+
if: always() && needs.check-elements.outputs.has_applications == 'true'
|
|
205
|
+
needs: [deploy-runtimes, check-elements]
|
|
206
|
+
runs-on:
|
|
207
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
208
|
+
- instance-size:medium
|
|
209
|
+
outputs:
|
|
210
|
+
unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
211
|
+
hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
|
|
212
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
213
|
+
steps:
|
|
214
|
+
- name: Checkout Repo
|
|
215
|
+
uses: actions/checkout@v4
|
|
216
|
+
with:
|
|
217
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
218
|
+
fetch-tags: true
|
|
219
|
+
- name: Setup Node.js
|
|
220
|
+
uses: actions/setup-node@v4
|
|
221
|
+
with:
|
|
222
|
+
node-version-file: '.nvmrc'
|
|
223
|
+
- name: Clean workspace
|
|
224
|
+
run: git reset --hard HEAD
|
|
225
|
+
- name: Clean npm cache
|
|
226
|
+
run: npm cache clean --force
|
|
227
|
+
- name: Setup JFrog
|
|
228
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
229
|
+
id: setup-jfrog
|
|
230
|
+
env:
|
|
231
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
232
|
+
with:
|
|
233
|
+
oidc-provider-name: ovp-github-oidc
|
|
234
|
+
- name: Install dependencies
|
|
235
|
+
run: npm ci --ignore-scripts
|
|
236
|
+
env:
|
|
237
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
238
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
239
|
+
- name: Prepare Unisphere Applications
|
|
240
|
+
id: prepare-applications
|
|
241
|
+
run: npx unisphere application publish prepare --verbose
|
|
242
|
+
- name: Capture Commit SHA
|
|
243
|
+
id: capture_commit_sha
|
|
244
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
245
|
+
- name: Set commit_sha as output
|
|
246
|
+
id: set_commit_sha
|
|
247
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
248
|
+
- uses: actions/upload-artifact@v4
|
|
249
|
+
id: upload-unisphere-applications-artifacts
|
|
250
|
+
with:
|
|
251
|
+
name: unisphere-applications
|
|
252
|
+
path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
253
|
+
retention-days: 1
|
|
254
|
+
|
|
255
|
+
deploy-applications:
|
|
256
|
+
if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
257
|
+
needs: [prepare-applications]
|
|
258
|
+
runs-on:
|
|
259
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
260
|
+
- instance-size:medium
|
|
261
|
+
strategy:
|
|
262
|
+
matrix:
|
|
263
|
+
envs_regions:
|
|
264
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
265
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
266
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
267
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
268
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
269
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
270
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
271
|
+
fail-fast: false
|
|
272
|
+
steps:
|
|
273
|
+
- name: Checkout Repo at specific commit
|
|
274
|
+
uses: actions/checkout@v4
|
|
275
|
+
with:
|
|
276
|
+
ref: ${{ needs.prepare-applications.outputs.commit_sha }}
|
|
277
|
+
fetch-tags: true
|
|
278
|
+
- name: Setup Node.js
|
|
279
|
+
uses: actions/setup-node@v4
|
|
280
|
+
with:
|
|
281
|
+
node-version-file: '.nvmrc'
|
|
282
|
+
- name: Setup JFrog
|
|
283
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
284
|
+
id: setup-jfrog
|
|
285
|
+
env:
|
|
286
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
287
|
+
with:
|
|
288
|
+
oidc-provider-name: ovp-github-oidc
|
|
289
|
+
- name: Install dependencies
|
|
290
|
+
run: npm ci --ignore-scripts
|
|
291
|
+
env:
|
|
292
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
293
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
294
|
+
- name: Download artifacts folder
|
|
295
|
+
uses: actions/download-artifact@v4
|
|
296
|
+
with:
|
|
297
|
+
name: unisphere-applications
|
|
298
|
+
path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
|
|
299
|
+
- name: Sync S3 bucket
|
|
300
|
+
run: |
|
|
301
|
+
npx unisphere application publish execute \
|
|
302
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
303
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
304
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
305
|
+
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
306
|
+
--verbose
|
package/migrations.json
CHANGED
|
@@ -90,6 +90,11 @@
|
|
|
90
90
|
"version": "1.23.2",
|
|
91
91
|
"description": "Update .nvmrc to Node 24",
|
|
92
92
|
"factory": "./dist/migrations/1-23-2/update-nvmrc.js"
|
|
93
|
+
},
|
|
94
|
+
"1-24-2-force-always-for-applications": {
|
|
95
|
+
"version": "1.24.2",
|
|
96
|
+
"description": "Force always deploy applications in GitHub workflow",
|
|
97
|
+
"factory": "./dist/migrations/1-24-2/force-always-for-applications.js"
|
|
93
98
|
}
|
|
94
99
|
},
|
|
95
100
|
"packageJsonUpdates": {
|