Compare commits

..

1 Commits
k3s ... prod

Author SHA1 Message Date
f231efb04e feat: renovatebot (#2)
All checks were successful
/ deploy (push) Successful in 19s
Reviewed-on: #2
2024-12-23 02:44:15 +00:00
5 changed files with 13 additions and 10 deletions

View File

@ -11,7 +11,7 @@ jobs:
if [ "${{ gitea.ref_name }}" == prod ] && [ -n "$PROD_URL" ]; then
BASE_URL="$PROD_URL"
else
BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k3s.gmoker.com"
BASE_URL="${{ gitea.ref_name }}.$(tr / '\n' <<< "${{ gitea.repository }}" | tac | tr '\n' .)k8s.gmoker.com"
fi
cat <<EOF >> .env
BASE_URL="$BASE_URL"
@ -20,4 +20,4 @@ jobs:
- uses: actions/k8sdeploy@v1
with:
kubeconfig: "${{ secrets.K3S }}"
kubeconfig: "${{ secrets.K8S }}"

View File

@ -4,4 +4,4 @@ URL='https://raw.githubusercontent.com'
REPO='go-gitea/gitea'
TAG="release/v$(awk -F: '/^IMAGEAPP/{sub(".[0-9]+-rootless", ""); print $2}' .env)"
$EDITOR -d -- config/app.ini "$URL/$REPO/$TAG/custom/conf/app.example.ini"
$EDITOR -d -c "wincmd l" -- "$URL/$REPO/$TAG/custom/conf/app.example.ini" config/app.ini

View File

@ -3,31 +3,34 @@ set -o pipefail
function kapply() {
for f in "$@"; do
kubectl apply --server-side -f<(envsubst < "manifests/$f")
kubectl apply -f <(envsubst < "manifests/$f")
done
}; export -f kapply
function kcreatesec() {
kubectl apply \
-f<(kubectl create secret generic --dry-run=server -oyaml "$@")
kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f-
}; export -f kcreatesec
function kcreatecm() {
kubectl apply -f<(kubectl create configmap --dry-run=server -oyaml "$@")
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f-
}; export -f kcreatecm
function kgseckey() {
local sec="$1"; shift
local key="$1"; shift
kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\"" | base64 -d
if ! kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\" // empty" | base64 -d; then
return 1
fi
}; export -f kgseckey
function kgcmkey() {
local cm="$1"; shift
local key="$1"; shift
kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\""
if ! kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\" // empty"; then
return 1
fi
}; export -f kgcmkey

View File

@ -7,5 +7,5 @@ export NB_REPLICAS=1
. ./manifests/bin/deploy.sh
if [ "$GITHUB_REF_NAME" = prod ]; then
kapply prod/ports.yaml
kapply prod/ssh.yaml
fi