Skip to content

Instantly share code, notes, and snippets.

@ebuildy
Last active January 21, 2022 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebuildy/1d69e6ab8732d78d6ad86f740e9af430 to your computer and use it in GitHub Desktop.
Save ebuildy/1d69e6ab8732d78d6ad86f740e9af430 to your computer and use it in GitHub Desktop.
apiVersion: v2
name: my-elasticsearch
type: application
version: v0.0.1
dependencies:
- name: elasticsearch
repository: https://helm.datatok.io
version: 7.16.1-4
- name: networkpolicy
repository: https://ebuildy.github.io/k8s-as-helm/
version: v1.1.0
# from working branch
git switch -C feature/logstash-ingress
# do your stuff
# merge to working branch
git switch release
git merge feature/logstash-ingress
# Updating ee2cec6e..b20a98fa
# Fast-forward
# logstash/templates/ingress.yaml | 1 +
# 1 file changed, 1 insertion(+)
# prepare to PR , from upstream/main
git fetch upstream
git switch -C fork/logstash-ingress upstream/main
# cherry pick new commits
# <!> merge can be evil here <!>
git cherry-pick feature/logstash-ingress
# [fork/logstash-ingress 8c7db107] logstash: toto
# Date: Mon Dec 27 13:47:25 2021 +0100
# 1 file changed, 1 insertion(+)
# to create the PR
git push tom fork/logstash-ingress
# sometimes this throw a git errror, try
git push tom fork/logstash-ingress:fork/logstash-ingress
# clone our gitlab repo
git clone git@git.datatok.io:infra/helm-elastic.git # warning: You appear to have cloned an empty repository.
cd helm-elastic
# add remote
git remote add tom https://github.com/ebuildy/helm-charts.git
git remote add upstream https://github.com/elastic/helm-charts.git
# list all remotes
git remote
origin
tom
upstream
# fetch upstream references
git fetch upstream
# create working branch from last stable branch
# "release" will be our release branch, used to deploy Helm release
git switch -C release upstream/7.x
stages:
- deploy
before_script:
- export HELM_CHARTS=(apm-server elasticsearch kibana logstash metricbeat)
deploy/helm-charts:
stage: deploy
image: ghcr.io/ebuildy/keployr:v0.0.14
script: |
export VERSION=$(cat VERSION)
for i in "${HELM_CHARTS[@]}"
do
export CHART_NEW_NAME=my-${i}
echo "Process chart ${i}"
# edit in place to change chart name if needed
# yq e -i '.name = strenv(CHART_NEW_NAME)' ${i}/Chart.yaml
# edit in place maintainers & sources
yq e -i '.sources += strenv(CI_PROJECT_URL)' ${i}/Chart.yaml
yq e -i '.maintainers += {"name":"Thomas Decaux", "email" : "t.decaux@qwant.com"}' ${i}/Chart.yaml
helm cm-push --insecure --force --version=${VERSION} ./$i https://helm.datatok.io
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment