-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdeploy.sh
executable file
·28 lines (26 loc) · 983 Bytes
/
deploy.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
#!/bin/bash
# Checks if local url matches the original repository
original_repo='scylladb/sphinx-scylladb-theme'
origin_repo=$(git config --get remote.origin.url)
if [[ $origin_repo != *$original_repo* ]]; then
echo "Error: You are tring to publish a new version of the theme"\
"from your personal fork."\
"Clone the repository '${original_repo}' locally,"\
"then run 'deploy.sh' from the original project."
exit 1
fi
# Checks if local contents differ from remote master branch
if git checkout master &&
git fetch origin master &&
[ `git rev-list HEAD...origin/master --count` == 0 ] &&
git merge origin/master
then
poetry version patch
poetry build
poetry publish
else
echo "Error: Your local repository has some changes not pushed or"\
"someone has updated the repository while you where editing code."\
"Upload your latest changes and run 'git pull'."\
"Then, run 'deploy.sh' again."
fi