Skip to content

Commit

Permalink
Update scripts, taskfile, homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Liana64 committed Nov 21, 2024
1 parent 09bfe0d commit 5337725
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vars:
SCRIPTS_DIR: "{{.ROOT_DIR}}/scripts"
SOPS_CONFIG_FILE: "{{.ROOT_DIR}}/.sops.yaml"
AGE_DIR: ~/.config/sops/age
AGE_FILE: "{{.AGE_DIR}}/keys.txt"
AGE_FILE: "{{.AGE_DIR}}/rd350.key"

#env:
# KUBECONFIG: "{{.KUBECONFIG_FILE}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ layout:
columns: 4
Services:
tab: Main
Tools:
tab: Main
Home:
tab: Main
Endpoints:
Expand Down
1 change: 1 addition & 0 deletions scripts/kubeconform.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/bash

set -o errexit
set -o pipefail

Expand Down
50 changes: 48 additions & 2 deletions scripts/wip.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
#!/usr/bin/bash
#!/bin/bash

# Improved version of brettinternet's wip.sh
# https://github.com/brettinternet/homeops/blob/main/scripts/wip.sh
#
# Usage:
# create WIP commit
# push to current branch
# reconcile the cluster with flux
# remove previous WIP commit
#
# Options:
# -c, --cluster <cluster_name> Specify the cluster to reconcile (default: lianalabs)
# -h, --help Show this help message
# Usage: create WIP commit
# push to current branch
# reconcile the cluster with flux
# remove previous WIP commit

CLUSTER="lianalabs"

function show_help {
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo " -c, --cluster <cluster_name> Specify the cluster to reconcile (default: lianalabs)"
echo " -h, --help Show this help message"
exit 0
}

# Ensure secrets can be encrypted before we push
function check_go_task {
if ! command -v task &> /dev/null; then
echo "Error: go-task is not installed. Please install it before running this script."
exit 1
fi
}
echo -n "Checking variables..."

if [ ! -d "$ROOT_DIR" ]; then
Expand Down Expand Up @@ -43,6 +73,22 @@ function gpcf {
git push --force-with-lease origin "$(git_current_branch)"
}

while [[ "$#" -gt 0 ]]; do
case $1 in
-c|--cluster)
CLUSTER="$2"
shift 2
;;
-h|--help)
show_help
;;
*)
echo "Unknown parameter passed: $1"
exit 1
;;
esac
done

echo "Encrypting secrets"
echo ""
task sops:encrypt-all
Expand All @@ -51,7 +97,7 @@ gwip
gpcf
echo "Reconciling flux"
echo ""
task flux:reconcile cluster=lianalabs
task flux:reconcile cluster=$CLUSTER
echo ""
echo "Git Log:"
gunwip
Expand Down

0 comments on commit 5337725

Please sign in to comment.