Add code
This commit is contained in:
parent
6a1dd1f0be
commit
62d2788510
32
makerelease.sh
Executable file
32
makerelease.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -r VERSION=${1}
|
||||
declare -r MESSAGE=${2}
|
||||
declare -r TAGBRANCH=main
|
||||
declare CURRENTBRANCH=""
|
||||
|
||||
showHelp() {
|
||||
echo makerelease version
|
||||
}
|
||||
|
||||
if [ "${VERSION}" == "" ]; then
|
||||
showHelp
|
||||
echo ""
|
||||
echo "no version provided!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
if [ ! "${CURRENTBRANCH}" == "dev" ]; then
|
||||
echo "You are not in dev branch!"
|
||||
echo "Use dev branch to make a release!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git checkout "${TAGBRANCH}"
|
||||
git merge "${CURRENTBRANCH}"
|
||||
git push
|
||||
git tag -a "${VERSION}" -m "${MESSAGE}"
|
||||
git push --tags
|
||||
git checkout "${CURRENTBRANCH}"
|
40
sshfs-mount
Executable file
40
sshfs-mount
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare TARGET=""
|
||||
declare MOUNTBASEDIR=""
|
||||
declare MOUNTDIR=""
|
||||
declare BASTION=""
|
||||
|
||||
showHelp() {
|
||||
echo "${0}"
|
||||
echo ""
|
||||
echo "usage :"
|
||||
echo "${0} [options] target dirname"
|
||||
echo "options :"
|
||||
echo " -b|--bastion ip|dnsname"
|
||||
echo " -d|--mountbase ~/Remotes"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ ! -d "${MOUNTDIR}" ]; then
|
||||
mkdir -p "${MOUNTDIR}"
|
||||
fi
|
||||
if [ "${BASTION}" == "" ]; then
|
||||
sshfs -o reconnect "${TARGET}" "${MOUNTDIR}"
|
||||
else
|
||||
sshfs -o reconnect -o ssh_command="ssh -t ${BASTION} ssh" "${TARGET}" "${MOUNTDIR}"
|
||||
fi
|
||||
}
|
||||
|
||||
MOUNTBASEDIR=$(realpath ~/Remotes)
|
||||
TARGET=${1};
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case ${1} in
|
||||
--help) showHelp; exit 0;;
|
||||
-b | --bastion) BASTION="${2}"; shift; shift;;
|
||||
-d | --mountbase) MOUNTBASEDIR=$(realpath "${2}"); shift; shift;;
|
||||
esac
|
||||
done
|
||||
MOUNTDIR="${MOUNTBASEDIR}/${2}";
|
||||
|
||||
main
|
32
sshfs-umount
Executable file
32
sshfs-umount
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare MOUNTBASEDIR=""
|
||||
declare MOUNTDIR=""
|
||||
|
||||
showHelp() {
|
||||
echo "${0}"
|
||||
echo ""
|
||||
echo "usage :"
|
||||
echo "${0} [options] dirname"
|
||||
echo "options :"
|
||||
echo " -d|--mountbase ~/Remotes"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -d "${MOUNTDIR}" ]; then
|
||||
if fusermount -z -u "${MOUNTDIR}"; then
|
||||
rm -r "${MOUNTDIR}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
MOUNTBASEDIR=$(realpath ~/Remotes)
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case ${1} in
|
||||
--help) showHelp; exit 0;;
|
||||
-d | --mountbase) MOUNTBASEDIR=$(realpath "${2}"); shift; shift;;
|
||||
esac
|
||||
done
|
||||
MOUNTDIR="${MOUNTBASEDIR}/${2}";
|
||||
|
||||
main
|
Loading…
Reference in New Issue
Block a user