Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up semaphore #5

Merged
merged 10 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v1.0
name: test
agent:
machine:
type: e1-standard-2
os_image: ubuntu2004
blocks:
- name: Main
task:
prologue:
commands:
- checkout
- bash install.bash
jobs:
- name: Install
commands:
- bash --rcfile "$HOME"/.bashrc -ic "which bashfox"
- name: Uninstall
commands:
- UBFORCE=1 bash uninstall.bash
- bash --rcfile "$HOME"/.bashrc -ic "! which bashfox"
12 changes: 7 additions & 5 deletions uninstall.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
echo "UNINSTALLING BASHFOX"
randstr="$(base64 /dev/urandom -w6 | grep -v '/' | head -n1)"
echo
echo "--- CHECK ---"
read -p "Enter $randstr to proceed: " check
[ "$check" = "$randstr" ] || ( echo "Abort" && exit )
if [ ! "$UBFORCE" ]; then
randstr="$(base64 /dev/urandom -w6 | grep -v '/' | head -n1)"
echo
echo "--- CHECK ---"
read -p "Enter $randstr to proceed: " check
[ "$check" = "$randstr" ] || ( echo "Abort" && exit )
fi
echo
echo "--- UNINSTALL ---"
rm -vrf ~/.bashfox
Expand Down