๐ ๋ฒ์ -๋ก์ผ ๐
๐ ๋ฒ์ -๋ก์ผ ๐
์์ด | ็ฎไฝไธญๆ
์ฌ์ดํธ์ ์ ๋ฒ์ ์ ์ฌ์ฉํ ์ ์์ ๋ ์ฌ์ฉ์์๊ฒ ์๋ฆฌ๊ณ ํ์ด์ง๋ฅผ ์๋ก ๊ณ ์น๋ผ๋ ๋ฉ์์ง๋ฅผ ํ์ํฉ๋๋ค.
์ฑ ๋ฐฐํฌ๋ฅผ ์๋ฃํ๋ฉด Lark ๊ทธ๋ฃน ์ฑํ
์ ๋ฐฐํฌ ๋ฉ์์ง๋ฅผ ๋ณด๋
๋๋ค.
์ ๋ํ
version-rocket์ ์๊ฒฉ ์๋ฒ์ ๋ฒ์ ํ์ผ์ ๋ํด ์ฌ์ฉ์์ ํ์ฌ ๋ธ๋ผ์ฐ์ ์ ์๋ ๋ฒ์ ์ ํ์ธํฉ๋๋ค.
์ ๋ฒ์ ์ ์ฌ์ฉํ ์ ์๋ ๊ฒฝ์ฐ ์ ๋ฒ์ ์
๋ฐ์ดํธ ํ๋กฌํํธ๊ฐ ํ์๋๊ณ ์ฌ์ฉ์์๊ฒ ํ์ด์ง๋ฅผ ์๋ก ๊ณ ์น ์ ์๋ ์์
๋ฒํผ์ด ์ ๊ณต๋ฉ๋๋ค. ๋๋ version-rocket์ด ์ฌ์ฉ์ ์ง์ ์ฌ์ฉ์ ์ธํฐํ์ด์ค๋ฅผ ์ง์ํ๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์์ ํ์ฌ ์๋ ค์ค ์ ์์ต๋๋ค.
์ฐ๋ฆฌ๋ ํด๋ง ๋ฃจํ๋ฅผ ์ํํ๊ธฐ ์ํด javascript ๊ธฐ๋ฐ์ Web Worker API๋ฅผ ์ฌ์ฉํ๋ฉฐ ๋ธ๋ผ์ฐ์ ๋ ๋๋ง ํ๋ก์ธ์ค์ ์ํฅ์ ๋ฏธ์น์ง ์์ต๋๋ค.
ํน์ง
์คํฌ๋ฆฐ์ท
์ฉ๋ฒ
์ค์น
npm install version-rocket -S
์์ํ๋ค
// 1. Import version-rocket, and invoke pollingCompareVersion method
import { pollingCompareVersion } from 'version-rocket'
import { version } from '../package.json'
/**
* @param 1: current version
* @param 2: remote server version.json file path
* @param 3: time interval of rotation monitoring (in ms), default 5000ms
* @param 4: custom version tip ui callback(optional)
*/
pollingCompareVersion(version, `${location.origin}/version.json`, 30000, (data) => {
console.log(data)
})
/**
* 2.
* generate-version-file shortcut command to create the version.json file.
* The parameter is the directory where you want to create version.json.
* If you don't pass the parameter, it will be created in the dist directory by default.
*/
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"generate:version": "generate-version-file dist public"
...
},
...
}
๋ผํฌ ๋ก๋ด์ด ์์นํ ๋จ์ฒด ์ฑํ ๋ฐฉ์ ๋ฐฐํฌ ์ฑ๊ณต ๋ฉ์์ง๋ฅผ ํธ์ํ๊ณ ์ถ๋ค๋ฉด ๊ณ์ ์งํํด์ฃผ์ธ์.
/**
* 3.
* You need to create a send-lark-config.json file first, it store the field for setting the copy for the message card.
* Then, you can just execute the send-lark-message shortcut command. By default, the send-lark-config.json file in the current path is selected.
* If you want to customize the file path and file name, you can set the MESSAGE_PATH parameter to pass it in.
*/
{
"name": "test",
"description": "test",
"private": true,
"version": "0.0.1",
"scripts": {
...
"send-lark-message:test": "MESSAGE_PATH=./lark-message-config.json send-lark-message"
...
},
...
}
// send-lark-config.json example
{
// card title
"title": "TEST FE Deployed Successfully",
// deploy project name
"projectName": "TEST",
// deploy branch name
"branch": "Staging",
// project url
"accessUrl": "https://test.com",
// remind group chat members: true/false
"isNotifyAll": true,
// lark robot webhook url
"larkWebHook": "https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxx",
// deploy type
"deployTools": "Jenkins",
// the deploy time zone that you want to display, default "Asia/Shanghai"
"expectConvertToTimezone": "America/New_York"
}
๋งํฌ
Reference
์ด ๋ฌธ์ ์ ๊ดํ์ฌ(๐ ๋ฒ์ -๋ก์ผ ๐), ์ฐ๋ฆฌ๋ ์ด๊ณณ์์ ๋ ๋ง์ ์๋ฃ๋ฅผ ๋ฐ๊ฒฌํ๊ณ ๋งํฌ๋ฅผ ํด๋ฆญํ์ฌ ๋ณด์๋ค https://dev.to/akimyou/version-rocket-3m55ํ ์คํธ๋ฅผ ์์ ๋กญ๊ฒ ๊ณต์ ํ๊ฑฐ๋ ๋ณต์ฌํ ์ ์์ต๋๋ค.ํ์ง๋ง ์ด ๋ฌธ์์ URL์ ์ฐธ์กฐ URL๋ก ๋จ๊ฒจ ๋์ญ์์ค.
์ฐ์ํ ๊ฐ๋ฐ์ ์ฝํ ์ธ ๋ฐ๊ฒฌ์ ์ ๋ (Collection and Share based on the CC Protocol.)
์ข์ ์นํ์ด์ง ์ฆ๊ฒจ์ฐพ๊ธฐ
๊ฐ๋ฐ์ ์ฐ์ ์ฌ์ดํธ ์์ง
๊ฐ๋ฐ์๊ฐ ์์์ผ ํ ํ์ ์ฌ์ดํธ 100์ ์ถ์ฒ ์ฐ๋ฆฌ๋ ๋น์ ์ ์ํด 100๊ฐ์ ์์ฃผ ์ฌ์ฉํ๋ ๊ฐ๋ฐ์ ํ์ต ์ฌ์ดํธ๋ฅผ ์ ๋ฆฌํ์ต๋๋ค