From 01b1508ab4a959ffbce39fa68b4f29ae3631b998 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 28 Aug 2024 18:33:04 +0200 Subject: [PATCH] chore(gitea): run on k8s --- snippets/cut.sh | 4 ++++ snippets/gitea.sh | 4 ++++ snippets/helm.sh | 2 ++ snippets/jd.fish | 3 +++ snippets/kubectl.sh | 2 ++ 5 files changed, 15 insertions(+) create mode 100644 snippets/cut.sh create mode 100644 snippets/jd.fish diff --git a/snippets/cut.sh b/snippets/cut.sh new file mode 100644 index 0000000..afa3c1a --- /dev/null +++ b/snippets/cut.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +# limit strings to some length +echo 'some string longer than 20 characters' | cut -c '1-20' diff --git a/snippets/gitea.sh b/snippets/gitea.sh index 9048904..ce0856b 100644 --- a/snippets/gitea.sh +++ b/snippets/gitea.sh @@ -1,3 +1,7 @@ #!/usr/bin/env sh docker exec -ti 'gitea-server-1' sh + +kubectl --namespace 'gitea' create secret generic 'gitea-admin-secret' \ + --from-literal 'username=gitea_admin' --from-literal "password=Scribble0-Tray1-Finisher4" +helm upgrade -i -n 'gitea' --create-namespace --repo 'https://dl.gitea.com/charts/' 'gitea' 'gitea' -f 'values.yaml' diff --git a/snippets/helm.sh b/snippets/helm.sh index 7cb04ed..6934ad9 100644 --- a/snippets/helm.sh +++ b/snippets/helm.sh @@ -27,3 +27,5 @@ helm get manifest 'wordpress' helm -n 'monitoring' delete 'grafana' helm plugin list +helm plugin install 'https://github.com/databus23/helm-diff' +helm -n 'pocs' diff upgrade --repo 'https://dl.gitea.com/charts/' 'gitea' 'gitea' -f 'values.yaml' diff --git a/snippets/jd.fish b/snippets/jd.fish new file mode 100644 index 0000000..c9c2240 --- /dev/null +++ b/snippets/jd.fish @@ -0,0 +1,3 @@ +#!/usr/bin/env fish + +jd -yaml -color 'values.yaml' (helm show values --repo 'https://dl.gitea.com/charts/' 'gitea' | psub) diff --git a/snippets/kubectl.sh b/snippets/kubectl.sh index aacb4f8..4a79185 100644 --- a/snippets/kubectl.sh +++ b/snippets/kubectl.sh @@ -5,6 +5,8 @@ kubectl create namespace 'gitlab' kubectl create --namespace 'gitlab' secret generic 'gitlab-runner-token' --dry-run='client' --output 'yaml' \ --from-literal='runner-registration-token=""' --from-literal='runner-token=glrt-…' kubectl apply --namespace 'gitlab' --values 'secrets.yaml' +kubectl --namespace 'gitea' create secret generic 'gitea-admin-secret' \ + --from-literal 'username=gitea_admin' --from-literal "password=$(pulumi config get 'giteaAdminPassword')" kubectl get nodes 'fargate-ip-172-31-83-147.eu-west-1.compute.internal' -o 'yaml' | yq -y '.metadata.labels'