Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enh: Build refactoring: BUILD_DEPLOY.sh & BUILD_DOCKER.sh
Refactored "/BUILD_DEPLOY.sh" out of ".docker/BUILD_DOCKER.sh" to allow us build-only (without docker). So we can e.g. upload x86_64 ready-to-run ZIP to github. No docker needed in this case. Docker is often not possible in VM environments on shared servers. Instead, MongoDB & Node 4.8.4 are the dependencies now.
- Loading branch information
Showing
9 changed files
with
122 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 4Minitz .deploy directory | ||
|
||
You can build a 4Minitz server here by running from the project root: | ||
|
||
``` | ||
./BUILD_DEPLOY.sh | ||
``` | ||
|
||
Afterwards you may run a 4Minitz server by: | ||
|
||
``` | ||
cd .deploy/4minitz_bin | ||
./run.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "You must adapt the below environment vars in this script to your needs!" | ||
echo "Then remove the following exit command" | ||
echo "Exiting now!" | ||
exit | ||
|
||
############### Environment configuration ###### | ||
# Connection to your mongodb server (please ensure password protection and encrypted communication!) | ||
export MONGO_URL='mongodb://USER:PASSWORD@localhost:27017/' | ||
# Port for your 4Minitz server | ||
export PORT=3100 | ||
# Port to your 4Minitz root URL (to generate correct links in EMails) | ||
# the leading http:// or https:// is IMPORTANT! | ||
export ROOT_URL='http://localhost:3100' | ||
# Read in your settings.json | ||
export METEOR_SETTINGS=$(cat ./settings.json) | ||
################################################# | ||
|
||
#### Check if installed node version matches the node build version | ||
nodeversionbuild=`cat ./bundle/.node_version.txt` | ||
nodeversionnow=`node --version` | ||
if [ ${nodeversionbuild} != ${nodeversionnow} ] | ||
then | ||
echo " " | ||
echo "*** WARNING!" | ||
echo " Node version mismatch:" | ||
echo " Node version on build: ${nodeversionbuild}" | ||
echo " Node version now : ${nodeversionnow}" | ||
echo "If app has launch errors, use node version manager:" | ||
echo " nvm install ${nodeversionbuild} && nvm use ${nodeversionbuild}" | ||
echo " " | ||
sleep 5 | ||
fi | ||
|
||
#### Launch the 4Minitz server | ||
(cd bundle && node main.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
commitshort=$(git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/\1/") | ||
|
||
echo "Usage: ./BUILD_DEPLOY.sh" | ||
|
||
echo "Building for commit ${commitshort} into .deploy/ directory" | ||
#### Clean u | ||
rm -rf .deploy/4minitz_bin/bundle/ | ||
|
||
#### Patch package.json with current git branch & version | ||
(cd ./private && ./releasePrep.sh) | ||
|
||
#### Build 4Minitz with meteor | ||
mkdir .deploy/4minitz_bin | ||
meteor npm install | ||
meteor build .deploy/4minitz_bin --directory | ||
|
||
# Our package.json will not be available - unless we copy it over to the image | ||
# We'll need it for proper version info in the "About" dialog | ||
cp package.json .deploy/4minitz_bin/bundle/programs/server/package4min.json | ||
(cd .deploy/4minitz_bin/bundle/programs/server && meteor npm install --production) | ||
|
||
#### Prepare settings.json | ||
settingsfile=.deploy/4minitz_bin/settings.json | ||
if [ -f "${settingsfile}" ] | ||
then | ||
echo "settings.json found: ${settingsfile}" | ||
echo "We'll keep it!" | ||
else | ||
cp ./settings_sample.json $settingsfile | ||
echo "Patching $settingsfile" | ||
sed -i '' 's/"ROOT_URL": "[^\"]*"/"ROOT_URL": "http:\/\/localhost:3100"/' $settingsfile | ||
sed -i '' 's/"topLeftLogoHTML": "[^\"]*"/"topLeftLogoHTML": "4Minitz"/' $settingsfile | ||
sed -i '' 's/"mongodumpTargetDirectory": "[^\"]*"/"mongodumpTargetDirectory": "\.\.\/\.\.\/\.\.\/4minitz_storage\/mongodump"/' $settingsfile | ||
sed -i '' 's/"storagePath": "[^\"]*"/"storagePath": "\.\.\/\.\.\/\.\.\/4minitz_storage\/attachments"/' $settingsfile | ||
sed -i '' 's/"targetDocPath": "[^\"]*"/"targetDocPath": "\.\.\/\.\.\/\.\.\/4minitz_storage\/protocols"/' $settingsfile | ||
fi | ||
|
||
|
||
#### run.sh & settings.json | ||
runfile=.deploy/4minitz_bin/run.sh | ||
if [ -f "${runfile}" ] | ||
then | ||
echo "run.sh found: ${runfile}" | ||
echo "We'll keep it!" | ||
else | ||
cp ./.deploy/run_sample.sh ${runfile} | ||
fi | ||
|
||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters