Jenkins shell script for anyone interested

This is the shell script Jenkins executes for a project I’m working on. It first pulls an update from our internal meteor packages repository, then securely copies settings.json (as it may contain keys, so we don’t store these on GitHub) from a remote server, then builds/deploys using mup. I’ve xxx’d out private stuff.

Of course if anyone has any ideas to improve, I’m all ears. Otherwise, just sharing in case it helps anyone!


set -ex

if [ ! -d $JENKINS_HOME/meteor-packages ]; then
  git clone<xxx>/meteor-packages.git $JENKINS_HOME/meteor-packages
  cd $JENKINS_HOME/meteor-packages
  git pull

export PACKAGE_DIRS=$JENKINS_HOME/meteor-packages

cd $WORKSPACE/deploy-prod
scp deploy@meteor-prod.<xxx>.com:mup-settings/<xxx>/settings.json .
mup setup
mup deploy

Thanks for sharing! We are working on this task in a project currently :smile:

No problem, glad it helped!