Sha256: 0b18aefc69c11c4ab786ecc52c07d79ed4469de11e39a8b752e002e863778937

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

#!/bin/bash -ex

# Constants
RUBY_VERSION_DEFAULT="2.1.5"

# Arguments
RUBY_VERSION=${1-${RUBY_VERSION_DEFAULT}}

# Script

# Clones 'Dockerfile' and updates the Ruby version in FROM, returning the cloned file's path
function dockerfile_path {
    echo "Setting Ruby version as ${RUBY_VERSION}" >&2
    cp "Dockerfile" "Dockerfile.${RUBY_VERSION}"
    sed -i -e "s/${RUBY_VERSION_DEFAULT}/${RUBY_VERSION}/g" Dockerfile.${RUBY_VERSION}

    echo "Dockerfile.${RUBY_VERSION}"
}

rm -f Gemfile.lock # Needed for bundle to work right

IMAGE_NAME="cli-ruby:${RUBY_VERSION}" # The tag is the version of Ruby tested against

docker build -t ${IMAGE_NAME} -f $(dockerfile_path) .

docker run --rm \
-v $PWD:/src \
${IMAGE_NAME} \
bash -c '''
bundle update
bundle exec rake jenkins
bundle exec rake build
'''

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
conjur-cli-4.30.1 jenkins.sh
conjur-cli-4.30.0 jenkins.sh
conjur-cli-4.29.0 jenkins.sh