-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·38 lines (29 loc) · 1.18 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
WORKDIR="$(pwd)/workdir"
echo "updating workdir ..."
echo "git -C ${WORKDIR} pull origin openstack"
git -C "${WORKDIR}" pull origin openstack
docker-compose run --rm -e LOCAL_USER_ID="$(id -u $USER)" cloudmanager
# The command list all changed files, the if checks if the string is empty
if [[ -n "$(git -C ${WORKDIR} ls-files -m -o -d)" ]]; then
echo "Changes to the workdir detected!"
echo "git -C ${WORKDIR} status"
git -C "${WORKDIR}" status
echo ""
echo "(^C to abort)"
echo "Please enter a commit message and press enter to add (git add -A), commit (git commit -m \"YOUR MESSAGE\") and push (git push origin openstack) your changes."
echo -n " > "
read msg
while [[ -z "${msg}" ]]; do
echo "(^C to abort)"
echo "Please enter a commit message and press enter to add (git add -A), commit (git commit -m \"YOUR MESSAGE\") and push (git push origin openstack) your changes."
echo -n " > "
read msg
done
echo "git -C ${WORKDIR} add -A"
git -C "${WORKDIR}" add -A
echo "git -C ${WORKDIR} commit -m \"${msg}\""
git -C "${WORKDIR}" commit -m "${msg}"
echo "git -C ${WORKDIR} push origin master"
git -C "${WORKDIR}" push origin openstack
fi