mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-12-31 21:56:41 +01:00
🔨 chore(p3): add error checking in script, cleanup host appending
Signed-off-by: dyn <oss+dyn@xtrm.me>
This commit is contained in:
@ -1,29 +1,48 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
k3d cluster create inception-of-things
|
k3d cluster create inception-of-things
|
||||||
kubectl create namespace argocd
|
kubectl create namespace argocd
|
||||||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
||||||
|
|
||||||
echo ArgoCD is starting...
|
echo ArgoCD is starting...
|
||||||
|
|
||||||
kubectl wait --namespace argocd \
|
kubectl wait --namespace argocd \
|
||||||
--for=condition=ready pod \
|
--for=condition=ready pod \
|
||||||
--selector=app.kubernetes.io/name=argocd-server \
|
--selector=app.kubernetes.io/name=argocd-server \
|
||||||
--timeout=300s \
|
--timeout=300s \
|
||||||
1>/dev/null 2>/dev/null
|
1>/dev/null 2>/dev/null
|
||||||
|
|
||||||
kubectl port-forward svc/argocd-server -n argocd 8080:443 1>/dev/null 2>/dev/null &
|
kubectl port-forward svc/argocd-server -n argocd 8080:443 1>/dev/null 2>/dev/null &
|
||||||
echo 'ArgoCD is running'
|
echo 'ArgoCD is running'
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
|
||||||
|
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||||
|
|
||||||
kubectl create namespace dev
|
kubectl create namespace dev
|
||||||
kubectl apply -n argocd -f ../confs/argocd-app.yml
|
kubectl apply -n argocd -f "$SCRIPT_DIR/../confs/argocd-app.yml"
|
||||||
echo 'App is starting...'
|
echo 'App is starting...'
|
||||||
|
|
||||||
kubectl wait --namespace dev \
|
kubectl wait --namespace dev \
|
||||||
--for=condition=ready pod \
|
--for=condition=ready pod \
|
||||||
--selector=app.kubernetes.io/name=app-deployment \
|
--selector=app.kubernetes.io/name=app-deployment \
|
||||||
--timeout=300s \
|
--timeout=300s \
|
||||||
1>/dev/null 2>/dev/null
|
1>/dev/null 2>/dev/null
|
||||||
echo 'App imported in ArgoCD'
|
echo 'App imported in ArgoCD'
|
||||||
|
|
||||||
TRAEFIK_IP=$(kubectl get service -n kube-system traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
TRAEFIK_IP=$(kubectl get service -n kube-system traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||||
echo App is reachable at argo-app.com
|
|
||||||
echo Traefik ip is : $TRAEFIK_IP
|
echo Traefik ip is : $TRAEFIK_IP
|
||||||
echo Login into ArgoCD with:
|
if grep -q argo-app.com /etc/hosts; then
|
||||||
|
sudo sed -i "/argo-app.com/d" /etc/hosts
|
||||||
|
fi
|
||||||
|
echo "$TRAEFIK_IP argo-app.com" | sudo tee -a "/etc/hosts"
|
||||||
|
echo App is now reachable at argo-app.com
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "=== Login into ArgoCD with: ==="
|
||||||
echo Username: admin
|
echo Username: admin
|
||||||
ADMIN_PASS=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
|
ADMIN_PASS=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
|
||||||
echo Password: \'$ADMIN_PASS\'
|
echo Password: \'$ADMIN_PASS\'
|
||||||
|
echo "==============================="
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
echo "172.19.0.2 argo-app.com" | sudo tee -a "/etc/hosts"
|
|
||||||
# Edit the IP with the ip in the output of argo-install.sh
|
|
||||||
@ -97,7 +97,6 @@
|
|||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
librewolf
|
|
||||||
bindfs
|
bindfs
|
||||||
git
|
git
|
||||||
zip
|
zip
|
||||||
|
|||||||
Reference in New Issue
Block a user