Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roktas committed Jan 17, 2024
0 parents commit 9035a33
Show file tree
Hide file tree
Showing 78 changed files with 2,702 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint
on: [push, pull_request, workflow_dispatch]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install 🥁
run: sudo apt-get -y update && sudo apt-get -y install shellcheck
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Lint 🔬
run: shellcheck $(find . -name '*.sh')
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.box
*.iso
/.envrc
/.local/tmp/
/.vagrant*/
9 changes: 9 additions & 0 deletions .local/bin/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")"/../.. || exit

build
package
play -- -t 'echo OK'
10 changes: 10 additions & 0 deletions .local/bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

provision=provision
provider=virtualbox

vagrant destroy -f || true
vagrant up --provision-with "$provision" --provider "$provider"
vagrant halt
7 changes: 7 additions & 0 deletions .local/bin/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

.local/bin/unplay || true

rm -rf ./*.box ./*.iso MD5SUM .local/tmp
11 changes: 11 additions & 0 deletions .local/bin/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

version=${VERSION:-$(date +"%Y%m%d")}
codename=bookworm
provider=virtualbox
box=${codename}_${version}_${provider}.box

vagrant package --output "$box" --vagrantfile .local/etc/Vagrantfile
md5sum "$box" >MD5SUM
17 changes: 17 additions & 0 deletions .local/bin/play
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

box=$(find "$PWD" -type f -name '*.box' ! -size 0 | head -n 1)

if [[ -n $box ]]; then
mkdir -p .local/tmp && cd .local/tmp || exit

vagrant box add -f --name test "$box"
vagrant init -f -m test
vagrant up
vagrant ssh "$@"
else
echo >&2 "No box found."
exit 1
fi
6 changes: 6 additions & 0 deletions .local/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

ln -sf .local/etc/envrc .envrc
command -v direnv &>/dev/null && direnv allow
13 changes: 13 additions & 0 deletions .local/bin/unplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"/../.. || exit

if [[ -f .local/tmp/Vagrantfile ]]; then
cd .local/tmp || exit

vagrant destroy -f
vagrant box remove -f test
else
echo >&2 "No Vagrantfile at .local/tmp."
exit 1
fi
14 changes: 14 additions & 0 deletions .local/etc/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Vagrant.configure("2") do |config|
config.vm.box = "debian/bookworm64"

config.vm.provider "virtualbox" do |virtualbox|
virtualbox.cpus = 2
virtualbox.customize ["modifyvm", :id, "--vram", "64"]
virtualbox.linked_clone = true
virtualbox.memory = 4096
end

if File.exist?("/usr/share/virtualbox/VBoxGuestAdditions.iso")
config.vm.disk :dvd, name: "GuestAdditions", file: "/usr/share/virtualbox/VBoxGuestAdditions.iso"
end
end
2 changes: 2 additions & 0 deletions .local/etc/envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
layout vagrant
layout local
Empty file added .nojekyll
Empty file.
3 changes: 3 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
disable=SC1090
disable=SC1091
disable=SC2154
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debian.roktas.dev
Loading

0 comments on commit 9035a33

Please sign in to comment.