Skip to content

Commit

Permalink
Adding tools
Browse files Browse the repository at this point in the history
  • Loading branch information
javuto committed Oct 17, 2019
1 parent 0bad1ed commit 6f8ffb2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tools/git-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
#
# Helper to release osctrl versions

if [ $# -ne 1 ] ; then
echo "Usage: $0 <version_to_add>"
exit 1
fi

TAG=$1
if [[ ${TAG:0:1} != 'v' ]]; then
TAG="v$1"
fi

BODY="Release $TAG"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REPO=$(git config --get remote.origin.url | sed 's/.*:\/\/github.com\///;s/.git$//')

generate_post_data()
{
cat <<EOF
{
"tag_name": "$TAG",
"target_commitish": "$BRANCH",
"name": "$TAG",
"body": "$BODY",
"draft": false,
"prerelease": false
}
EOF
}

echo "[+] Create release $TAG for repo: $REPO branch: $BRANCH"
echo

read -p " -> Github token? " TOKEN

echo "[+] Sending POST request to https://api.github.com/repos/$REPO/releases?access_token=$TOKEN"
echo

echo "curl --data \"$(generate_post_data)\" \"https://api.github.com/repos/$REPO/releases?access_token=$TOKEN\""
2 changes: 2 additions & 0 deletions tools/vagrant_tmux.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
#
# Helper for tmux and osctrl

vagrant ssh -- -t 'tmux new-session -s osctrl -c /opt/osctrl \; split-window -p 70 "sudo journalctl -f -t osctrl-tls; read" \; select-pane -t 0 \; split-window -h -c /vagrant \; attach'

0 comments on commit 6f8ffb2

Please sign in to comment.