3.3 KiB
3.3 KiB
Gitea 버전 갱신 가이드
1. git 작업 환경 구성
- 서비스 카탈로그 git 다운로드
$ git clone https://github.com/paasup/service-catalog.git
- 작업 브랜치로 체크아웃
$ git checkout -b update-gitea/6.0.3
2. 차트 업데이트
1) 차트 버전 변경
-
README-build.md, custom-values.yaml(이름 미정)을 제외한 파일 삭제
# chart 디렉토리로 이동 cd ~/service-catalog/charts/gitea # 파일 삭제 전 삭제할 파일 목록 확인 find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -print # 파일 삭제 find . -mindepth 1 \( -name "CUSTOM-README.md" -o -name "BUILD-README.md" -o -name "custom-values.yaml" \) -prune -o -exec rm -rf {} + -
bitnami/gitea 차트 다운로드
# charts 디렉토리로 이동 cd ~/service-catalog/charts # helm repo 추가 helm repo add gitea-charts https://dl.gitea.io/charts/ helm repo update # helm 차트 helm pull gitea-charts/gitea --version="6.0.3" # 차트 변경 tar xzvf gitea-*.tgz # 필요 없는 파일 삭제 rm gitea-*.tgz
2) 차트 수정 사항 반영
- gitea 배포 시 sso 및 외부 db 사용을 기본으로 하기 위하여 차트의 파일을 수정하였다.
./values.yaml
-
다음은 gitea에 SSO 설정을 사용할 때, 대상 keycloak이 사설인증서를 사용하면 X509 에러가 발생한다.
에러 해결을 위해서 인증서를 등록하기 위해
lifecycleHooks를 추가하였다. -
그리고 기본으로 활성화되어 있는
memcached.enable과postgresql.enable을 diable로 변경하였다.
...
clusterDomain: cluster.local
# line 22 아래 항목 추가
## @param lifecycleHooks LifecycleHook to set additional configuration at startup Evaluated as a template
##
lifecycleHooks: {}
...
memcached:
## line 413 true를 false로 변경
enabled: false
...
postgresql:
## line 416 true를 false로 변경
enabled: false
./templates/_helpers.tpl
...
## line 334
{{/*
Renders a value that contains template.
Usage:
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "common.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
./templates/statefulset.yaml
...
containers:
- name: {{ .Chart.Name }}
image: "{{ include "gitea.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
# line 205 아래 내용 추가
{{- if .Values.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
3. git push 및 tag 추가
- 갱신작업 진행후 commit
$ git add .
$ git commit -m "update gitea/6.0.3"
- main 브랜치에 체크아웃 후 merge
$ git checkout main
$ git merge update-gitea/6.0.3
- git에 push 후 작업 브랜치 삭제
$ git push -u origin main
$ git branch -d update-gitea/6.0.3
- git tag 추가 후 push
$ git tag gitea/6.0.3
$ git push origin gitea/6.0.3