Skip to content

Commit 72e4b34

Browse files
committed
Merge MR 'feat: add GL Runner mgmt script' into 'main'
See merge request el-capitano/dotfiles!456
2 parents fc5bf9f + 2ac52e6 commit 72e4b34

File tree

8 files changed

+92
-6
lines changed

8 files changed

+92
-6
lines changed

chezmoi/.chezmoi.toml.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ args = [
44
"-c",
55
"cp {{ "{{ .Target }}" }} {{ "{{ .Target }}" }}.base && code --new-window --wait --merge {{ "{{ .Destination }}" }} {{ "{{ .Target }}" }} {{ "{{ .Target }}" }}.base {{ "{{ .Source }}" }}",
66
]
7+
[diff]
8+
pager = "diffnav"

chezmoi/.chezmoiscripts/run_once_after_20_install-aqua-and-tools.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ chmod +x aqua-installer
1515

1616
rm './aqua-installer'
1717

18+
echo "Setting Aqua environment variables..."
19+
export AQUA_ROOT_DIR="${XDG_DATA_HOME:-$HOME/.local/share/aquaproj-aqua}"
20+
export PATH="${AQUA_ROOT_DIR}/bin:$PATH"
21+
export AQUA_GLOBAL_CONFIG=${AQUA_GLOBAL_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/aquaproj-aqua/aqua.yaml}
22+
export AQUA_GENERATE_WITH_DETAIL=true
23+
1824
echo "Installing global tools with Aqua..."
1925
aqua install --all

chezmoi/.chezmoiscripts/run_once_after_30_install-tools-with-mise.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo ""
1111
echo "Installing Git as Mise needs that as dependency"
1212
sudo apt install git -y
1313

14-
curl https://mise.run/ | sh
14+
wget -qO- https://mise.run/ | sh
1515

1616
echo "Installing dependencies for building Python..."
1717
sudo apt-get update

chezmoi/ansible/setup.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
- gnome-tweaks
4141
- graphviz
4242
- gtk2-engines-murrine
43-
- incus
4443
- jc
4544
- kitty # Our terminal!
4645
- nala
@@ -173,6 +172,41 @@
173172
- docker.service
174173
- containerd.service
175174

175+
- name: "[BLOCK] Add repo, install and configure Incus"
176+
block:
177+
- name: Add Incus's official GPG key
178+
ansible.builtin.apt_key:
179+
url: https://pkgs.zabbly.com/key.asc
180+
keyring: /etc/apt/keyrings/zabbly.asc
181+
state: present
182+
- name: Add Incus repository
183+
ansible.builtin.apt_repository:
184+
repo: >-
185+
Enabled: yes
186+
Types: deb
187+
URIs: https://pkgs.zabbly.com/incus/stable
188+
Suites: noble
189+
Components: main
190+
Architectures: {{ arch_mapping[ansible_architecture] | default(ansible_architecture) }}
191+
Signed-By: /etc/apt/keyrings/zabbly.asc
192+
filename: incus
193+
state: present
194+
- name: Install Incus and related packages
195+
ansible.builtin.apt:
196+
pkg:
197+
- incus
198+
state: present
199+
update_cache: true
200+
- name: Add incus-admin group
201+
ansible.builtin.group:
202+
name: incus-admin
203+
state: present
204+
- name: Add user to incus-admin group
205+
ansible.builtin.user:
206+
name: "{{ ansible_user }}"
207+
groups: incus-admin
208+
append: true
209+
176210
# === NOTE: This is currently not working on Ubuntu Asahi
177211
# - name: "[BLOCK] Add repo, install and configure Firefox"
178212
# block:

chezmoi/dot_bashrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export PATH="$HOME/.cargo/bin:$PATH"
5858
export PATH="$HOME/.local/bin:$PATH"
5959
export PATH="$HOME/bin:$PATH"
6060

61+
# Add Aqua variables
62+
export AQUA_ROOT_DIR="${XDG_DATA_HOME:-$HOME/.local/share/aquaproj-aqua}"
63+
export PATH="${AQUA_ROOT_DIR}/bin:$PATH"
64+
export AQUA_GLOBAL_CONFIG=${AQUA_GLOBAL_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/aquaproj-aqua/aqua.yaml}
65+
export AQUA_GENERATE_WITH_DETAIL=true
66+
6167
# Activate Mise: https://github.com/jdx/mise.
6268
if command -v mise &> /dev/null; then
6369
eval "$(mise activate bash)"

chezmoi/dot_config/aquaproj-aqua/aqua.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,15 @@ packages:
349349
- name: itaysk/[email protected]
350350
description: Clean up Kubernetes yaml and json output to make it readable
351351
link: https://github.com/itaysk/kubectl-neat
352+
- name: Lifailon/[email protected]
353+
description: TUI for journalctl, file system logs, as well Docker and Podman containers for quick viewing and filtering with fuzzy find, regex support (like fzf and grep) and coloring the output, written in Go with the gocui library
354+
link: https://github.com/Lifailon/lazyjournal
355+
- name: robinovitch61/[email protected]
356+
description: An interactive Kubernetes log viewer for your terminal
357+
link: https://github.com/robinovitch61/kl
358+
- name: Canop/[email protected]
359+
description: A nginx log explorer
360+
link: https://github.com/Canop/rhit
361+
- name: Automattic/harper/[email protected]
362+
description: The Grammar Checker for Developers
363+
link: https://github.com/Automattic/harper

chezmoi/dot_config/fish/conf.d/20_aliases.fish

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@ alias tfplan='terraform plan -out=plan.tfplan'
1313
alias pbcopy='xclip -selection clipboard'
1414
alias pbpaste='xclip -selection clipboard -o'
1515
alias cb='flatpak run app.getclipboard.Clipboard'
16-
17-
# Provision Hetzner GitLab Runners using scheduled pipelines trigger
18-
alias gl_runner_up='glab -R el-capitano/operations/hetzner-cloud-runners schedule run 2691862'
19-
alias gl_runner_down='glab -R el-capitano/operations/hetzner-cloud-runners schedule run 383558'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# set -g gl_runner_optspec 'b/backend=' no-plan
2+
3+
function gl_runner --description 'Manage the Hetzner Cloud Runner.'
4+
set -l up_schedule_id '2691862'
5+
set -l down_schedule_id '383558'
6+
set -l project_path 'el-capitano/operations/hetzner-cloud-runners'
7+
8+
if test -z $argv
9+
echo "No command given: set either 'up' or 'down'"
10+
return 1
11+
end
12+
13+
set -l action $argv[1]
14+
15+
if test $action = "up"
16+
echo "Starting runner..."
17+
glab -R $project_path schedule run $up_schedule_id
18+
else if test $action = "down"
19+
echo "Stopping runner..."
20+
glab -R $project_path schedule run $down_schedule_id
21+
22+
else
23+
echo "Unknown command, set either 'up' or 'down'"
24+
return 1
25+
end
26+
27+
28+
sleep 5 # Pipeline creation is async, so we wait...
29+
glab -R $project_path ci status -b main --live --compact
30+
end

0 commit comments

Comments
 (0)