Skip to content

Instantly share code, notes, and snippets.

@bradymiller
Last active November 15, 2023 18:04
Show Gist options
  • Save bradymiller/94409d7b6eadfd3ee34ff7b4363aac25 to your computer and use it in GitHub Desktop.
Save bradymiller/94409d7b6eadfd3ee34ff7b4363aac25 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Copyright (C) 2019 Brady Miller <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# Script to build releases (tarball,zip,anddeb) for openemr
#
# RELEASE SETTINGS
releaseGIT="rel-702"
#releaseGIT="v7_0_2"
version="7.0.2"
buildTarball=true
buildZip=true
# Download release and build it
git clone https://github.com/openemr/openemr.git
cd openemr
git checkout "$releaseGIT"
rm -fr .git
composer install --no-dev >> ../build_output 2>&1
npm install --unsafe-perm >> ../build_output 2>&1
npm run build >> ../build_output 2>&1
composer global require phing/phing >> ../build_output 2>&1
/root/.config/composer/vendor/bin/phing vendor-clean >> ../build_output 2>&1
/root/.config/composer/vendor/bin/phing assets-clean >> ../build_output 2>&1
composer global remove phing/phing >> ../build_output 2>&1
rm -fr node_modules >> ../build_output 2>&1
composer dump-autoload >> ../build_output 2>&1
cd ../
# Set permissions for tarball and zip
cp -a openemr/ openemr-$version/
chmod -R u+w openemr-$version
chmod -R a+w openemr-$version/sites/default/documents
chmod a+w openemr-$version/sites/default/sqlconf.php
# Build tarball
if $buildTarball ; then
tar zcpf openemr-$version.tar.gz openemr-$version
fi
# Build zip
if $buildZip ; then
zip -r openemr-$version.zip openemr-$version
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment