This commit is contained in:

View File

@@ -14,95 +14,6 @@ vars:
dotenv: [".sec"]
tasks:
# gitea-helm-publish:
# desc: Publish Helm chart to Gitea
# vars:
# chart_file: c:\\r\\helm-charts\\gitea\\gitea-11.0.0.tgz
# dir: .
# cmds:
# - dir=$(pwd)
# - task: gitea-helm-pack
# - curl --user {{.username}}:{{.password}} -X POST --upload-file {{.chart_file}} https://{{.gitea_url}}/api/packages/{{.owner}}/helm/api/charts
# silent: true
gitea-helm-pub:
desc: Отправка Helm chart в Gitea
vars:
repo: helm-charts
chart_file: "{{ .TASK_OUTPUT.gitea_helm_pack }}"
dir: .
cmds:
- task: gitea_helm_pack # Выполняем задачу для получения chart_file
- echo "Chart file {{ .chart_file }}"
# - helm repo add --username {{ .username }} --password {{ .password }} {{ .repo }} https://{{ .gitea_url }}/api/packages/{{ .owner }}/helm
# - helm cm-push "{{ .chart_file }}" {{ .repo }}
gitea_helm_pack:
desc: Pack Helm chart for Gitea
vars:
repo: helm-charts
chart_file: ""
dir: ./gitea
cmds:
- rm -f *.tgz
- |
output=$(helm package .)
# Получаем только последний токен из вывода, который содержит имя созданного .tgz файла
chart_file=$(echo "$output" | awk '{print $NF}')
# Выводим значение без лишних символов, чтобы его можно было корректно захватить как TASK_OUTPUT
echo "$chart_file"
- task: helm-push
# vars: { chart_file: {{ .chart_file }}, repo: "www" }
silent: true
helm:push:
desc: Установка плагина helm-push
dir: .
vars:
repo: '{{default "helm-charts" .repo}}'
chart_file: '{{default "" .chart_file}}'
cmds:
- echo "{{ .repo }} {{ .chart_file }}"
helm:argocd-pub:
desc: Отправка Helm chart в Gitea
vars:
repo: helm-charts
chart_file: c:\\r\\helm-charts\\argo-cd\\argo-cd-7.8.10.tgz
dir: .
cmds:
- dir=$(pwd)
- task: argocd-helm-pack
- helm repo add --username {{.username}} --password {{.password}} {{.repo}} https://{{.gitea_url}}/api/packages/{{.owner}}/helm
- helm cm-push {{.chart_file}} {{.repo}}
silent: true
argocd-helm-pack:
desc: Pack Helm chart for ArgoCD
# vars:
# CHART_FILE: gitea-11.0.0.tgz
dir: ./argo-cd
cmds:
- rm -f *.tgz
- CHART_FILE=$(helm package . | grep "Successfully packaged" | awk '{print $NF}')
- echo "File-$CHART_FILE-"
# silent: true
helm-push-inst:
desc: Установка плагина helm-push
dir: .
cmds:
- helm plugin install https://github.com/chartmuseum/helm-push
silent: true
greet:
vars:
RECIPIENT: '{{default "World" .RECIPIENT}}'
cmds:
- echo "Hello, {{.RECIPIENT}}!"
greet-pessimistically:
cmds:
- task: greet
vars: { RECIPIENT: 'Cruel World' }
silent: true
helm:argocd-build-pub:
desc: Отправка Helm chart в Gitea
vars:
@@ -110,9 +21,28 @@ tasks:
chart_name: argo-cd
dir: .
cmds:
- dir=$(pwd)
# - task: argocd-helm-pack
- helm repo add --username {{.username}} --password {{.password}} {{.repo}} https://{{.gitea_url}}/api/packages/{{.owner}}/helm
- helm cm-push {{.chart_name}} {{.repo}}
silent: true
helm:gitea-build-pub:
desc: Отправка Helm chart в Gitea
vars:
repo: helm-charts
chart_name: gitea
dir: .
cmds:
- helm repo add --username {{.username}} --password {{.password}} {{.repo}} https://{{.gitea_url}}/api/packages/{{.owner}}/helm
- helm cm-push {{.chart_name}} {{.repo}}
silent: true
отправить-все:
desc: Отправка всех Helm chart в Gitea
deps:
- task: helm:gitea-build-pub
- task: helm:argocd-build-pub
silent: true
helm:helm-push-inst:
desc: Установка плагина helm-push
dir: .
cmds:
- helm plugin install https://github.com/chartmuseum/helm-push
silent: true