ãã©ãããã©ã¼ã ã°ã«ã¼ãã§ã¤ã³ãã©ã¨ã³ã¸ãã¢ããã¦ãã @laughk ã§ãã ä»åã¯ãå½ç¤¾ã® ECS Scheduled Task ã®ç®¡çãªãã¸ããªã解ä½ããåã¢ããªã±ã¼ã·ã§ã³ã®ãªãã¸ããªã¸ç§»ç®¡ãã話ãç´¹ä»ãã¾ãã
- èæ¯
- ãªãä¸å 管çãã¦ãããªãã¸ããªã解ä½ããã®ã
- 解ä½ãã移管ã®æ¦è¦
- 解ä½ãã移管ã®éã«æèã»å·¥å¤«ãããã¨
- ãããå°ç¨ãªãã¸ããªã解ä½ãã¦ã©ããªã£ã¦ããã
èæ¯
ã³ãããã§ã¯ãECS Scheduled Task ã®ç®¡çãä¸å 管çãããªãã¸ããªãããã¾ããããã®ãªãã¸ããªã§ã¯ ecschedule ã¨ãããã¼ã«ã使ã£ã¦ EventBridge ã®ã«ã¼ã«ã YAML ã§ç®¡çãããã㦠ECS ã®ã¿ã¹ã¯å®ç¾©ãJSONã§ç®¡çããGitHub Actions çµç±ã§ EventBridge ã«ã¼ã«ã®é©ç¨ã ecschedule apply ã§è¡ãã¨ãããã®ã§ãããecschedule ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºã§å°å ¥ã®è©±ãæ¸ãã¦ãã¾ãã
ãã®ãªãã¸ããªã§ã¯ã3ã¤ã®ãããã¯ãã® EventBridge ã®ã«ã¼ã«ãä¸å 管çããã¦ãã¾ããã
ããã¯å°å ¥å½åã¯åãããã¯ãã®ãããã¤ãã¼ã«ã§ ecs-deploy ã使ã£ã¦ããé¢ä¿ã§ ECS ãµã¼ãã¹ãã¿ã¹ã¯å®ç¾©ãªã©ã®ãªã½ã¼ã¹ãã³ã¼ã管çããã¨ããç¿æ £èªä½ãç¡ãã£ããã¨ã«ç±æ¥ãã¾ããECS é¢é£ã®ãªã½ã¼ã¹ã®ç®¡çãããå ´æãå®ã¾ã£ã¦ããããecschedule ã§å¿ è¦ã¨ãããå®æå®è¡ãããã® EventBridge ã®ã«ã¼ã«ã管çãã YAML ãã¡ã¤ã«ãå«ãé©åãªç®¡çå ´æãç¡ãã£ããããç¬ç«ãããªãã¸ããªãç¨æããçµç·¯ãããã¾ãã
ãªããå®æå®è¡ãããã§å©ç¨ãã ECS ã¿ã¹ã¯å®ç¾©ã® JSON ãåæ§ã®ç¶æ³ã§ããããå¾è¿°ããããã« ecspresso ã®å°å ¥ã«ãã£ã¦ Web ã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ã¨ã¾ã¨ãã¦ç®¡çãããããã«ãªãã¾ããã
ãªãä¸å 管çãã¦ãããªãã¸ããªã解ä½ããã®ã
ecschedule ã§ç®¡çãã¦ãããªãã¸ããªã解ä½ããçç±ã¯ã主ã«ä»¥ä¸ã®2ç¹ã§ãã
- ECS é¢é£ã®ãããã¤ã»ãªã½ã¼ã¹ã®ç®¡çç¶æ³ãå¤ãã£ã
- ecschedule ã®éç¨ãå®å®ãããããã¯ãã®ãªãã¸ããªããç¬ç«ãã¦ããç¶æ³ãç ©ããããªã£ã
çµæã¨ãã¦ã ecschedule ã§ç®¡çãã¦ãããªãã¸ããªã解ä½ããåãããã¯ãã®ãªãã¸ããªã« ecschedule ç¨ã® YAML ãã¡ã¤ã«ã®ç®¡ç㨠CI/CD ãªã©ã®èªååãããä»çµã¿ã移管ãã¾ããã
ECSé¢é£ã®ãããã¤ã»ãªã½ã¼ã¹ã®ç®¡çç¶æ³ãå¤ãã£ã
ecs-deploy ãã ecspresso ã«ç§»è¡ãããã¨ã§ãã¿ã¹ã¯å®ç¾©ããããã¤å¨ãã®ã³ã¼ãåããããã¤ã® CI/CD åãé²ã¿ã¾ããã ç¹ã«ããã¾ã§ Web ã¢ããªã±ã¼ã·ã§ã³ç¨ã® ECS ã¿ã¹ã¯å®ç¾©ã¨å®æå®è¡ãããç¨ã® ECS ã¿ã¹ã¯å®ç¾©ãå¥ã ã«ç®¡çããã¦ããã®ããecspresso ã«ãã£ã¦ãããã¤ãå«ãã¦å ±éåããããã¨ã大ããã§ãã
ecspresso å°å ¥å¾ã« Web ã¢ããªã±ã¼ã·ã§ã³ã¨å®æå®è¡ãããç¨ã® ECS ã¿ã¹ã¯å®ç¾©æ´æ°ã®å ±éåã«ã¤ãã¦ã¯ã以ä¸ã®ã¹ã©ã¤ãã«ã¾ã¨ãã¦ããã®ã§èå³ã®ããæ¹ã¯ã覧ãã ããã
çµæãå®æå®è¡ãããã® EventBridge ã®ã«ã¼ã«ã ããå¥ã®ãªãã¸ããªã«åããã¦ããç¶æ³ãããã£ã¦æéã«ãªãã¾ããã
ecschedule ã®éç¨ã®å®å®ãããããã¯ãã®ãªãã¸ããªããç¬ç«ãã¦ããç¶æ³ãç ©ããããªã£ã
ecschedule å°å ¥å½åã¯ãã¼ã«ã«æ±ããªãã¦ããªãã¡ã³ãã¼ãå¤ããã¡ãã£ã¨ããè¨è¼æ¹æ³ã®ãã¹ãè¨å®æ¼ããçºçããã±ã¼ã¹ããããã¤ã³ãã©ã¨ã³ã¸ãã¢ãä¸å¤®é権çã«ç®¡çããæ義ã¯ããã¾ããã
ããããåé¡ãçºçãããã¨ã«ãã§ãã¯ã¹ã¯ãªãããç¨æã㦠CI/CD ã§ãã§ãã¯ãã対å¿ãç¹°ãè¿ãã¦ãããã¡ã«ãã©ãã«ãçºçããã±ã¼ã¹ã¯ãªããªããçµæã¨ãã¦ã¤ã³ãã©ã¨ã³ã¸ãã¢ãä»å ¥ããå¿ è¦ã¯ã»ã¨ãã©ãªããªãã¾ããã
ãããå®æå®è¡ãããã®è¿½å ã»å¤æ´ã»åé¤ã«ã¤ãã¦ã¯é¢é£ããæ©è½ãå®è£ ããéçºã¡ã³ãã¼ã»ãã¼ã ã®ã»ããç¶æ³ãé©åã«ææ¡ãã¦ããã±ã¼ã¹ãã»ã¨ãã©ã®ãããã¤ã³ãã©ã¨ã³ã¸ãã¢ã管çãã¦ãããªãã¸ããªã«å¯¾ãã¦å¥ã§ Pull Request ãåºãéç¨ãããããå®æ ã«è¦åã£ã¦ããªããã®ã«ãªã£ã¦ããç¶æ³ã§ããã
解ä½ãã移管ã®æ¦è¦
ecschedule ç¨ã® YAML ãã¡ã¤ã«ãä¸å 管çãã¦ãããªãã¸ããªã®è§£ä½ã¨åã¢ããªã±ã¼ã·ã§ã³ã®ãªãã¸ããªã¸ã®ç§»ç®¡ã®æ¦è¦ã¯ä¸å³ã®ã¤ã¡ã¼ã¸ã§ãããªãã¸ããªã®ãã£ã¬ã¯ããªãã¨ã«åããã¦ãããã®ãã対å¿ããã¢ããªã±ã¼ã·ã§ã³ã®ãªãã¸ããªã«ç§»ç®¡ãã¾ããã
解ä½ãã移管ã®éã«æèã»å·¥å¤«ãããã¨
ãªãã¸ããªã®è§£ä½ããè¨å®ãã¡ã¤ã«ã®ç§»ç®¡ã®éã«æèã»å·¥å¤«ãããã¨ã¯ä»¥ä¸ã®éãã§ãã
- git log 㯠git filter-repo ã使ã£ã¦ git log ãä¿æããç¶æ ã§ç§»ç®¡
- ã³ã¼ãã ã移管ããã®ã§ã¯ãªã CI/CD ã«ããèªååãã»ããã人ããã¼ã ã«ç§»ç®¡ããã®ã§ã¯ãªãããã¼ã«ã»ä»çµã¿ã«ç§»ç®¡ãã
- ãããã¤ã§æ±ã CLI ãã¼ã«ã¯ aqua ã§ç®¡ç
git log 㯠git filter-repo ã使ã£ã¦ä¿æããç¶æ ã§ç§»ç®¡
ecschedule åãã®è¨å®ãã¡ã¤ã«ãåç´ã«ç§»ç®¡ãããã¨ã¯ç°¡åã§ãã ãããããããªãã®æééç¨ãã¦ãããã®ã§ãããããéå»ã®çµç·¯ã¯ã§ããéã追跡å¯è½ã«ãã¦ããããã§ãã
ãã㧠git filter-repo ã使ã£ã¦ãéå»ã®ã³ãããå±¥æ´ãä¿æããã¾ã¾ãªãã¸ããªã移管ãã¾ããã 1 git æ¬ä½ã«ã¯å«ã¾ãã¦ããªãããã追å 㧠brew ã scoop ã§ã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ãã 2
cluster1/prd-event-rules.yaml
㨠cluster1/dev-event-rules.yaml
ã¨ãããã¡ã¤ã«ã batches ã¨ãããªãã¸ããªãããªãã¸ã㪠service1 ã® scheduled_batch_rules/ é
ä¸ã« git log ãä¿ã£ãç¶æ
ã§ç§»åããä¾ã示ãã¾ãã
CLIãªãã¬ã¼ã·ã§ã³ã¨ãã¦ã¯ããããã次ã®æµãã«ãªãã¾ããä¸åº¦ç§»è¡å
㧠scheduled_batch_rules/*.yaml
ã ãã®æ§æãä½ã£ãå¾ã§ã移è¡å
ãªãã¸ããªã«å¼·å¶çã«ãã¼ã¸ããã¤ã¡ã¼ã¸ã§ãã
## ãã¼ã«ã«ã«ã¯ãã¼ã³ãã¦ãã batches ãªãã¸ããªã«ç§»å $ cd /path/to/batches ## 移è¡ããããã¡ã¤ã«ä»¥å¤ããã¹ã¦ãgit logå«ãã¦åé¤ãã $ git filter-repo --path cluster1/dev-events-rules.yaml --path cluster1/prd-events-rules.yaml --force ## cluster1/ ã scheduled_batch_rules/ ã« git log ãä¿ã¡ã¤ã¤ãªãã¼ã $ git filter-repo --path-rename cluster1:scheduled_batch_rules --force ## 移è¡å ã®ã¯ãã¼ã³ãã¦ãããªãã¸ããªã«ç§»å $ cd /path/to/cluster1 ## 移è¡å ã®ãªãã¸ããªããªã¢ã¼ãã«è¿½å $ git remote add batches /path/to/batches ## 移è¡å ã®ãªãã¸ããªã®ãªã¢ã¼ããã©ã³ããåå¾ $ git fetch batches ## 移è¡å ã®ãªãã¸ããªã®ãã©ã³ãã移è¡å ã®ãªãã¸ããªã«ãã¼ã¸ $ git merge batches/main --allow-unrelated-histories
注æç¹
/path/to
ã¯é©å®èªåã®ç°å¢ã®ãã®ã«èªã¿æ¿ãã¦ãã ããgit fileter-repo
ã¯ä¸åº¦å®è¡ãã㨠rebase ãªã©ã§ãå ã«æ»ããã¨ã¯ã§ããªããªãããã移è¡å ã¨ãªããªãã¸ããªã¯ç§»è¡ç¨ã«å¥éã¯ãã¼ã³ãã¦ãããã¨ããããããã¾ãã- 移è¡å
ã移è¡å
ã§åãè¾¼ãéã®
git merge
ã¯--allow-unrelated-histories
ãªãã·ã§ã³ããªãã¨ã¨ã©ã¼ã¨ãªããã¼ã¸ã§ãã¾ããã
ã³ã¼ãã ã移管ããã®ã§ã¯ãªã CI/CD ã«ããèªååãã»ãã
åç´ã«è¨å®ãã¡ã¤ã«ã®ç®¡çãå¥ãªãã¸ããªã«ç§»ãã ãã§ã¯ããã¾ã§å©ç¨ãã¦ãã CI/CD ã«ããèªååãããä»çµã¿ã失ããã¦ãã¾ãã¾ãã ãããªãã¨å½ç¶ãªãã CI/CD ãå«ãã¦ç§»ç®¡ãããã¨ã«ãªãã¾ãããããã¾ã§ã®å®æå®è¡ãããã® EventBridge ã®ã«ã¼ã«ã管çããããã ãã®ãªãã¸ããªããã¢ããªã±ã¼ã·ã§ã³ã®éçºãè¡ããã¦ãããªãã¸ããªã¸ã®ç§»ç®¡ã¨ãªããããæ¢åã® CI/CD ã®å½±é¿ãå å³ãã¤ã¤è¡ãã¾ããã
移管ããä»çµã¿ã¯æ¬¡ã®éãã§ã
- Pull Request ä½ææã«è¡ãã¸ã§ã
- ecschedule diff ï¼å·®åãã§ãã¯ï¼
- ecschedule ç¨ã® YAML ã®æä½éã®ãã§ãã¯ãã¼ã«ã®å®è¡
- main ãã©ã³ããã¼ã¸ã®éã«è¡ãã¸ã§ã/tag push ï¼ GitHub Release ä½æï¼ã®éã«è¡ãã¸ã§ã 3
- ecschedule apply ï¼dev ç°å¢ã¸ã®é©ç¨ï¼
- ecschedule apply ï¼prd ç°å¢ã¸ã®é©ç¨ï¼
ã³ãããã§ã¯å ¨ç¤¾çã« GitHub Flow ãæ¡ç¨ããã¦ãããããã®ãããªæµãã«ãªã£ã¦ãã¾ãã
ecschedule ã®é©ç¨ã«ã¤ãã¦ã¯æ¢ã« ecspresso ã«ãããããã¤ï¼ECSãµã¼ãã¹æ´æ°ã¨ãããç¨ã®ECSã¿ã¹ã¯å®ç¾©æ´æ°ï¼ãåæ§ã®æµãã§è¡ãããããã«ãã¦ãããããåºæ¬çã«ã¯ãããã¤ãæåããå¾ã«ã¸ã§ããèµ°ãããã«ãã¦ãã¾ãã
ããããã«ã¤ãã¦ããå°ã詳ãã説æãã¦ããã¾ãã
Pull Request ä½ææã«è¡ãã¸ã§ã
ã¾ã㯠ecschedule diff ã«ããYAMLã¨å®éã® EventBrige ã® EventBridge ã®ã«ã¼ã«ã®å·®åãã§ãã¯ãè¡ãã·ã³ãã«ãªã¸ã§ãã§ãã GitHub Actions ã® YAML ã¯æ¬¡ã®éãã§ãã
name: diff-check on: push: paths: - "scheduled_batch_rules/*" - ".github/workflows/scheduled-batch-yaml-check.yaml" permissions: id-token: write contents: read jobs: diff-check: strategy: matrix: target: # diff check ã®å¯¾è±¡ã¨ãªããã¡ã¤ã«ãã¹ãæå® - scheduled_batch_rules/dev-events-rules.yaml - scheduled_batch_rules/prd-events-rules.yaml runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: setup aqua uses: aquaproj/[email protected] with: aqua_version: v2.36.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: arn:aws:iam::123456789012:role/assume-role-for-ecs aws-region: ap-northeast-1 role-session-name: GitHubActions-${{ github.run_id }} - name: check diff run: | ecschedule diff -conf ${{ matrix.target }} -all
工夫ãã¦ãããã¤ã³ãã¨ãã¦ã¯æ¬¡ã®ãã®ãããã¾ã
- ããªã¬ã¼ã®
push.paths
ã« ecschedule ã§å©ç¨ããè¨å®ãã¡ã¤ã«ã¨GitHub Actions ã® YAML ãã¡ã¤ã«ãæå®ããå®æå®è¡ããããå¤æ´ããªãå ´å㯠CI/CD ã¸ã§ããèµ°ããªãããã«ãã - matrix ã使ã£ã¦ dev ç°å¢ã¨ prd ç°å¢ã®å·®åãã§ãã¯ã並åãã¦è¡ã
次ã¯ãecschedule ç¨ã® YAML ã®æä½éã®ãã§ãã¯ãã¼ã«ã®å®è¡ãè¡ãã¸ã§ãã§ãã
check_rules_yaml.sh
ã¨ããç¬èªã«ç¨æããã·ã§ã«ã¹ã¯ãªããã使ã£ã¦ãYAML ã®æ§æãã§ãã¯ãè¡ã£ã¦ãã¾ããå
容ã¯æ¬ã¨ã³ããªã®è¶£æ¨ããå¤ãã¦ãã¾ããã詳細ã¯å²æãã¾ããã EventBridge ã®ã«ã¼ã«åã®éè¤ãã§ãã¯ã¨ overrides.*.command
ã«ä½åãªã¹ãã¼ã¹ãå
¥ã£ã¦ãããã®ãã§ãã¯ãè¡ãã¾ãã
name: scheduled batch yaml check on: push: paths: - "scheduled_batch_rules/*" - ".github/workflows/scheduled-batch-yaml-check.yaml" jobs: scheduled_batch_yaml_check: strategy: matrix: target: # syntax check ã®å¯¾è±¡ã¨ãªããã¡ã¤ã«ãã¹ãæå® - scheduled_batch_rules/dev-events-rules.yaml - scheduled_batch_rules/prd-events-rules.yaml runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 with: path: service1 - name: Check out platform-toolbox uses: actions/checkout@v4 with: repository: Connehito/platform-toolbox token: ${{ secrets.MACHINE_USER_GITHUB_ACCESS_TOKEN }} sparse-checkout: ecs_scheduled_task path: platform-toolbox - name: Run Syntax Check run: /bin/bash platform-toolbox/ecs_scheduled_task/check_rules_yaml.sh service1/${{ matrix.target }}
工夫ãã¦ãããã¤ã³ãã¯æ¬¡ã®ã¨ããã§ãã
- ç¬èªã®ãã§ãã¯ã¹ã¯ãªããã¯ã¤ã³ãã©ãã¼ã«ç®¡çç¨ã®ãªãã¸ããªã«ç§»ç®¡ããCI/CD ä¸ã§ãã«ããªãã¸ããªã¯ãã¼ã³ã§å¯¾å¿
- ecschedule diff åæ§ã« matrix ã使ã£ã¦ dev ç°å¢ã¨ prd ç°å¢ã®æ§æãã§ãã¯ã並åãã¦è¡ã
ç¹ã«ãåè
ã®ãã§ãã¯ã¹ã¯ãªãã check_rules_yaml.sh
ã®æ±ãã¯è¤æ°ã®ãªãã¸ããªã§å
±æãã¦å©ç¨ã§ãã¦ãã¤å¤é管çã«ãªããã¨ãé¿ãããã£ãèæ¯ãããã¾ãã
ç¬èªã«ä½æããã¹ã¯ãªãããªã®ã§ææªã³ãã㧠ecschedule ã®è¨å®ãã¡ã¤ã«åæ§ã«ç§»ç®¡ãããã¨ãã§ãã¾ãããããã§ã¯ç®¡çãæ£ãæ£ãã«ãªãä»å¾ã®æ´æ°ã»ä¿®æ£ãç
©éã«ãªãã¾ããå½å㯠Draft Releaseãããã¤ããã¼ãä½æãã¦ã¿ã¾ãã - ã³ãããéçºè
ããã° ã§ãç´¹ä»ããã¦ããã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ãä½ã£ã¦å
±æåãããã¨ãæ¤è¨ãã¾ãããããã®å ´åã·ã§ã«ã¹ã¯ãªããã§ãã§ãã¯ã¢ã¦ããããªãã¸ããªã®ãã¡ã¤ã«å
容ãèªã¿è¾¼ãã®ã«é£ããã£ããããä»å㯠actions/checkout ã® repository
ãªãã·ã§ã³ã使ã£ã¦å¥ãªãã¸ããªã®ã¯ãã¼ã³ãè¡ããã¨ã§å¯¾å¦ãã¾ããã4
Connehito/platform-toolbox ã¨ãããªãã¸ããªã¯ãå
ã
ã³ãããã®ä¸»ã«ã¤ã³ãã©ã¨ã³ã¸ãã¢ãæ¥åã§å©ç¨ããå
±éã®ã¹ã¯ãªããããã¼ã«ãç½®ãã¦ãããã©ã¤ãã¼ããªãã¸ããªã§ããä»åã® check_rules_yaml.sh
ã®ç½®ãå ´æã¨ãã¦ãé©åã§ãã£ãããããã®ãªãã¸ããªã«ç§»ç®¡ãã¾ããã
ä»åã®ã·ã§ã«ã¹ã¯ãªãã check_rules_yaml.sh
ã¯ã³ãããç¬èªã®ãã®ã§ãããã®ã®ãCI/CD ä¸ã§å©ç¨ããã¡ãã£ã¨ããã¹ã¯ãªãããããå ´åã§ãåæ§ã«å
±éåãããã¨ãã§ãã¾ãã
mainãã©ã³ããã¼ã¸/tag pushæã«è¡ãé©ç¨ã®ã¸ã§ã
ecschedule apply ãä¼´ãã¸ã§ãã¯æ¬¡ã®éãã§ãã
# ---- ï¼ä¸ç¥ï¼ ---- jobs: deploy: runs-on: ubuntu-latest steps: # --- ï¼ ecspresso ã«ãããããã¤ã¸ã§ã ï¼ --- scheduled_batch_rules: runs-on: ubuntu-latest needs: [ deploy ] steps: - name: Checkout uses: actions/checkout@v4 - name: setup aqua # aqua ã§ç®¡çãã¦ããããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã« uses: aquaproj/[email protected] with: aqua_version: v2.36.0 # 以ä¸ãå®æå®è¡ãããã«ã¼ã«ã®é©ç¨ # devç°å¢åãã®ãããã«ã¼ã«ãå¤æ´ãããå ´åã®ã¿ã«ãé©ç¨ãã - uses: dorny/paths-filter@v3 id: scheduled-batch-rules-changes with: filters: | src: - 'scheduled_batch_rules/dev-events-rules.yaml' - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ vars.AWS_ROLE_ARN }} aws-region: ap-northeast-1 - name: ecschedule apply to dev if: steps.scheduled-batch-rules-changes.outputs.src == 'true' run: | ecschedule apply -conf scheduled_batch_rules/dev-events-rules.yaml -all
ecschedule apply ã«ã¤ãã¦ã¯ ecspresso ã«ãããããã¤ãæåããå¾ã«ã·ã³ãã«ã« ecschedule ã®é©ç¨ã¸ã§ããå®è¡ãããããã«è¿½å ãã¦ãã¾ãããã®æã main ãã©ã³ããã¼ã¸ã®æã®ã¿ dorny/paths-filter ã§å®æå®è¡ãããç¨ã® EventBridge ã®ã«ã¼ã«ãã¡ã¤ã«ãæå®ããå®æå®è¡ããããå¤æ´ããªãå ´åã¯æ¥µå CI/CD ã¸ã§ããèµ°ããªãããã«ãã¦ãã¾ãã
æ¬å½ã¯ tag push ã®éãåæ§ã«ãããã¨ããã§ãã paths-filter ã®ä»æ§ä¸ main ãã©ã³ããã¼ã¸ç´å¾ã«ä½æããã tag ã®å ´åãæ£ããå·®åãæ¤ç¥ã§ãã¾ããããã®ãããæ¬çªç°å¢ã¸ã®é©ç¨ã®ã¸ã§ãã§ã¯ paths-filter ã使ãããåªçã§ãããã¨ãå å³ãã¦å¸¸ã« ecschedule apply ããããã«ãã¦ãã¾ãã
ãããã¤ã§æ±ãCLIãã¼ã«ã¯ aqua ã§ç®¡ç
ecschedule ã®è¨å®ãã¡ã¤ã«ã®ç§»ç®¡ã¯ CI/CD ã®èªååãå«ãã¦è¡ãã¾ãããã ecschedule ãã®ãã®ã®ã aqua ã使ã£ã¦ç®¡çããããã«ãã¾ããã
aqua 㯠Go 製ã®å®£è¨å CLI ããã±ã¼ã¸ããã¼ã¸ã£ã§ããªãã¸ããªãããã« aqua.yaml
ã¨ãããã¡ã¤ã«ãç½®ããã¨ã§ããªãã¸ããªå
ã§å©ç¨ããCLIãã¼ã«ã¨ãããã®ãã¼ã¸ã§ã³ç®¡çãã§ãã¾ãã
aqua ãå°å
¥ããèæ¯ã¨ãã¦ã¯ã主ã«æ¬¡ã®èª²é¡ã解決ããããã§ãã
- åå人㧠ecschedule, ecspresso ãªã©ã brew, scoop, mise ãªã©ã®ç®¡çã«ä»»ãã¦ããã¨ããããã¼ã«ã«ã§å©ç¨ããå¿ è¦ãããéã«ãã¼ã¸ã§ã³ãåããã«æ³å®å¤ã®åä½ãããã±ã¼ã¹ããã
- ãã¼ã«ã«ã§å©ç¨ãã CLI ãã¼ã«ã®ãã¼ã¸ã§ã³ã¨ GitHub Actions ã§å©ç¨ãã CLI ãã¼ã«ã®ãã¼ã¸ã§ã³ãããããã
- CLI ãã¼ã«ã®ç¶ç¶çãªãã¼ã¸ã§ã³ã¢ãã
ãããã®èª²é¡ã¯ä¸åº¦ CI/CD ã§ã¯ã¼ã¯ããã¼ãåºæ¥ä¸ãã£ã¦ãã¾ãã°ããã®å¾ãã¾ãæèããããã¨ãç¡ããªã£ã¦ãã¾ããã®ã§ããã¾ãã ããããé·æçãªè¦ç¹ã§èããã¨ããããæ¾ç½®ããããããªç¶æ³ã«ãªãã¨ãããæ¥çªç¶ CI/CD ãåããªããªããã¨ããäºæ ã«ããªãããã¾ããã ãã®ãããecschedule å°å ¥ã®ã¿ã¤ãã³ã°ã§åæã«ä»çµã¿ã§ã¤ã¶ãã¦ãããã課é¡ã§ããã¾ããã
aqua ãå°å ¥ãããã¨ã§ããªãã¸ããªå ã§å©ç¨ãã CLI ãã¼ã«ã®ãã¼ã¸ã§ã³ç®¡çãä¸å åãã GitHub Actions ã§ã®å©ç¨ãå«ãã¦ãã¼ã¸ã§ã³ãä¸å 管çã§ããããã«ãªãã¾ãããã¾ãã renovate ã«ã対å¿ãã¦ãããããç¶ç¶çãªã¢ãããã¼ãã人ã®æã«ãããã®ã§ã¯ãªãä»çµã¿ã§è¡ããããã«ã§ãã¾ãã
ãããå°ç¨ãªãã¸ããªã解ä½ãã¦ã©ããªã£ã¦ããã
ãªãã¸ããªã®è§£ä½ãã移管ãå®äºãã¦ãããã°ããçµã¡ã¾ãããå½åã®ç®è«è¦éãã®æ¹åãã§ããããã«æãã¦ãã¾ãã
å ·ä½çã«ã¯ãããã追å ã® Pull Request ãã¢ããªã±ã¼ã·ã§ã³å®è£ 㨠EventBridge ã®ã«ã¼ã«è¿½å ã»å¤æ´ãä¸ã¤ã®ãªãã¸ããªã§ä¸æ°é貫ãã¦è¡ããããã«ãªããã¤ã³ãã©ã¨ã³ã¸ãã¢ã«ãã形骸åãã Pull Request ã¬ãã¥ã¼ãå¿ è¦ãªããªãã¾ããã
ä¸è¦äºç´°ãªäºã§ã¯ããã¾ãããéçºè ãæ®æ®µã³ããããã¦ãããªãã¸ããªã§å®çµããããã«ãªã£ããã¨ã§ãè¤æ°ã®ãªãã¸ããªã«åãããä½è¨ãªç°å¢æ§ç¯ã®å¿ è¦ã¯ãªããªããå¥ã ã« Pull Request ãåºãã¦ããããã®ãããã¤ã®ã¿ã¤ãã³ã°ã伺ãå¿ è¦ãç¡ããªãã¾ãããããå¿ è¦ãªéçºã«éä¸ã§ããç°å¢ãç¨æãããã¨ã«å¯ä¸ã§ããããã«æãã¾ãã
ecschedule ã®ãããªãç´æ¥ã¢ããªã±ã¼ã·ã§ã³ã«ã¯é¢ãããªããããã©ãã·ã¹ãã ã®éç¨ä¸ã¢ããªã±ã¼ã·ã§ã³ã®éçºè ãç´æ¥è§¦ããã»ããããã¤ã³ãã©ãªã½ã¼ã¹ç®¡çãã«ããã¦ãã³ãããã§ã¯ä»åã®ãããªã¢ããªã±ã¼ã·ã§ã³ãªãã¸ããªã«çµ±åããã¨ããå½¢ã«è½ã¡çãã¾ããããããåæ§ã«ã¢ããªã±ã¼ã·ã§ã³ã¨è·é¢ã®è¿ãã¤ã³ãã©ãªã½ã¼ã¹ã®ç®¡çã«èª²é¡ãæãã¦ããã±ã¼ã¹ã®åèã«ãªãã°å¹¸ãã§ãã
- git log ãä¿æããã¾ã¾å¥ã®ãªãã¸ããªã«ãã¡ã¤ã«ã移ãæ¹æ³ã¨ã㦠git filter-branch ã使ãäºä¾ãããã¾ããããã git filter-branch 㯠git 2.46.1 æç¹ã§å ¬å¼ã§ãéæ¨å¥¨ã¨ãªã£ã¦ãããgit filter-repo ã使ããã¨ãæ¨å¥¨ããã¦ãã¾ããåè: Git - git-filter-branch Documentation↩
- https://github.com/newren/git-filter-repo/blob/main/INSTALL.md#installation-via-package-manager↩
- ã³ãããã§ã¯ä¸è¬çãªã¹ãã¼ã¸ã³ã°ç°å¢ã dev ãæ¬çªç°å¢ã prd ã¨å¼ãã§ãã¾ãã↩
- actions/checkout: Action for checking out a repo - Checkout multiple repos (private): https://github.com/actions/checkout?tab=readme-ov-file#checkout-multiple-repos-private↩