Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (66 sloc) 2.43 KB
pool:
vmImage: 'ubuntu-latest'
steps:
- task: YodLabs.VariableTasks.SetVariablesWithCredentials.SetVariablesWithCredentials@0
displayName: 'Github auth'
inputs:
ConnectionName: gh-push-tc-org
userNameVarName: U
passwordVarName: P
#- bash: |
# pwd
# ls -l $(build.sourcesDirectory)
# ls -l $(build.sourcesDirectory)/kubernetes/helm/terracotta
- task: Docker@0
displayName: 'Generate helm package'
inputs:
containerRegistryType: 'Container Registry'
action: 'Run an image'
imageName: 'alpine/helm'
volumes: |
$(build.sourcesDirectory)/kubernetes/helm/terracotta:/apps
containerCommand: 'package .'
detached: false
- task: Docker@0
displayName: 'Download existing index.yaml'
inputs:
containerRegistryType: 'Container Registry'
action: 'Run an image'
imageName: 'alpine:latest'
volumes: |
$(build.sourcesDirectory)/kubernetes/helm/terracotta:/apps
containerCommand: 'wget -P /apps/ https://softwareag.github.io/terracotta-cloud/index.yaml'
detached: false
- task: Docker@0
displayName: 'Generate helm index.yaml'
inputs:
containerRegistryType: 'Container Registry'
action: 'Run an image'
imageName: 'alpine/helm'
volumes: |
$(build.sourcesDirectory)/kubernetes/helm/terracotta:/apps
containerCommand: 'repo index --merge index.yaml .'
detached: false
- bash: |
# setup Github Pages branch and repo to push to
gh_url="https://$U:$P@github.com/SoftwareAG/terracotta-cloud.git"
gh_branch=gh-pages
gh_source="#${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}"
COMMIT=$(git rev-parse HEAD)
# setup git username and email; auth was done in a previous task
git config --local user.name "autogen"
git config --local user.email "autogen-noreply@no-reply.softwareag.com"
# to see the commands
set -o xtrace
# only keep files that were generated previously : index.yaml and a .tgz archive
cp $(build.sourcesDirectory)/kubernetes/helm/terracotta/index.yaml /tmp/
cp $(build.sourcesDirectory)/kubernetes/helm/terracotta/*.tgz /tmp/
git checkout -f gh-pages
git pull $gh_url $gh_branch
cp /tmp/index.yaml $(build.sourcesDirectory)/
cp /tmp/*.tgz $(build.sourcesDirectory)/
git add index.yaml *.tgz
git status
git commit -m "Update repository with latest helm chart from ${gh_source} ${COMMIT}" index.yaml *.tgz
git push $gh_url $gh_branch
displayName: 'Commit Helm Charts'
You can’t perform that action at this time.