GiitHub 개인 창고를 Helm 창고로 사용
6367 단어 KubernetesGitHub Actionshelmtech
문제.
회사 내에서 사용하는 헬름그래프의 공통화를 시작하려고 헬름창고를 마련하려고 합니다.
창고를 개인적으로 보관하고 싶습니다.
나는 가능한 한 간단하게 준비하고 싶다.
공공장소에서 할 수 있다면.
공중창고라도 괜찮다면 캐럿-releaser를 사용하면 간단하다.
솔루션
창고에 필요한 물건
다운로드 가능
helm package에서 생성된 파일.tgz다운로드 가능
helm repo index에서 생성된index.yaml차트 배치
나는 그것을 GiitHub 개인 창고에 두기로 결정했다.그러면 창고 내용물.
https://raw.githubusercontent.com/
다운로드는 가능하지만 아무도 방문할 수 없습니다.
Organization을 소유하고 개인 액세스 토큰을 발행하는 사람
https://[email protected]/
를 참고하십시오.
예제
charts브랜치의 루트 레이어 설정index.yaml과chart-version.tgz일 경우 이렇게 사용할 수 있습니다.helm repo add $HELM_REPO_NAME https://[email protected]/$ORG/$REPO/charts/
helm template $HELM_REPO_NAME/$CHART_NAME -f values.yaml --version 0.1.0
차트 자동 게시
Chart.yaml이 업데이트되면 자동으로
helm package와helm repo index를 실행하고 생성물을 charts 지점으로 밀어내면 도표의 발표가 자동화됩니다.GiitHub Action으로 해볼게요.
Chart.하면, 만약, 만약...
조사를 위해
사용 중입니다.
name: Release Charts
on:
push:
branches:
- main
paths:
- "**Chart.yaml"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.4
- name: Get changed files
id: files
uses: jitterbit/get-changed-files@v1
with:
format: 'csv'
- name: Push archives and index
shell: bash
run: |
echo ${{ steps.files.outputs.added_modified }}
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.files.outputs.added_modified }}')
for added_modified_file in "${added_modified_files[@]}"; do
if [[ ${added_modified_file} == *Chart.yaml ]]; then
echo ${added_modified_file} | sed -e 's/Chart.yaml//' | xargs helm package -d .package
fi
done
if [[ -n $(ls .package) ]]; then
git switch charts
mv .package/* ./
helm repo index .
git add -Av
git commit -m "update charts"
git push origin charts
else
echo "Nothing to do."
fi
Reference
이 문제에 관하여(GiitHub 개인 창고를 Helm 창고로 사용), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/mikutas/articles/2ab146fa1ea35b텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)