Skip to content

Instantly share code, notes, and snippets.

@frknbasaran
Last active July 9, 2019 14:09
Show Gist options
  • Save frknbasaran/5b9bf1941fb508aeda4b8cea332f54e6 to your computer and use it in GitHub Desktop.
Save frknbasaran/5b9bf1941fb508aeda4b8cea332f54e6 to your computer and use it in GitHub Desktop.
./next.sh githubUsername bitbucketUsername bitbucketPassword
#!/bin/bash
# change the value of [enterprise-plugin-addr]
# change the value of [ssl-compatible-nginx-config-file-path]
if [ -z "$1" ]
then
echo "Github username isn't provided. It should provide as first parameter."
exit 1
fi
if [ -z "$2" ]
then
echo "Bitbucket username not provided. It should provide as second parameter."
exit 1
fi
if [ -z "$3" ]
then
echo "Bitbucket password not provided. It should provide as third parameter."
exit 1
fi
echo "
______ _ ______
/ _____) _ | | | ___ \ _
| / ___ _ _ ____ | |_ | |_ _ | | | | ____ _ _| |_
| | / _ \| | | | _ \| _)| | | | | | | | |/ _ | \ / ) _)
| \____| |_| | |_| | | | | |__| | |_| | | | | ( (/ / ) X (| |__
\______)___/ \____|_| |_|\___)_|\__ | |_| |_|\____|_/ \_)\___)
(____/
";
# get next branch for ce
git clone -b next https://github.com/$1/countly-server
# get next branch for ee
mkdir enterprise
cd enterprise
git init
git pull https://$2:$3@[enterprise-plugin-addr] next
# move ee plugins into ce
cd ..
mv -v enterprise/* countly-server/
mv -v enterprise/plugins/* countly-server/plugins/
rm -Rf enterprise
# set config files
cd countly-server
mv api/config.sample.js api/config.js
mv frontend/express/config.sample.js frontend/express/config.js
mv frontend/express/public/javascripts/countly/countly.config.sample.js frontend/express/public/javascripts/countly/countly.config.js
cp plugins/plugins.ee.json plugins/plugins.json
# install grunt & npm modules
(sudo npm install -g grunt-cli --unsafe-perm ; sudo npm install --unsafe-perm)
# set localizations
grunt locales
# install countly command line
bash bin/scripts/detect.init.sh
# set nginx configurations
# config files contain custom locations for ssl certificate files
cp /usr/local/[ssl-compatible-config-file-path] /etc/nginx/sites-enabled/default
cp bin/config/nginx.conf /etc/nginx/nginx.conf
# reload nginx
nginx -s reload
# start countly
countly start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment