-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from na2na-p/topic/argocd
ArgoCD対応
- Loading branch information
Showing
17 changed files
with
136 additions
and
60 deletions.
There are no files selected for viewing
File renamed without changes.
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,9 +1,9 @@ | ||
name: CD for v3(main) | ||
name: CD for main | ||
|
||
on: | ||
push: | ||
branches: | ||
- v3 | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
|
@@ -16,6 +16,8 @@ jobs: | |
outputs: | ||
tag_exists: ${{ steps.check_docker_hub.outputs.tag_exists }} | ||
JETDISC_VERSION: ${{ steps.check_docker_hub.outputs.JETDISC_VERSION }} | ||
PREVIOIUS_LATEST_TAG: ${{ steps.get_previous_latest_tag.outputs.PREVIOIUS_LATEST_TAG }} | ||
LATEST_TAG: ${{ steps.genelate_latest_tag.outputs.LATEST_TAG }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/[email protected] | ||
|
@@ -27,13 +29,21 @@ jobs: | |
id: check_docker_hub | ||
run: | | ||
DOCKER_HUB_TAGS=$(curl -s ${{ env.DOCKER_TAG_API_URI }} | jq -r '.results[] | .name') | ||
if [ $(echo $DOCKER_HUB_TAGS | grep -c $JETDISC_VERSION) -eq 1 ]; then | ||
if echo "$DOCKER_HUB_TAGS" | grep -q "^$JETDISC_VERSION$"; then | ||
echo "Tag $JETDISC_VERSION already exists on Docker Hub." | ||
else | ||
echo "Tag $JETDISC_VERSION does not exist on Docker Hub." | ||
echo "tag_exists=false" >> $GITHUB_OUTPUT | ||
echo "JETDISC_VERSION=$JETDISC_VERSION" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Get Current Latest Tag | ||
id: get_previous_latest_tag | ||
run: | | ||
echo "PREVIOIUS_LATEST_TAG=$(curl -s $DOCKER_TAG_API_URI | jq -r '.results | sort_by(.last_updated) | last | .name')" >> $GITHUB_OUTPUT | ||
- name: Genelate Latest Tag by commit hash | ||
id: genelate_latest_tag | ||
run: | | ||
echo "LATEST_TAG=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
Build-and-Push-to-Docker-Hub: | ||
needs: | ||
|
@@ -43,5 +53,6 @@ jobs: | |
JETDISC_VERSION: ${{ needs.Prepare.outputs.JETDISC_VERSION }} | ||
IMAGE_REPOSITORY: na2na | ||
IMAGE_NAME: jetdisc | ||
LATEST_TAG: ${{ needs.Prepare.outputs.LATEST_TAG }} | ||
uses: ./.github/workflows/image-build-and-publish.yml | ||
secrets: inherit |
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
- v3 | ||
types: | ||
- opened | ||
- reopened | ||
|
@@ -24,6 +23,23 @@ jobs: | |
- ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- name: Setup asdf | ||
uses: asdf-vm/actions/[email protected] | ||
continue-on-error: true | ||
- name: install ffmpeg dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y nasm | ||
- name: Cache asdf | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.asdf | ||
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }} | ||
- name: asdf install | ||
uses: asdf-vm/actions/[email protected] | ||
ci: | ||
uses: ./.github/workflows/ci.yml | ||
secrets: inherit | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
- ready_for_review | ||
branches: | ||
- main | ||
- v3 | ||
|
||
jobs: | ||
enable-auto-merge: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
nodejs 20.9.0 | ||
pnpm 8.10.5 | ||
nodejs 20.10.0 | ||
pnpm 8.11.0 | ||
python 3.11.6 | ||
ffmpeg 6.1 | ||
kubectl 1.28.4 | ||
argocd 2.9.2 |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
"source.fixAll.eslint": "always" | ||
}, | ||
"cSpell.words": [ | ||
"argocd", | ||
"jetdisc", | ||
"libsodium", | ||
"swcrc", | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
```mermaid | ||
graph TD | ||
A[1. topic PRが提出される] -->|CIやレビューを通過する| B[3. デフォルトブランチにマージされる] | ||
B --> C[4. デフォルトブランチのpackage.jsonのversionと同じタグのイメージを確認] | ||
C -->|存在している| D[4.5. 何もしない] | ||
C -->|存在していない| E[5. イメージのビルドとpush] | ||
E --> F[6. Renovateがvalues.yamlとイメージレジストリ上の最新イメージタグを比較] | ||
F -->|新しいバージョンがある場合| G[7. 自動でPRを提出] | ||
F -->|新しいバージョンがない場合| H[8. 何もしない] | ||
G --> I[8. PRがマージされる] | ||
I --> J[9. ArgoCDがチャートの差分を検知しデプロイ] | ||
``` |
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,32 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
metadata: | ||
name: jetdisc-applicationset | ||
namespace: argocd | ||
spec: | ||
generators: | ||
- list: | ||
elements: | ||
- name: jetdisc | ||
repo: https://github.com/na2na-p/jetdisc.git | ||
path: infra/k8s/helm | ||
destServer: https://kubernetes.default.svc | ||
destNamespace: jetdisc | ||
# TODO: v3のマージ進んできたらブランチ名ごとmainに変更する | ||
targetRevision: v3 | ||
template: | ||
metadata: | ||
name: "{{name}}" | ||
spec: | ||
project: default | ||
source: | ||
repoURL: "{{repo}}" | ||
targetRevision: "{{targetRevision}}" | ||
path: "{{path}}" | ||
destination: | ||
server: "{{destServer}}" | ||
namespace: "{{destNamespace}}" | ||
syncPolicy: | ||
automated: | ||
selfHeal: true | ||
prune: true |
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
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
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