From a060af3f91a60fe9fd6db61a496b95a6082a1ec9 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:21:52 +0900 Subject: [PATCH 01/10] chore: update workflow --- .github/workflows/GHPages.yml | 2 - .github/workflows/test-pandoc-resources.yml | 12 ++++ .../forGitBranch/git_branch_standards.md | 64 +++++++++---------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 3008ef14..1a31f082 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -40,8 +40,6 @@ jobs: - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - - name: Copy img directory - run: cp -r ./documents/forGitBranch/img ./img - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー規約.html" diff --git a/.github/workflows/test-pandoc-resources.yml b/.github/workflows/test-pandoc-resources.yml index 93732cf0..83a8f838 100644 --- a/.github/workflows/test-pandoc-resources.yml +++ b/.github/workflows/test-pandoc-resources.yml @@ -44,6 +44,18 @@ jobs: - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" + - uses: docker://pandoc/latex:2.9 + with: + args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" + - uses: docker://pandoc/latex:2.9 + with: + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" + - uses: docker://pandoc/latex:2.9 + with: + args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" + - uses: docker://pandoc/latex:2.9 + with: + args: "pandoc ./documents/forSlack/slack_usage_guidelines.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Slack利用ガイドライン.docx" - name: Archive resources uses: actions/upload-artifact@v4 with: diff --git a/documents/forGitBranch/git_branch_standards.md b/documents/forGitBranch/git_branch_standards.md index 2e1860ae..00835d12 100644 --- a/documents/forGitBranch/git_branch_standards.md +++ b/documents/forGitBranch/git_branch_standards.md @@ -70,7 +70,7 @@ Gitリポジトリを新規作成するとデフォルトで作成されるブ - ひとつの変更に対してひとつのfeatureブランチを作成し、作業完了後に削除するため、開発中で最も使われる短命なブランチである - 基本的に1人の開発者のみが利用する -![feature branch](img/branch_strategy_feature.drawio.png) +![feature branch](./img/branch_strategy_feature.drawio.png) 以下の命名に従う。 @@ -92,7 +92,7 @@ fixtypo 開発の中心となるブランチである。 -![develop branch](img/branch_strategy_develop.drawio.png) +![develop branch](./img/branch_strategy_develop.drawio.png) ## releaseブランチ @@ -102,7 +102,7 @@ fixtypo - releaseブランチではバグ修正、ドキュメント生成、その他のリリースに伴うタスクのみを実施する - masterブランチのマージコミットにリリースタグを打ち、mainブランチをdevelopブランチへマージ後、releaseブランチを削除する -![release branch](img/branch_strategy_release.drawio.png) +![release branch](./img/branch_strategy_release.drawio.png) ## hotfixブランチ @@ -111,7 +111,7 @@ fixtypo - 修正が完了するとmainとdevelopの両方(あるいは進行中のreleaseブランチ)にマージされる - main/developブランチがあると必要になる可能性がある。main/featureブランチのみの運用では必須ではない(管理上の目的でfeatureとhotfixを分けることはあり得る) -![hotfix branch](img/branch_strategy_hotfix.drawio.png) +![hotfix branch](./img/branch_strategy_hotfix.drawio.png) ## topicブランチ @@ -120,7 +120,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 - topicブランチが必要なケースでは、featureブランチへの直接プッシュを行ってはならない - GitHub Flowではfeatureブランチのことをtopicブランチと呼称する場合があるが、本規約ではfeatureブランチから派生するブランチをtopicブランチと定義する -![topic branch](img/branch_strategy_topic.drawio.png) +![topic branch](./img/branch_strategy_topic.drawio.png) # ブランチ戦略の選定 @@ -163,7 +163,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 ## 1. developブランチを複数作成する場合 -![multi develop branch](img/branch_strategy_multi_develop.drawio.png) +![multi develop branch](./img/branch_strategy_multi_develop.drawio.png) 日々のエンハンス開発と並行して、数カ月後に大型リリースを行いたい場合がある。このときは複数リリースバージョンを並行して開発するため、 `develop`、`develop2` といった複数のdevelopブランチを作る必要がある。 @@ -178,7 +178,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 - 誤操作を避ける目的でcherry-pickは行わない - `devleop2` への同期は、 `develop` -> `main` ブランチに反映されるタイミングで同期を行う(これにより、品質保証済みの変更のみ取り入れることができる9 -![release multi develop branch](img/branch_strategy_release_multi_develop.drawio.png) +![release multi develop branch](./img/branch_strategy_release_multi_develop.drawio.png) ### develop2のリリース手順 @@ -193,7 +193,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 ## 2. 過去バージョンをサポートする場合 -![multi version branch](img/branch_strategy_multi_version.drawio.png) +![multi version branch](./img/branch_strategy_multi_version.drawio.png) (社内外の)ライブラリでインターフェースの大型改善や仕様変更を受けて、メジャーバージョンを1→2に上げることがる。この時に過去バージョンもサポートする必要があると、バージョン別にsupportブランチを作成する。 @@ -230,7 +230,7 @@ developブランチの変更をfeatureブランチに取り込む方法には、 | 1. マージコミット | 2. リベース | | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| ![マージ](img/merge_strategy_develop_to_feature_merge.drawio.png) | ![リベース](img/merge_strategy_develop_to_feature_rebase.drawio.png) | +| ![マージ](./img/merge_strategy_develop_to_feature_merge.drawio.png) | ![リベース](./img/merge_strategy_develop_to_feature_rebase.drawio.png) | | `get fetch & git merge`(≒ `git pull`)。マージコミットが作成される | `get fetch & git rebase`(≒ `git pull --rebase`)。最新の開発ブランチの先頭から新たにコミットを作りなされ、マージコミットは作成されない | 本規約の推奨は「2. リベース」である。 @@ -325,12 +325,12 @@ Terraformはplanが成功しても、applyが失敗することは多々あり developブランチにfeatureブランチの変更を取り込む方法は下表のように3パターン存在する。 -| | 1.マージコミット | 2.リベース | 3.スカッシュマージ | -| ---- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| 名称 | Create a merge commit | Rebase and merge | Squash and merge | -| 流れ | ![Merge Commit](img/merge_strategy_feature_to_develop_merge_commit.drawio.png) | ![Rebase and Merge](img/merge_strategy_feature_to_develop_rebase_and_merge.drawio.png) | ![Squash and Merge](img/merge_strategy_feature_to_develop_squash_and_merge.drawio.png) | -| 説明 | `git merge --no-ff` で変更を取り込む | featureブランチを最新のdevelopブランチにリベースし、`git merge --ff` で変更を取り込む | `git merge --squash` で変更を取り込む | -| 特徴 | developブランチにマージコミットが作成される | マージコミットは作成されず、履歴が一直線になる | featureブランチで行った変更YとZを1つにまとめたコミットがdevelopブランチに作成される | +| | 1.マージコミット | 2.リベース | 3.スカッシュマージ | +| ---- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| 名称 | Create a merge commit | Rebase and merge | Squash and merge | +| 流れ | ![Merge Commit](./img/merge_strategy_feature_to_develop_merge_commit.drawio.png) | ![Rebase and Merge](./img/merge_strategy_feature_to_develop_rebase_and_merge.drawio.png) | ![Squash and Merge](./img/merge_strategy_feature_to_develop_squash_and_merge.drawio.png) | +| 説明 | `git merge --no-ff` で変更を取り込む | featureブランチを最新のdevelopブランチにリベースし、`git merge --ff` で変更を取り込む | `git merge --squash` で変更を取り込む | +| 特徴 | developブランチにマージコミットが作成される | マージコミットは作成されず、履歴が一直線になる | featureブランチで行った変更YとZを1つにまとめたコミットがdevelopブランチに作成される | ::: tip GitLabを利用する場合 @@ -338,11 +338,11 @@ GitLabでも開発ブランチに機能ブランチの変更を取り込む方 ただし、マージリクエスト上のオプションによってコミット履歴が変わる点が注意である。 -| | 1. Merge commit | 2. Merge commit with semi-linear history | 3. Fast-forward merge | -| ---- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| 流れ | ![Merge commit with squash commits](img/merge_strategy_feature_to_develop_squash_and_merge_gitlab.drawio.png) | 省略 | 省略 | -| 説明 | GitHubにおける `Create a merge commit` と同様のマージ方法 | `Merge commit` と同じコマンドを使用して、機能ブランチの変更を取り込む方法 | GitHubにおける `Rebase and merge` と同様のマージ方法 | -| 注意 | `Squash commits` を選択してマージした場合、`squash commit` と `merge commit` の2つのコミットが作成される | ソースブランチがターゲットブランチより古い場合はリベースしないとマージできない。 | マージリクエスト上で `Squash commits` を選択してマージした場合、GitHubにおける `Squash and merge` と同様のマージ方法になる(※補足1) | +| | 1. Merge commit | 2. Merge commit with semi-linear history | 3. Fast-forward merge | +| ---- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| 流れ | ![Merge commit with squash commits](./img/merge_strategy_feature_to_develop_squash_and_merge_gitlab.drawio.png) | 省略 | 省略 | +| 説明 | GitHubにおける `Create a merge commit` と同様のマージ方法 | `Merge commit` と同じコマンドを使用して、機能ブランチの変更を取り込む方法 | GitHubにおける `Rebase and merge` と同様のマージ方法 | +| 注意 | `Squash commits` を選択してマージした場合、`squash commit` と `merge commit` の2つのコミットが作成される | ソースブランチがターゲットブランチより古い場合はリベースしないとマージできない。 | マージリクエスト上で `Squash commits` を選択してマージした場合、GitHubにおける `Squash and merge` と同様のマージ方法になる(※補足1) | (※補足1)マージ方法で Merge commit を選択して、マージリクエスト上で Squash commits オプションを選択してマージした場合は以下と同義である @@ -418,7 +418,7 @@ git merge --no-ff $SOURCE_SHA - issue-312のリリースは業務上の合意が得られていない(エンドユーザ操作に影響があるため、事前告知した日時でリリースしたいなど) - issue-394は不具合修正であり業務上の優先度が高いため、なるべく早くリリースしたい -![同一ファイルを複数](img/release_overtaking.drawio.png) +![同一ファイルを複数](./img/release_overtaking.drawio.png) よく陥りがちな対策としては次の2点が考えられる。 @@ -437,7 +437,7 @@ git merge --no-ff $SOURCE_SHA 2の例を以下に図示する -![hotfixで追い抜き](img/release_overtaking_hotfix.drawio.png) +![hotfixで追い抜き](./img/release_overtaking_hotfix.drawio.png) # ブランチ命名規則 @@ -457,7 +457,7 @@ Gitにはタグ機能があり、リリースポイントとしてタグを作 - 入力間違えなどのケースを除き、一度タグをつけた後は削除しない - 後述する「タグの命名規則」に従う -![GitHub画面でbackend/v1.6.0のタグを作成する](img/create_new_tag.png) +![GitHub画面でbackend/v1.6.0のタグを作成する](./img/create_new_tag.png) 何かしらの理由で、コマンドラインからタグを作成する必要がある場合は、以下に注意する。画面経由・コマンドライン経由でのタグ作成は混ぜないようにし、運用手順は統一する。 @@ -496,7 +496,7 @@ frontend/v1.1.0 - フロントエンド・バックエンドで整合性を保っているのであれば、メモ目的でバージョンを記載する運用を推奨とする - 実用的な利用用途が思いつかない場合は、開発者視点での楽しみリリースの大きなマイルストーンの名称など、チームの関心事を記入することを推奨とする -![create new tag](img/create_new_tag_title.png) +![create new tag](./img/create_new_tag_title.png) 何かしらの理由で、コマンドラインからタグを作成する必要がある場合は、GitHub利用時の規則に合わせて次のように作成する。 @@ -869,7 +869,7 @@ GUIでのGit操作にあたり、次の2つの拡張機能をインストール サイドバー > Explorer か Source Control > Clone Repository ボタンをクリックし、URLを入力すると、リポジトリをクローンできる。 -![Clone1](img/vscode_git_clone1.png) ![Clone2](img/vscode_git_clone2.png) +![Clone1](./img/vscode_git_clone1.png) ![Clone2](./img/vscode_git_clone2.png) ### コミットグラフの表示 @@ -877,7 +877,7 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l 白丸のグラフアイコン (Show Commit Graph) はGitLensのコミットグラフだが、冒頭の記述通り、Pro版でのみの提供となる。 -![Graph1](img/vscode_git_graph1.png) ![Graph2](img/vscode_git_graph2.png) +![Graph1](./img/vscode_git_graph1.png) ![Graph2](./img/vscode_git_graph2.png) ### リモートのフェッチ/プル (`git fetch` / `git pull`) @@ -886,11 +886,11 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l - SOURCE CONTROL パネル > 三点リーダーアイコン (More Actions...) をクリックし、 Fetch を選択 - コミットグラフ > 雲アイコン (Fetch from Remote(s)) をクリック -![Fetch1](img/vscode_git_fetch1.png) +![Fetch1](./img/vscode_git_fetch1.png) なお、フェッチ後に以下のようなダイアログが表示される場合があるが、 "Yes" を選択すると、自動で定期的にフェッチを行う。 -![Fetch2](img/vscode_git_fetch2.png) +![Fetch2](./img/vscode_git_fetch2.png) ### ブランチの作成/チェックアウト (`git branch` / `git checkout`) @@ -902,17 +902,17 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l - コミットグラフ > 作成元コミットの行上で右クリックし、Create Branch... を選択 - "Check out" にチェックを入れると、作成したブランチにチェックアウトする -![Branch1](img/vscode_git_branch1.png) ![Branch2](img/vscode_git_branch2.png) +![Branch1](./img/vscode_git_branch1.png) ![Branch2](./img/vscode_git_branch2.png) ### ステージ/コミット/プッシュ (`git add` / `git commit` / `git push`) SOURCE CONTROL パネル > 変更ファイルの行 > +アイコン (Stage Changes) をクリックすると、対象ファイルをステージできる。(Changes > +アイコン (Stage All Changes) をクリックすると、すべての変更をステージする) -![Stage](img/vscode_git_stage.png) +![Stage](./img/vscode_git_stage.png) 必要な変更をステージ後、 SOURCE CONTROL パネル内でコミットメッセージを入力し、 Commit ボタンをクリックすると、コミットを作成できる。 -![Commit](img/vscode_git_commit.png) +![Commit](./img/vscode_git_commit.png) 以下のいずれかの操作を実行すると、作成したコミットをリモートリポジトリにプッシュできる。 @@ -920,6 +920,6 @@ SOURCE CONTROL パネル > 変更ファイルの行 > +アイコン (Stage Chang - BRANCHES パネル > 対象ブランチの行 > 雲アイコン (Publish Branch) をクリック - コミットグラフ > 対象ブランチの上で右クリックし、Push Branch... を選択 -![push1](img/vscode_git_push1.png) ![push2](img/vscode_git_push2.png) ![push3](img/vscode_git_push3.png) +![push1](./img/vscode_git_push1.png) ![push2](./img/vscode_git_push2.png) ![push3](./img/vscode_git_push3.png) ::: From da754d1b7d566cb0a8999b151e52292bf2644b58 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:24:55 +0900 Subject: [PATCH 02/10] fix --- .github/workflows/GHPages.yml | 10 ++-------- .github/workflows/test-pandoc-resources.yml | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 1a31f082..593d1ab6 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -42,16 +42,10 @@ jobs: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー規約.html" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html --resource-path ./documents/forGitBranch/img" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー規約.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forMarkdown/markdown_design_document.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Markdown設計ドキュメント規約.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forMarkdown/markdown_design_document.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Markdown設計ドキュメント規約.docx" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx --resource-path ./documents/forGitBranch/img" - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" diff --git a/.github/workflows/test-pandoc-resources.yml b/.github/workflows/test-pandoc-resources.yml index 83a8f838..df433633 100644 --- a/.github/workflows/test-pandoc-resources.yml +++ b/.github/workflows/test-pandoc-resources.yml @@ -46,10 +46,10 @@ jobs: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html --resource-path ./documents/forGitBranch/img" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx --resource-path ./documents/forGitBranch/img" - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" From 2d50db94cc8f170215e41e57c56c60bb8b676664 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:25:24 +0900 Subject: [PATCH 03/10] rename job --- .github/workflows/test-pandoc-resources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pandoc-resources.yml b/.github/workflows/test-pandoc-resources.yml index df433633..8a63618b 100644 --- a/.github/workflows/test-pandoc-resources.yml +++ b/.github/workflows/test-pandoc-resources.yml @@ -9,7 +9,7 @@ on: - "!master" # excludes master jobs: - build-docs-docs: + build-docs-with-pandoc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 91babb92c598663c4d3698c4efa71385bfc16bbb Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:28:37 +0900 Subject: [PATCH 04/10] update --- .github/workflows/test-pandoc-resources.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-pandoc-resources.yml b/.github/workflows/test-pandoc-resources.yml index 8a63618b..0992b56e 100644 --- a/.github/workflows/test-pandoc-resources.yml +++ b/.github/workflows/test-pandoc-resources.yml @@ -46,10 +46,10 @@ jobs: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html --resource-path ./documents/forGitBranch/img" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch -s --self-contained --number-sections --toc -t html5 -c ../../documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx --resource-path ./documents/forGitBranch/img" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" From 39dc7333897d5e65c800eea02072bee50c4c0ed5 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:31:15 +0900 Subject: [PATCH 05/10] fix --- .github/workflows/GHPages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 593d1ab6..24b9bb35 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -42,10 +42,10 @@ jobs: args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html --resource-path ./documents/forGitBranch/img" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch -s --self-contained --number-sections --toc -t html5 -c ../../documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx --resource-path ./documents/forGitBranch/img" + args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" - uses: docker://pandoc/latex:2.9 with: args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" From 34d64c52a42f3d1b346e7991acac6cdf02acc5a6 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:43:27 +0900 Subject: [PATCH 06/10] update --- .github/workflows/GHPages.yml | 41 +----------- .../test-build-resources-with-pandoc.yml | 25 ++++++++ .github/workflows/test-pandoc-resources.yml | 64 ------------------- build-resources-with-pandoc.sh | 43 +++++++++++++ package.json | 16 +---- 5 files changed, 70 insertions(+), 119 deletions(-) create mode 100644 .github/workflows/test-build-resources-with-pandoc.yml delete mode 100644 .github/workflows/test-pandoc-resources.yml create mode 100644 build-resources-with-pandoc.sh diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 24b9bb35..63fabd29 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -12,46 +12,7 @@ jobs: - uses: actions/setup-node@v4 - uses: docker://pandoc/latex:2.9 with: - args: "pandoc ./documents/forJava/Javaコーディング規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Javaコーディング規約.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forJava/Javaコーディング規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Javaコーディング規約.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/SQLコーディング規約(Oracle).html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/SQLコーディング規約(Oracle).docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(PostgreSQL).md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/SQLコーディング規約(PostgreSQL).html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(PostgreSQL).md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/SQLコーディング規約(PostgreSQL).docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/AWSインフラリソース命名規約.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/AWSインフラリソース命名規約.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/OpenAPI_Specification_2.0.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch -s --self-contained --number-sections --toc -t html5 -c ../../documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSlack/slack_usage_guidelines.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Slack利用ガイドライン.docx" + args: build-resources-with-pandoc.sh - name: Install Packages run: | npm i -f diff --git a/.github/workflows/test-build-resources-with-pandoc.yml b/.github/workflows/test-build-resources-with-pandoc.yml new file mode 100644 index 00000000..8eefd904 --- /dev/null +++ b/.github/workflows/test-build-resources-with-pandoc.yml @@ -0,0 +1,25 @@ +name: build-resources-with-pandoc + +on: + push: + branches: + - "*" # matches every branch that doesn't contain a '/' + - "*/*" # matches every branch containing a single '/' + - "**" # matches every branch + - "!master" # excludes master + +jobs: + build-resources-with-pandoc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: docker://pandoc/latex:2.9 + with: + args: build-resources-with-pandoc.sh + - name: Archive resources + uses: actions/upload-artifact@v4 + with: + name: pandoc_resources + path: ./public/resources/ + retention-days: 1 diff --git a/.github/workflows/test-pandoc-resources.yml b/.github/workflows/test-pandoc-resources.yml deleted file mode 100644 index 0992b56e..00000000 --- a/.github/workflows/test-pandoc-resources.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: test-pandoc-resources - -on: - push: - branches: - - "*" # matches every branch that doesn't contain a '/' - - "*/*" # matches every branch containing a single '/' - - "**" # matches every branch - - "!master" # excludes master - -jobs: - build-docs-with-pandoc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forJava/Javaコーディング規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Javaコーディング規約.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forJava/Javaコーディング規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Javaコーディング規約.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/SQLコーディング規約(Oracle).html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/SQLコーディング規約(Oracle).docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(PostgreSQL).md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/SQLコーディング規約(PostgreSQL).html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSQL/SQLコーディング規約(PostgreSQL).md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/SQLコーディング規約(PostgreSQL).docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/AWSインフラリソース命名規約.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/AWSインフラリソース命名規約.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/OpenAPI_Specification_2.0.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/OpenAPI_Specification_2.0.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch -s --self-contained --number-sections --toc -t html5 -c ../../documents/common/pandoc_styles/css/style.css -o ./public/resources/Gitブランチフロー.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forGitBranch/git_branch_standards.md --resource-path ./documents/forGitBranch --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Gitブランチフロー.docx" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSlack/slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./public/resources/Slack利用ガイドライン.html" - - uses: docker://pandoc/latex:2.9 - with: - args: "pandoc ./documents/forSlack/slack_usage_guidelines.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./public/resources/Slack利用ガイドライン.docx" - - name: Archive resources - uses: actions/upload-artifact@v4 - with: - name: pandoc_resources - path: ./public/resources/ - retention-days: 1 diff --git a/build-resources-with-pandoc.sh b/build-resources-with-pandoc.sh new file mode 100644 index 00000000..f4887840 --- /dev/null +++ b/build-resources-with-pandoc.sh @@ -0,0 +1,43 @@ +ROOT_DIR=`pwd` +CSS_PATH="${ROOT_DIR}/documents/common/pandoc_styles/css/style.css" +STYLE_DOCX_PATH="${ROOT_DIR}/documents/common/pandoc_styles/スタイル.docx" +RESOURCES_DIR="${ROOT_DIR}/public/resources" + +# Java +cd ${ROOT_DIR}/documents/forJava + +pandoc ./Javaコーディング規約.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/Javaコーディング規約.html +pandoc ./Javaコーディング規約.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/Javaコーディング規約.docx + +# SQL +cd ${ROOT_DIR}/documents/forSQL + +pandoc ./SQLコーディング規約(Oracle).md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/SQLコーディング規約(Oracle).html +pandoc ./SQLコーディング規約(Oracle).md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/SQLコーディング規約(Oracle).docx +pandoc ./SQLコーディング規約(PostgreSQL).md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/SQLコーディング規約(PostgreSQL).html +pandoc ./SQLコーディング規約(PostgreSQL).md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/SQLコーディング規約(PostgreSQL).docx + +# AWSインフラリソース +cd ${ROOT_DIR}/documents/forAWSResource + +pandoc ./AWSインフラリソース命名規約.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/AWSインフラリソース命名規約.html +pandoc ./AWSインフラリソース命名規約.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/AWSインフラリソース命名規約.docx + +# OpenAPISpecification +cd ${ROOT_DIR}/documents/forOpenAPISpecification + +pandoc ./OpenAPI_Specification_2.0.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/OpenAPI_Specification_2.0.html +pandoc ./OpenAPI_Specification_2.0.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/OpenAPI_Specification_2.0.docx + +# Git +cd ${ROOT_DIR}/documents/forGitBranch + +pandoc ./git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ../.${CSS_PATH} -o ${RESOURCES_DIR}/Gitブランチフロー規約.html +pandoc ./git_branch_standards.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/Gitブランチフロー規約.docx + + +# Slack +cd ${ROOT_DIR}/documents/forSlack + +pandoc ./slack_usage_guidelines.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/Slack利用ガイドライン.html +pandoc ./slack_usage_guidelines.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/Slack利用ガイドライン.docx diff --git a/package.json b/package.json index 602f60c1..365c17a2 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,7 @@ "copy": "npm-run-all copy:*", "copy:git": "cp -r documents/forGitBranch/img docs/documents/forGitBranch/img", "copy:markdown": "cp -r documents/forMarkdown/future_muscle_partner/docs/future_muscle_partner_abstract.png docs/documents/forMarkdown/future_muscle_partner/docs/future_muscle_partner_abstract.png", - "format": "prettier . --write", - "pandoc": "npm-run-all pandoc:*", - "pandoc:java-html": "pandoc ./documents/forJava/Javaコーディング規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forJava/Javaコーディング規約.html", - "pandoc:java-word": "pandoc ./documents/forJava/Javaコーディング規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./documents/forJava/Javaコーディング規約.docx", - "pandoc:sqlo-html": "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forSQL/SQLコーディング規約(Oracle).html", - "pandoc:sqlo-word": "pandoc ./documents/forSQL/SQLコーディング規約(Oracle).md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./documents/forSQL/SQLコーディング規約(Oracle).docx", - "pandoc:awsresource-html": "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md -s --self-contained --number-sections --toc -t html5 -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forAWSResource/AWSインフラリソース命名規約.html", - "pandoc:awsresource-word": "pandoc ./documents/forAWSResource/AWSインフラリソース命名規約.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -s -o ./documents/forAWSResource/AWSインフラリソース命名規約.docx", - "pandoc:swagger-html": "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md -s --self-contained --number-sections --toc -t html5 -F mermaid-filter.cmd -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0規約.html", - "pandoc:swagger-word": "pandoc ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -F mermaid-filter.cmd -s -o ./documents/forOpenAPISpecification/OpenAPI_Specification_2.0規約.docx", - "pandoc:gitbranch-html": "pandoc ./documents/forGitBranch/git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -F mermaid-filter.cmd -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forGitBranch/Gitブランチフロー.html", - "pandoc:gitbranch-word": "pandoc ./documents/forGitBranch/git_branch_standards.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -F mermaid-filter.cmd -s -o ./documents/forGitBranch/Gitブランチフロー.docx", - "pandoc:markdown-html": "pandoc ./documents/forMarkdown/README.md -s --self-contained --number-sections --toc -t html5 -F mermaid-filter.cmd -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forMarkdown/Markdown設計ドキュメント規約.html", - "pandoc:markdown-word": "pandoc ./documents/forMarkdown/README.md --toc --reference-doc=./documents/common/pandoc_styles/スタイル.docx -F mermaid-filter.cmd -s -o ./documents/forMarkdown/Markdown設計ドキュメント規約.docx", - "pandoc:slack-html": "pandoc ./documents/forSlack/README.md -s --self-contained --number-sections --toc -t html5 -F mermaid-filter.cmd -c ./documents/common/pandoc_styles/css/style.css -o ./documents/forSlack/Slack利用ガイドライン.html" + "format": "prettier . --write" }, "repository": { "type": "git ", From 3bd13452b1a43a0844dd43088344fcbb6803436b Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:50:13 +0900 Subject: [PATCH 07/10] update --- .github/workflows/GHPages.yml | 2 +- .github/workflows/test-build-resources-with-pandoc.yml | 2 +- build-resources-with-pandoc.sh | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 63fabd29..507eac4a 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-node@v4 - uses: docker://pandoc/latex:2.9 with: - args: build-resources-with-pandoc.sh + args: sh build-resources-with-pandoc.sh - name: Install Packages run: | npm i -f diff --git a/.github/workflows/test-build-resources-with-pandoc.yml b/.github/workflows/test-build-resources-with-pandoc.yml index 8eefd904..3398838d 100644 --- a/.github/workflows/test-build-resources-with-pandoc.yml +++ b/.github/workflows/test-build-resources-with-pandoc.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-node@v4 - uses: docker://pandoc/latex:2.9 with: - args: build-resources-with-pandoc.sh + args: sh build-resources-with-pandoc.sh - name: Archive resources uses: actions/upload-artifact@v4 with: diff --git a/build-resources-with-pandoc.sh b/build-resources-with-pandoc.sh index f4887840..96b5ec52 100644 --- a/build-resources-with-pandoc.sh +++ b/build-resources-with-pandoc.sh @@ -32,9 +32,14 @@ pandoc ./OpenAPI_Specification_2.0.md --toc --reference-doc=${STYLE_DOCX_PATH} - # Git cd ${ROOT_DIR}/documents/forGitBranch -pandoc ./git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ../.${CSS_PATH} -o ${RESOURCES_DIR}/Gitブランチフロー規約.html +pandoc ./git_branch_standards.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/Gitブランチフロー規約.html pandoc ./git_branch_standards.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/Gitブランチフロー規約.docx +# Markdown +cd ${ROOT_DIR}/documents/forMarkdown + +pandoc ./markdown_design_document.md -s --self-contained --number-sections --toc -t html5 -c ${CSS_PATH} -o ${RESOURCES_DIR}/Markdown設計ドキュメント規約.html +pandoc ./markdown_design_document.md --toc --reference-doc=${STYLE_DOCX_PATH} -s -o ${RESOURCES_DIR}/Markdown設計ドキュメント規約.docx # Slack cd ${ROOT_DIR}/documents/forSlack From 064b4dc3fccf113d5a4c62e41c13c36210bf7ebb Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:53:45 +0900 Subject: [PATCH 08/10] revert --- .../forGitBranch/git_branch_standards.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/documents/forGitBranch/git_branch_standards.md b/documents/forGitBranch/git_branch_standards.md index 00835d12..2e1860ae 100644 --- a/documents/forGitBranch/git_branch_standards.md +++ b/documents/forGitBranch/git_branch_standards.md @@ -70,7 +70,7 @@ Gitリポジトリを新規作成するとデフォルトで作成されるブ - ひとつの変更に対してひとつのfeatureブランチを作成し、作業完了後に削除するため、開発中で最も使われる短命なブランチである - 基本的に1人の開発者のみが利用する -![feature branch](./img/branch_strategy_feature.drawio.png) +![feature branch](img/branch_strategy_feature.drawio.png) 以下の命名に従う。 @@ -92,7 +92,7 @@ fixtypo 開発の中心となるブランチである。 -![develop branch](./img/branch_strategy_develop.drawio.png) +![develop branch](img/branch_strategy_develop.drawio.png) ## releaseブランチ @@ -102,7 +102,7 @@ fixtypo - releaseブランチではバグ修正、ドキュメント生成、その他のリリースに伴うタスクのみを実施する - masterブランチのマージコミットにリリースタグを打ち、mainブランチをdevelopブランチへマージ後、releaseブランチを削除する -![release branch](./img/branch_strategy_release.drawio.png) +![release branch](img/branch_strategy_release.drawio.png) ## hotfixブランチ @@ -111,7 +111,7 @@ fixtypo - 修正が完了するとmainとdevelopの両方(あるいは進行中のreleaseブランチ)にマージされる - main/developブランチがあると必要になる可能性がある。main/featureブランチのみの運用では必須ではない(管理上の目的でfeatureとhotfixを分けることはあり得る) -![hotfix branch](./img/branch_strategy_hotfix.drawio.png) +![hotfix branch](img/branch_strategy_hotfix.drawio.png) ## topicブランチ @@ -120,7 +120,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 - topicブランチが必要なケースでは、featureブランチへの直接プッシュを行ってはならない - GitHub Flowではfeatureブランチのことをtopicブランチと呼称する場合があるが、本規約ではfeatureブランチから派生するブランチをtopicブランチと定義する -![topic branch](./img/branch_strategy_topic.drawio.png) +![topic branch](img/branch_strategy_topic.drawio.png) # ブランチ戦略の選定 @@ -163,7 +163,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 ## 1. developブランチを複数作成する場合 -![multi develop branch](./img/branch_strategy_multi_develop.drawio.png) +![multi develop branch](img/branch_strategy_multi_develop.drawio.png) 日々のエンハンス開発と並行して、数カ月後に大型リリースを行いたい場合がある。このときは複数リリースバージョンを並行して開発するため、 `develop`、`develop2` といった複数のdevelopブランチを作る必要がある。 @@ -178,7 +178,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 - 誤操作を避ける目的でcherry-pickは行わない - `devleop2` への同期は、 `develop` -> `main` ブランチに反映されるタイミングで同期を行う(これにより、品質保証済みの変更のみ取り入れることができる9 -![release multi develop branch](./img/branch_strategy_release_multi_develop.drawio.png) +![release multi develop branch](img/branch_strategy_release_multi_develop.drawio.png) ### develop2のリリース手順 @@ -193,7 +193,7 @@ featureブランチで実現する機能を複数人で開発する場合に使 ## 2. 過去バージョンをサポートする場合 -![multi version branch](./img/branch_strategy_multi_version.drawio.png) +![multi version branch](img/branch_strategy_multi_version.drawio.png) (社内外の)ライブラリでインターフェースの大型改善や仕様変更を受けて、メジャーバージョンを1→2に上げることがる。この時に過去バージョンもサポートする必要があると、バージョン別にsupportブランチを作成する。 @@ -230,7 +230,7 @@ developブランチの変更をfeatureブランチに取り込む方法には、 | 1. マージコミット | 2. リベース | | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| ![マージ](./img/merge_strategy_develop_to_feature_merge.drawio.png) | ![リベース](./img/merge_strategy_develop_to_feature_rebase.drawio.png) | +| ![マージ](img/merge_strategy_develop_to_feature_merge.drawio.png) | ![リベース](img/merge_strategy_develop_to_feature_rebase.drawio.png) | | `get fetch & git merge`(≒ `git pull`)。マージコミットが作成される | `get fetch & git rebase`(≒ `git pull --rebase`)。最新の開発ブランチの先頭から新たにコミットを作りなされ、マージコミットは作成されない | 本規約の推奨は「2. リベース」である。 @@ -325,12 +325,12 @@ Terraformはplanが成功しても、applyが失敗することは多々あり developブランチにfeatureブランチの変更を取り込む方法は下表のように3パターン存在する。 -| | 1.マージコミット | 2.リベース | 3.スカッシュマージ | -| ---- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| 名称 | Create a merge commit | Rebase and merge | Squash and merge | -| 流れ | ![Merge Commit](./img/merge_strategy_feature_to_develop_merge_commit.drawio.png) | ![Rebase and Merge](./img/merge_strategy_feature_to_develop_rebase_and_merge.drawio.png) | ![Squash and Merge](./img/merge_strategy_feature_to_develop_squash_and_merge.drawio.png) | -| 説明 | `git merge --no-ff` で変更を取り込む | featureブランチを最新のdevelopブランチにリベースし、`git merge --ff` で変更を取り込む | `git merge --squash` で変更を取り込む | -| 特徴 | developブランチにマージコミットが作成される | マージコミットは作成されず、履歴が一直線になる | featureブランチで行った変更YとZを1つにまとめたコミットがdevelopブランチに作成される | +| | 1.マージコミット | 2.リベース | 3.スカッシュマージ | +| ---- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| 名称 | Create a merge commit | Rebase and merge | Squash and merge | +| 流れ | ![Merge Commit](img/merge_strategy_feature_to_develop_merge_commit.drawio.png) | ![Rebase and Merge](img/merge_strategy_feature_to_develop_rebase_and_merge.drawio.png) | ![Squash and Merge](img/merge_strategy_feature_to_develop_squash_and_merge.drawio.png) | +| 説明 | `git merge --no-ff` で変更を取り込む | featureブランチを最新のdevelopブランチにリベースし、`git merge --ff` で変更を取り込む | `git merge --squash` で変更を取り込む | +| 特徴 | developブランチにマージコミットが作成される | マージコミットは作成されず、履歴が一直線になる | featureブランチで行った変更YとZを1つにまとめたコミットがdevelopブランチに作成される | ::: tip GitLabを利用する場合 @@ -338,11 +338,11 @@ GitLabでも開発ブランチに機能ブランチの変更を取り込む方 ただし、マージリクエスト上のオプションによってコミット履歴が変わる点が注意である。 -| | 1. Merge commit | 2. Merge commit with semi-linear history | 3. Fast-forward merge | -| ---- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| 流れ | ![Merge commit with squash commits](./img/merge_strategy_feature_to_develop_squash_and_merge_gitlab.drawio.png) | 省略 | 省略 | -| 説明 | GitHubにおける `Create a merge commit` と同様のマージ方法 | `Merge commit` と同じコマンドを使用して、機能ブランチの変更を取り込む方法 | GitHubにおける `Rebase and merge` と同様のマージ方法 | -| 注意 | `Squash commits` を選択してマージした場合、`squash commit` と `merge commit` の2つのコミットが作成される | ソースブランチがターゲットブランチより古い場合はリベースしないとマージできない。 | マージリクエスト上で `Squash commits` を選択してマージした場合、GitHubにおける `Squash and merge` と同様のマージ方法になる(※補足1) | +| | 1. Merge commit | 2. Merge commit with semi-linear history | 3. Fast-forward merge | +| ---- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| 流れ | ![Merge commit with squash commits](img/merge_strategy_feature_to_develop_squash_and_merge_gitlab.drawio.png) | 省略 | 省略 | +| 説明 | GitHubにおける `Create a merge commit` と同様のマージ方法 | `Merge commit` と同じコマンドを使用して、機能ブランチの変更を取り込む方法 | GitHubにおける `Rebase and merge` と同様のマージ方法 | +| 注意 | `Squash commits` を選択してマージした場合、`squash commit` と `merge commit` の2つのコミットが作成される | ソースブランチがターゲットブランチより古い場合はリベースしないとマージできない。 | マージリクエスト上で `Squash commits` を選択してマージした場合、GitHubにおける `Squash and merge` と同様のマージ方法になる(※補足1) | (※補足1)マージ方法で Merge commit を選択して、マージリクエスト上で Squash commits オプションを選択してマージした場合は以下と同義である @@ -418,7 +418,7 @@ git merge --no-ff $SOURCE_SHA - issue-312のリリースは業務上の合意が得られていない(エンドユーザ操作に影響があるため、事前告知した日時でリリースしたいなど) - issue-394は不具合修正であり業務上の優先度が高いため、なるべく早くリリースしたい -![同一ファイルを複数](./img/release_overtaking.drawio.png) +![同一ファイルを複数](img/release_overtaking.drawio.png) よく陥りがちな対策としては次の2点が考えられる。 @@ -437,7 +437,7 @@ git merge --no-ff $SOURCE_SHA 2の例を以下に図示する -![hotfixで追い抜き](./img/release_overtaking_hotfix.drawio.png) +![hotfixで追い抜き](img/release_overtaking_hotfix.drawio.png) # ブランチ命名規則 @@ -457,7 +457,7 @@ Gitにはタグ機能があり、リリースポイントとしてタグを作 - 入力間違えなどのケースを除き、一度タグをつけた後は削除しない - 後述する「タグの命名規則」に従う -![GitHub画面でbackend/v1.6.0のタグを作成する](./img/create_new_tag.png) +![GitHub画面でbackend/v1.6.0のタグを作成する](img/create_new_tag.png) 何かしらの理由で、コマンドラインからタグを作成する必要がある場合は、以下に注意する。画面経由・コマンドライン経由でのタグ作成は混ぜないようにし、運用手順は統一する。 @@ -496,7 +496,7 @@ frontend/v1.1.0 - フロントエンド・バックエンドで整合性を保っているのであれば、メモ目的でバージョンを記載する運用を推奨とする - 実用的な利用用途が思いつかない場合は、開発者視点での楽しみリリースの大きなマイルストーンの名称など、チームの関心事を記入することを推奨とする -![create new tag](./img/create_new_tag_title.png) +![create new tag](img/create_new_tag_title.png) 何かしらの理由で、コマンドラインからタグを作成する必要がある場合は、GitHub利用時の規則に合わせて次のように作成する。 @@ -869,7 +869,7 @@ GUIでのGit操作にあたり、次の2つの拡張機能をインストール サイドバー > Explorer か Source Control > Clone Repository ボタンをクリックし、URLを入力すると、リポジトリをクローンできる。 -![Clone1](./img/vscode_git_clone1.png) ![Clone2](./img/vscode_git_clone2.png) +![Clone1](img/vscode_git_clone1.png) ![Clone2](img/vscode_git_clone2.png) ### コミットグラフの表示 @@ -877,7 +877,7 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l 白丸のグラフアイコン (Show Commit Graph) はGitLensのコミットグラフだが、冒頭の記述通り、Pro版でのみの提供となる。 -![Graph1](./img/vscode_git_graph1.png) ![Graph2](./img/vscode_git_graph2.png) +![Graph1](img/vscode_git_graph1.png) ![Graph2](img/vscode_git_graph2.png) ### リモートのフェッチ/プル (`git fetch` / `git pull`) @@ -886,11 +886,11 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l - SOURCE CONTROL パネル > 三点リーダーアイコン (More Actions...) をクリックし、 Fetch を選択 - コミットグラフ > 雲アイコン (Fetch from Remote(s)) をクリック -![Fetch1](./img/vscode_git_fetch1.png) +![Fetch1](img/vscode_git_fetch1.png) なお、フェッチ後に以下のようなダイアログが表示される場合があるが、 "Yes" を選択すると、自動で定期的にフェッチを行う。 -![Fetch2](./img/vscode_git_fetch2.png) +![Fetch2](img/vscode_git_fetch2.png) ### ブランチの作成/チェックアウト (`git branch` / `git checkout`) @@ -902,17 +902,17 @@ SOURCE CONTROL パネル > 黒丸のグラフアイコン (View Git Graph (git l - コミットグラフ > 作成元コミットの行上で右クリックし、Create Branch... を選択 - "Check out" にチェックを入れると、作成したブランチにチェックアウトする -![Branch1](./img/vscode_git_branch1.png) ![Branch2](./img/vscode_git_branch2.png) +![Branch1](img/vscode_git_branch1.png) ![Branch2](img/vscode_git_branch2.png) ### ステージ/コミット/プッシュ (`git add` / `git commit` / `git push`) SOURCE CONTROL パネル > 変更ファイルの行 > +アイコン (Stage Changes) をクリックすると、対象ファイルをステージできる。(Changes > +アイコン (Stage All Changes) をクリックすると、すべての変更をステージする) -![Stage](./img/vscode_git_stage.png) +![Stage](img/vscode_git_stage.png) 必要な変更をステージ後、 SOURCE CONTROL パネル内でコミットメッセージを入力し、 Commit ボタンをクリックすると、コミットを作成できる。 -![Commit](./img/vscode_git_commit.png) +![Commit](img/vscode_git_commit.png) 以下のいずれかの操作を実行すると、作成したコミットをリモートリポジトリにプッシュできる。 @@ -920,6 +920,6 @@ SOURCE CONTROL パネル > 変更ファイルの行 > +アイコン (Stage Chang - BRANCHES パネル > 対象ブランチの行 > 雲アイコン (Publish Branch) をクリック - コミットグラフ > 対象ブランチの上で右クリックし、Push Branch... を選択 -![push1](./img/vscode_git_push1.png) ![push2](./img/vscode_git_push2.png) ![push3](./img/vscode_git_push3.png) +![push1](img/vscode_git_push1.png) ![push2](img/vscode_git_push2.png) ![push3](img/vscode_git_push3.png) ::: From 8f1cc20e2620e5a2c4bb746be83f52570568f3f7 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:56:04 +0900 Subject: [PATCH 09/10] update --- .github/workflows/GHPages.yml | 1 - package.json | 3 --- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/GHPages.yml b/.github/workflows/GHPages.yml index 507eac4a..4173da68 100644 --- a/.github/workflows/GHPages.yml +++ b/.github/workflows/GHPages.yml @@ -20,7 +20,6 @@ jobs: - name: Build all run: | npm run build - npm run copy - name: Deploy uses: peaceiris/actions-gh-pages@v4 with: diff --git a/package.json b/package.json index 365c17a2..e65978c8 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,6 @@ "lint": "npm run lint:format && npm run lint:js", "lint:js": "eslint . .vitepress", "lint:format": "prettier . --list-different", - "copy": "npm-run-all copy:*", - "copy:git": "cp -r documents/forGitBranch/img docs/documents/forGitBranch/img", - "copy:markdown": "cp -r documents/forMarkdown/future_muscle_partner/docs/future_muscle_partner_abstract.png docs/documents/forMarkdown/future_muscle_partner/docs/future_muscle_partner_abstract.png", "format": "prettier . --write" }, "repository": { From 91976ebac321b0e6de45a487d0932642f5a3ad98 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Mon, 23 Dec 2024 17:57:08 +0900 Subject: [PATCH 10/10] remove install script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index e65978c8..b1d8aded 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "scripts": { "watch": "vitepress dev . --open", "build": "vitepress build .", - "install": "npm install --global mermaid-filter", "lint": "npm run lint:format && npm run lint:js", "lint:js": "eslint . .vitepress", "lint:format": "prettier . --list-different",