Skip to content
Snippets Groups Projects
Verified Commit 87122b21 authored by Nico's avatar Nico
Browse files

add script to update gluon

parent 7b8d2592
No related branches found
No related tags found
No related merge requests found
Pipeline #1599 passed
#!/bin/bash
set -eu
readonly gluon_remote_upstream=https://github.com/freifunk-gluon/gluon.git
script_path=$(dirname $(readlink -f "$0"))
gluon_path=$(readlink -f "$script_path/../gluon")
tag_to_update_to="${1:-}"
if [ -z "$tag_to_update_to" ]; then
echo "Usage: $0 [tag to update to]"
exit 1
fi
verify_remotes() {
remote_upstream=$(git -C "$gluon_path" remote get-url upstream)
if [ "$remote_upstream" != "$gluon_remote_upstream" ]; then
echo "Upstream remote is not set up correctly. Please run:"
echo " git -C \"$gluon_path\" remote set-url upstream \"$gluon_remote_upstream\""
exit 1
fi
}
verify_remotes
git -C "$gluon_path" fetch origin --tags
git -C "$gluon_path" fetch upstream "$tag_to_update_to"
current_branch_name=$(git -C "$gluon_path" rev-parse --abbrev-ref HEAD)
current_upstream_tag_name=${current_branch_name/-ffs/}
git -C "$gluon_path" checkout -b "$tag_to_update_to-ffs"
git -C "$gluon_path" rebase -i "$current_upstream_tag_name" --onto FETCH_HEAD
fork_tagname="$tag_to_update_to-ffs0.1"
git -C "$gluon_path" tag "$fork_tagname"
git -C "$gluon_path" push origin "$tag_to_update_to"
git -C "$gluon_path" push origin "$fork_tagname"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment