-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plasma-infra: Refactoring deploy documentations artefacts [PR context] #1125
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
86d98a2
chore: refactoring change detection logic
Yakutoc aacb647
ci(deploy-docs): create new workflow for deploy docs artefacts
Yakutoc 3e83234
ci: apply new change detection process
Yakutoc 8059ef3
ci: refactoring theme builder workflows
Yakutoc 43b22d6
ci: refactoring required workflows
Yakutoc 90a5ef9
ci: refactoring perf test workflows
Yakutoc aa71acb
ci: disable old deploy docs workflows
Yakutoc 526379b
ci: refactoring docs main deploy workflows
Yakutoc acf7c49
ci: use `[email protected]`
Yakutoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"PACKAGES_CYPRESS": ["plasma-web", "plasma-b2c", "plasma-ui"], | ||
"PACKAGES_DS": [ | ||
"plasma-web", | ||
"plasma-b2c", | ||
"plasma-ui", | ||
"plasma-new-hope", | ||
"plasma-asdk", | ||
"caldera", | ||
"caldera-online", | ||
"sdds-serv" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = () => { | ||
const { PACKAGES_DS, BASE_URL } = process.env; | ||
|
||
const links = JSON.parse(PACKAGES_DS) | ||
.map((item) => { | ||
const name = item.replace('plasma-', ''); | ||
|
||
return `${name} storybook: ${BASE_URL}/${name}-storybook/`; | ||
}) | ||
.join('\n'); | ||
|
||
return 'Documentation preview deployed!' + '\n\n' + `website:${BASE_URL}/` + '\n' + `${links}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,76 @@ | ||
const CYPRESS_SCOPE = ['@salutejs/plasma-web', '@salutejs/plasma-b2c', '@salutejs/plasma-ui']; | ||
// INFO: HAS_ASSETS - это флаг для управления логикой "@auto-it" плагина upload-assets-extend | ||
// INFO: Изменения в plasma-tokens или plasma-tokens-utils так же повлияют на то что в packagesList окажется plasma-tokens-native | ||
|
||
/** | ||
* Define CI config | ||
* @typedef {object} json | ||
* @property {Array<string>} PACKAGES_CYPRESS | ||
* @property {Array<string>} PACKAGES_DS | ||
*/ | ||
const CONFIG = require('./config-ci.json'); | ||
|
||
module.exports = () => { | ||
const { CHANGED_STATE, AS_ENUMERATION } = process.env; | ||
const { RAW_DATA } = process.env; | ||
|
||
/** | ||
* | ||
* @param CHANGED_STATE Information about the changed state | ||
* @param CHANGED_STATE.name The name of the package. | ||
* @param CHANGED_STATE.version The version of the package. | ||
* @param CHANGED_STATE.private The type of the package. | ||
* @param CHANGED_STATE.location The path of the package. | ||
* @param RAW_DATA Information about the changed state | ||
* @param RAW_DATA.name The name of the package. | ||
* @param RAW_DATA.version The version of the package. | ||
* @param RAW_DATA.private The type of the package. | ||
* @param RAW_DATA.location The path of the package. | ||
* | ||
* @example | ||
* { | ||
* "name": "@salutejs/plasma-website", | ||
* "version": "0.184.0", | ||
* "private": true, | ||
* "location": "/Users/workspace/plasma/website/plasma-website" | ||
* "location": ".../plasma/website/plasma-website" | ||
* } | ||
*/ | ||
const changedState = JSON.parse(JSON.parse(CHANGED_STATE)); | ||
const rawData = JSON.parse(RAW_DATA).map(({ name }) => name); | ||
|
||
if (!changedState || !changedState.length) { | ||
return { SCOPE: [], HAS_SCOPE: false }; | ||
if (!rawData || !rawData.length) { | ||
return { | ||
RAW_DATA: [], | ||
PACKAGES_CYPRESS_RUN: [], | ||
PACKAGES_DOCUMENTATIONS_RUN: [], | ||
PROCESSED_DATA: [], | ||
HAS_PACKAGES_CYPRESS_RUN: false, | ||
HAS_PACKAGES_DS_CHANGES: false, | ||
HAS_ASSETS: false, | ||
}; | ||
} | ||
|
||
/** | ||
* Processed data - packages name without "@salutejs/" | ||
* @example | ||
* ['@salutejs/plasma-ui-docs', '@salutejs/plasma-ui', '@salutejs/plasma-core'] | ||
* ["plasma-web", "plasma-ui", "caldera"] | ||
*/ | ||
const packagesList = changedState.map(({ name }) => name); | ||
|
||
const HAS_PLASMA_UI_DOCS = packagesList.includes('@salutejs/plasma-ui-docs'); | ||
const HAS_PLASMA_WEB_DOCS = packagesList.includes('@salutejs/plasma-web-docs'); | ||
|
||
const HAS_PLASMA_UI = packagesList.includes('@salutejs/plasma-ui'); | ||
const HAS_PLASMA_WEB = packagesList.includes('@salutejs/plasma-web'); | ||
const HAS_PLASMA_B2C = packagesList.includes('@salutejs/plasma-b2c'); | ||
const HAS_PLASMA_HOPE = packagesList.includes('@salutejs/plasma-new-hope'); | ||
const HAS_PLASMA_ASDK = packagesList.includes('@salutejs/plasma-asdk'); | ||
const HAS_CALDERA = packagesList.includes('@salutejs/caldera'); | ||
const HAS_CALDERA_ONLINE = packagesList.includes('@salutejs/caldera-online'); | ||
const HAS_SDDS_SERV = packagesList.includes('@salutejs/sdds-serv'); | ||
const HAS_PLASMA_WEBSITE = packagesList.includes('@salutejs/plasma-website'); | ||
|
||
const HAS_DOCUMENTATION_CHANGED = | ||
HAS_PLASMA_WEBSITE || | ||
HAS_PLASMA_UI_DOCS || | ||
HAS_PLASMA_WEB_DOCS || | ||
HAS_PLASMA_ASDK || | ||
HAS_CALDERA || | ||
HAS_CALDERA_ONLINE || | ||
HAS_SDDS_SERV; | ||
|
||
// Флаг для управления логикой "@auto-it" плагина upload-assets-extend | ||
// Изменения в plasma-tokens или plasma-tokens-utils так же повлияют на то что в packagesList окажется plasma-tokens-native | ||
const HAS_ASSETS = packagesList.includes('@salutejs/plasma-tokens-native'); | ||
const PROCESSED_DATA = rawData.map((item) => item.replace('@salutejs/', '')); | ||
|
||
/** | ||
* List short packages name | ||
* List short packages name for run cypress test | ||
* @example | ||
* ["web", "ui", "b2c"] | ||
*/ | ||
const scope = packagesList.filter((item) => CYPRESS_SCOPE.includes(item)).map((item) => `"${item.split('-')[1]}"`); | ||
const PACKAGES_CYPRESS_RUN = PROCESSED_DATA.filter((item) => CONFIG.PACKAGES_CYPRESS.includes(item)).map((item) => | ||
item.replace('plasma-', ''), | ||
); | ||
|
||
/** | ||
* Enumeration packages name | ||
* List packages who has a documentations artifacts: storybook, docusaurus | ||
* @example | ||
* ["plasma-web", "plasma-ui", "plasma-b2c"] | ||
* ["plasma-web", "caldera", "sdds-serv"] | ||
*/ | ||
const packagesEnumeration = AS_ENUMERATION === 'true' ? packagesList.map((item) => `"${item.split('/')[1]}"`) : []; | ||
|
||
console.log('packagesEnumeration =>', packagesEnumeration); | ||
console.log('packagesList =>', packagesList); | ||
const PACKAGES_DOCUMENTATIONS_RUN = PROCESSED_DATA.filter((item) => CONFIG.PACKAGES_DS.includes(item)); | ||
|
||
return { | ||
SCOPE: JSON.stringify(scope), | ||
PACKAGES_ENUMERATION: JSON.stringify(packagesEnumeration), | ||
HAS_SCOPE: Boolean(scope.length), | ||
HAS_DOCUMENTATION_CHANGED, | ||
HAS_PLASMA_UI_DOCS, | ||
HAS_PLASMA_WEB_DOCS, | ||
HAS_PLASMA_UI, | ||
HAS_PLASMA_WEB, | ||
HAS_PLASMA_B2C, | ||
HAS_PLASMA_HOPE, | ||
HAS_PLASMA_ASDK, | ||
HAS_ASSETS, | ||
HAS_CALDERA, | ||
HAS_CALDERA_ONLINE, | ||
HAS_SDDS_SERV, | ||
RAW_DATA: JSON.stringify(rawData), | ||
PACKAGES_DOCUMENTATIONS_RUN: JSON.stringify(PACKAGES_DOCUMENTATIONS_RUN), | ||
PACKAGES_CYPRESS_RUN: JSON.stringify(PACKAGES_CYPRESS_RUN), | ||
PROCESSED_DATA: JSON.stringify(PROCESSED_DATA), | ||
HAS_PACKAGES_CYPRESS_RUN: Boolean(PACKAGES_CYPRESS_RUN.length), | ||
HAS_PACKAGES_DS_CHANGES: Boolean(PACKAGES_DOCUMENTATIONS_RUN.length), | ||
HAS_ASSETS: PROCESSED_DATA.includes('plasma-tokens-native'), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а что такое DS ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yeti-or design system типа вертикаль.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не, это не вертикали же. Это именно библиотеки