Skip to content

Commit 44ba09c

Browse files
committed
Add scripts to help create release tars
1 parent 208ab3b commit 44ba09c

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ __pycache__/
1616
# Other
1717
.DS_Store
1818
lcmtypes/*.py
19+
20+
# Release tars.
21+
*.tar.gz

scripts/deploy_readme.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# MBot Web App Release
2+
3+
To install the web app, first unpack this file with:
4+
5+
tar -xvzf mbot_web_app-[VERSION].tar.gz
6+
cd mbot_web_app-[VERSION]
7+
8+
Then install the dependencies and deploy:
9+
10+
./install_nginx.sh
11+
./install_python_deps.sh
12+
./deploy_app.sh --no-rebuild

scripts/generate_release.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
set -e # Quit on error.
3+
4+
VERSION=""
5+
6+
while getopts ":v:" opt; do
7+
case $opt in
8+
v)
9+
VERSION=$OPTARG
10+
;;
11+
\?)
12+
echo "Invalid option: -$OPTARG"
13+
;;
14+
esac
15+
done
16+
17+
if [ -z "$VERSION" ]; then
18+
echo "Error: Version is required. Usage:"
19+
echo
20+
echo " ./generate_release.sh -v vX.X.X"
21+
echo
22+
exit 1
23+
fi
24+
25+
echo "Building for version $VERSION"
26+
27+
# Build the webapp.
28+
echo "#############################"
29+
echo "Building the webapp..."
30+
echo "#############################"
31+
npm install
32+
npm run build
33+
34+
# Make a new top level directory and copy everything into it.
35+
INCLUDES="dist/ app/ config/ \
36+
scripts/install_nginx.sh \
37+
scripts/install_python_deps.sh \
38+
scripts/deploy_app.sh \
39+
mbot_omni_app.py
40+
requirements.txt"
41+
FILE_NAME=mbot_web_app-$VERSION.tar.gz
42+
43+
mkdir mbot_web_app-$VERSION
44+
for file in $INCLUDES; do
45+
cp -r $file mbot_web_app-$VERSION/
46+
done
47+
48+
# Copy the README.
49+
cp scripts/deploy_readme.txt mbot_web_app-$VERSION/README.txt
50+
51+
echo
52+
echo "Creating tar file..."
53+
tar -czf $FILE_NAME mbot_web_app-$VERSION/
54+
55+
rm -rf mkdir mbot_web_app-$VERSION
56+
57+
echo
58+
echo "Created release: $FILE_NAME"

0 commit comments

Comments
 (0)