<commit_before>#!/bin/sh

set -e

CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BASE_IMAGE_FILE="$CURRENT_DIR/centos73-oneops-base-virtualbox-ovf/centos73-oneops-base.ovf"

export ONEOPS_ARCHIVE=$1
export PACKER_CACHE_DIR=$HOME/.packer/cache
export ONEOPS_VERSION=$(mvn -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' exec:exec)

if [ -z $ONEOPS_ARCHIVE ]
then
  ONEOPS_ARCHIVE=target/distribution-${ONEOPS_VERSION}-oneops.tar.gz
fi

if [ ! -f $BASE_IMAGE_FILE ]
then
  packer build centos-oneops-base.json
fi

if [ ! -z $ONEOPS_ARCHIVE ]
then
  if [ -f $BASE_IMAGE_FILE ]
  then
    # Using a -var oneops_version=${ONEOPS_VERSION} doesn't seem to work in the json
	# template so using an envar in the json template instead. JvZ<commit_msg>install initial vagrant base image is not install<commit_after>#!/bin/sh

set -e

CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BASE_IMAGE_FILE="$CURRENT_DIR/centos73-oneops-base-virtualbox-ovf/centos73-oneops-base.ovf"

export ONEOPS_ARCHIVE=$1
export PACKER_CACHE_DIR=$HOME/.packer/cache
export ONEOPS_VERSION=$(mvn -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' exec:exec)

if [ -z $ONEOPS_ARCHIVE ]
then
  ONEOPS_ARCHIVE=target/distribution-${ONEOPS_VERSION}-oneops.tar.gz
fi

if [ ! -f $BASE_IMAGE_FILE ]
then
  if [ ! -f "${HOME}/.vagrant.d/boxes/box-cutter-VAGRANTSLASH-centos73/2.0.21/virtualbox/box.ovf" ]
  then
    vagrant box add box-cutter/centos73 --box-version 2.0.21 --provider virtualbox
  fi
  packer build centos-oneops-base.json
fi

if [ ! -z $ONEOPS_ARCHIVE ]
then
  if [ -f $BASE_IMAGE_FILE ]
  then
    # Using a -var oneops_version=${ONEOPS_VERSION} doesn't seem to work in the json
	# template so using an envar in the json template instead. JvZ
{'fraction_non_alphanumeric': 0.13746478873239437, 'fraction_numerical': 0.013521126760563381, 'mean_word_length': 4.447852760736196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5275814', 'n_tokens_mistral': 707, 'n_tokens_neox': 674, 'n_words': 147}