<commit_before>#!/bin/bash -xe
# Copyright 2015 Akanda, Inc.
#
# Author: Akanda, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# This builds an astara appliance VM image at
# $SRC_ROOT/build/astara_appliance.qcow2, containing the astara-appliance code
# as it is currently checked out in this local repository.

SRC_ROOT="$(dirname $0)/.."
IMG_OUT=$SRC_ROOT/build/astara_appliance

AKANDA_DEBIAN_RELEASE=${AKANDA_DEBIAN_RELEASE:-"jessie"}
BASE_ELEMENTS="vm debian astara nginx"
EXTRA_ELEMENTS="$@"

GIT_HEAD="$(cd $SRC_ROOT && git rev-parse HEAD^)"

DIB_REPOLOCATION_astara=$SRC_ROOT \
DIB_REPOREF_astara=$GIT_HEAD \
ELEMENTS_PATH=$SRC_ROOT/diskimage-builder/elements \
DIB_RELEASE=$AKANDA_DEBIAN_RELEASE DIB_EXTLINUX=1 \
DIB_ASTARA_ADVANCED_SERVICES="router,loadbalancer" \
disk-image-create $BASE_ELEMENTS $EXTRA_ELEMENTS -o $IMG_OUT
<commit_msg>Adjust build script to not use rev-parse<commit_after>#!/bin/bash -xe
# Copyright 2015 Akanda, Inc.
#
# Author: Akanda, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# This builds an astara appliance VM image at
# $SRC_ROOT/build/astara_appliance.qcow2, containing the astara-appliance code
# as it is currently checked out in this local repository.

SRC_ROOT="$(dirname $0)/.."
IMG_OUT=$SRC_ROOT/build/astara_appliance

AKANDA_DEBIAN_RELEASE=${AKANDA_DEBIAN_RELEASE:-"jessie"}
BASE_ELEMENTS="vm debian astara nginx"
EXTRA_ELEMENTS="$@"

GIT_HEAD="$(cd $SRC_ROOT && git log | head -n1 | awk '{ print $2 }')"

echo "Building astara-appliance from $GIT_HEAD"

DIB_REPOLOCATION_astara=$SRC_ROOT \
DIB_REPOREF_astara=$GIT_HEAD \
ELEMENTS_PATH=$SRC_ROOT/diskimage-builder/elements \
DIB_RELEASE=$AKANDA_DEBIAN_RELEASE DIB_EXTLINUX=1 \
DIB_ASTARA_ADVANCED_SERVICES="router,loadbalancer" \
disk-image-create $BASE_ELEMENTS $EXTRA_ELEMENTS -o $IMG_OUT

{'fraction_non_alphanumeric': 0.09657875980042765, 'fraction_numerical': 0.008553100498930863, 'mean_word_length': 5.365079365079365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2989242', 'n_tokens_mistral': 966, 'n_tokens_neox': 906, 'n_words': 285}