forked from Beer-Ops/Beer-Ops.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-demo.sh
executable file
·30 lines (23 loc) · 894 Bytes
/
update-demo.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
#!/usr/bin/env bash
# This script
# - updates the demo to the baseline repository again
# - lets you catch up your demo with the latest features from baseline
# - only supports non-issue/action triggered mode
# as GITHUB_TOKEN PATs provided by Actions cannot access other repositories
# - if you are using the actions driven demo mode, recreate your demo repo
# in case you like to benefit from the latest features
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <customer name>" >&2
exit 1
fi
CUSTOMER=$1
# Getting the original content
git remote add baseline [email protected]:octodemo/octodemo.github.io.git
git fetch baseline
# Resting our HEAD to golden repository
git checkout master
git reset --hard baseline/master
# Updating master and our baseline to revert to later on
git push origin master:refs/tags/baseline -f
git push origin master -f
bash ./scripts/reset-demo.sh $CUSTOMER