Sha256: e3c8090f2b64c884a8f752c075a6e3e806129cf1e37f3bfeb0e71a32237d5259

Contents?: true

Size: 1.28 KB

Versions: 29

Compression:

Stored size: 1.28 KB

Contents

#!/usr/bin/env bash

DOCKER_IMAGE_NAME="$USER/bootstrap-slider-rails"
LIBRARY_NEW_VERSION=`cat lib/**/*.rb | grep VERSION | awk '{ print $3 }' | tr -d "'"`

LIBRARY_UPDATED=`git status --porcelain | grep -v "lib/bootstrap-slider-rails/version.rb"`
if [[ -n "$LIBRARY_UPDATED" ]]; then
  echo "Your repository is not clean !"
  exit 1
fi

echo "Ensuring Docker image $DOCKER_IMAGE_NAME exists ..."
EXISTING_DOCKER_IMAGE=`docker images | grep "$DOCKER_IMAGE_NAME"`
if [[ -z "$EXISTING_DOCKER_IMAGE" ]]; then
  echo "Building the Docker image ..."
  docker build -t "$DOCKER_IMAGE_NAME" .
fi

echo "Updating library code to version $LIBRARY_NEW_VERSION ..."
docker run --rm -v `pwd`:/gem/ "$DOCKER_IMAGE_NAME" rake update

LIBRARY_UPDATED=`git status --porcelain | grep -v make_new_release.sh`
if [[ -z "$LIBRARY_UPDATED" ]]; then
  echo "No update found, stopping release creation."
  exit 1
elif [[ "$LIBRARY_UPDATED" == " M lib/bootstrap-slider-rails/version.rb" ]]; then
  echo "None of the JS or CSS files have been updated."
  exit 1
fi

echo "Committing new version ..."
git commit -am "Import version $LIBRARY_NEW_VERSION"

echo "Releasing gem ..."
docker run --rm -v ~/.gitconfig:/root/.gitconfig \
  -v ~/.ssh/:/root/.ssh/ \
  -v ~/.gem/:/root/.gem/ \
  -v `pwd`:/gem/ "$DOCKER_IMAGE_NAME" rake release

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
bootstrap-slider-rails-6.1.4 make_new_release.sh
bootstrap-slider-rails-6.1.2 make_new_release.sh
bootstrap-slider-rails-6.0.17 make_new_release.sh
bootstrap-slider-rails-6.0.14 make_new_release.sh
bootstrap-slider-rails-6.0.12 make_new_release.sh
bootstrap-slider-rails-6.0.10 make_new_release.sh
bootstrap-slider-rails-6.0.8 make_new_release.sh
bootstrap-slider-rails-6.0.6 make_new_release.sh
bootstrap-slider-rails-6.0.5 make_new_release.sh