NAMESPACE := "services" APP_NAME := "forgejo" status: @echo "=== Pods ===" @kubectl get pods -n {{NAMESPACE}} | grep forgejo @echo "" @echo "=== Services ===" @kubectl get svc -n {{NAMESPACE}} forgejo forgejo-ssh @echo "" @echo "=== Ingress ===" @kubectl get ingress -n {{NAMESPACE}} forgejo-ingress forgejo-ingress-lan @echo "" @echo "=== PVCs ===" @kubectl get pvc -n {{NAMESPACE}} | grep forgejo @echo "" @echo "=== ArgoCD Status ===" @kubectl get application {{APP_NAME}} -n cicd -o jsonpath='Sync: {.status.sync.status}, Health: {.status.health.status}' 2>/dev/null && echo "" logs lines="100": kubectl logs -n {{NAMESPACE}} -l app=forgejo --tail={{lines}} -f port-forward port="3000": @echo "Forwarding forgejo to localhost:{{port}}" kubectl port-forward -n {{NAMESPACE}} svc/forgejo {{port}}:80 sync: @echo "Triggering ArgoCD sync..." @kubectl annotate application {{APP_NAME}} -n cicd argocd.argoproj.io/refresh=normal --overwrite @sleep 2 @kubectl get application {{APP_NAME}} -n cicd -o jsonpath='Sync: {.status.sync.status}, Health: {.status.health.status}' && echo "" restart: @echo "Restarting forgejo..." kubectl rollout restart -n {{NAMESPACE}} deployment/forgejo # One-time after the first successful start. This is the ONLY way in: the web # installer is locked and registration is disabled. # `admin user create` does not prompt -- without --password or --random-password # it exits with "must set either password or random-password flag". Use a # generated password (printed once, to stdout) rather than passing one on the # command line where it would land in shell history and ps output. create-admin username="paul" email="paul.buetow@gmail.com": @echo "The generated password is printed below -- copy it now, it is shown only once." kubectl exec -n {{NAMESPACE}} -it deploy/forgejo -- \ forgejo admin user create --admin --username {{username}} --email {{email}} \ --random-password # Open a shell as the git user inside the running instance. shell: kubectl exec -n {{NAMESPACE}} -it deploy/forgejo -- /bin/sh