forked from 42School/norminette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·32 lines (25 loc) · 857 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
29
30
31
32
#!/bin/bash
SUFFIX="V3"
if [ "$#" -gt "0" ]
then
SUFFIX="-dev"
fi
BUILD_DIR="build"
BUNDLE_DIR="bundle"
PKG_ROOT="$BUILD_DIR/pkgroot"
PACKAGE_NAME="norminette$SUFFIX"
DESCRIPTION="Norminette"
VERSION=`cat norminette/__init__.py | grep version | cut -d'"' -f2`
OUTFILE="norminette_$SUFFIX_$VERSION.pkg"
SUBDIRECTORY="apps/norminette"
rm -rf $BUILD_DIR $BUNDLE_DIR
mkdir $BUILD_DIR $BUNDLE_DIR
python3 -m venv $BUILD_DIR/venv
source $BUILD_DIR/venv/bin/activate
python3 setup.py install
sed -i '' 's#\#\!\/.*norminette.*/venv#\#\!/usr/local/share/norminetteV3/venv#' $BUILD_DIR/venv/bin/*
deactivate
mkdir -p $PKG_ROOT/usr/local/share/$PACKAGE_NAME
mv $BUILD_DIR/venv $PKG_ROOT/usr/local/share/$PACKAGE_NAME/venv
pkgbuild --identifier $PACKAGE_NAME --version $VERSION --root $PKG_ROOT --install-location / $BUNDLE_DIR/$OUTFILE
rm -rf $BUILD_DIR dist/