Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandiazwm committed May 11, 2018
1 parent 43ef3e4 commit b3b20c4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,3 +7,4 @@ server/files/
!server/files/.gitkeep
server/.dbdata
server/.fakemail
dist/
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -61,6 +61,9 @@ Server api runs on `http://localhost:8080/`
Also, there's a *phpmyadmin* instance running on `http://localhost:6060/`,
you can access with the username `root` and empty password

##### Building
Once you've installed dependencies for frontend and backend, you can run `./build.sh` and it will generate a zip file inside `dist/` ready for distribution. You can use this file to install OpenSupports on a serving following the [installation instructions](https://github.com/opensupports/opensupports/wiki/Installation)

##### BACKEND API RUBY TESTING

1. Go to tests folder: `cd opensupports/tests`
Expand Down
38 changes: 38 additions & 0 deletions build.sh
@@ -0,0 +1,38 @@
echo "1/3 Building frontend..."
cd client
gulp prod --api
rm build/index.html
echo "2/3 Creating api folder..."
cd ../server
rm -rf files
mkdir files
cd ..
mkdir api
cp server/index.php api
cp server/.htaccess api
cp server/composer.json api
cp server/composer.lock api
cp -R server/controllers api
cp -R server/data api
cp -R server/libs api
cp -R server/models api
cp -R server/vendor api
mkdir api/files
touch api/files/.keep
echo -n > api/config.php
chmod -R 755 .
echo "3/3 Generating zip..."
cd client/build
zip opensupports_dev.zip index.php
zip -u opensupports_dev.zip .htaccess
zip -u opensupports_dev.zip css/main.css
zip -u opensupports_dev.zip js/main.js
zip -ur opensupports_dev.zip fonts
zip -ur opensupports_dev.zip images
mv opensupports_dev.zip ../..
cd ../..
zip -ur opensupports_dev.zip api
rm -rf dist
mkdir dist
mv opensupports_dev.zip dist
rm -rf api

0 comments on commit b3b20c4

Please sign in to comment.