Skip to content

Instantly share code, notes, and snippets.

@psturc
Last active July 2, 2016 10:38
Show Gist options
  • Save psturc/8f386fd74d8b34faf113ff14d7638529 to your computer and use it in GitHub Desktop.
Save psturc/8f386fd74d8b34faf113ff14d7638529 to your computer and use it in GitHub Desktop.
fh-npm & s2i building script for Travis CI
#!/bin/bash
# Find out Node version => choose appropriate docker build-image
nodev=`node -v`
if [[ $nodev == "v4"* ]]
then
buildimage="registry.access.redhat.com/rhscl/nodejs-4-rhel7"
else
buildimage="registry.access.redhat.com/openshift3/nodejs-010-rhel7"
fi
# npm installation
npm install -g npm@2.13.5
# grunt installation
npm install -g grunt-cli
# fh-npm dependency installation
npm install -g fh-npm@0.0.9-41
# fh-npm build test
fhnpm="`which node` `which npm`"
fhnpm_install="install --production --strict-ssl=false --cache=$HOME/.fh-npm/fhnpm_install_cache"
fhnpm_cache="$HOME/.fh-npm/fhnpm_cache"
dynodir=`pwd`
fh-npm --npm="$fhnpm" --install="$fhnpm_install" --dir="$dynodir" --cache="$fhnpm_cache"
# s2i dependencies installation
sudo apt-get install golang -y
curl -L https://github.com/openshift/source-to-image/releases/download/v1.0.9/source-to-image-v1.0.9-f9ff77d-linux-amd64.tar.gz | tar -xz
# s2i build test
./s2i build . $buildimage build_test
@matzew
Copy link

matzew commented Jul 2, 2016

👍 cool script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment