<commit_before>#!/bin/bash

set -ex
. /dgr/bin/functions.sh
isLevelEnabled "debug" && set -x

export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive

ENJOLIVER=${ROOTFS}/opt/enjoliver
SOURCE_PROJECT=/opt/source-project


apt-get update -q
apt-get install -y -q curl python build-essential python-virtualenv python-dev git file openssh-client tar rsync
ln -vs /usr/lib/python2.7/dist-packages/virtualenv.py /usr/local/bin/virtualenv
chmod +x /usr/local/bin/virtualenv


### CoreOS Baremetal ###
BOOTCFG_VERSION=v0.4.0
BOOTCFG_DIR=${ROOTFS}/usr/bin
BOOTCFG_INSTALL=/opt/bootcfg_install

BOOTCFG=${BOOTCFG_DIR}/bootcfg
BOOTCFG_RELEASE=https://github.com/coreos/coreos-baremetal/releases/download/${BOOTCFG_VERSION}/coreos-baremetal-${BOOTCFG_VERSION}-linux-amd64.tar.gz

mkdir -pv ${BOOTCFG_DIR} ${BOOTCFG_INSTALL}

curl -Lf ${BOOTCFG_RELEASE} -o ${BOOTCFG_INSTALL}/bootcfg.tar.gz
tar -C ${BOOTCFG_INSTALL} -xzf ${BOOTCFG_INSTALL}/bootcfg.tar.gz --strip-components=1
cp -v ${BOOTCFG_INSTALL}/bootcfg ${BOOTCFG}
chmod +x ${BOOTCFG}
${BOOTCFG} --version


### Git Bundle ###
cd -P ${SOURCE_PROJECT}/bundles

HEAD=$(git rev-parse HEAD)
BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
git bundle create ${HEAD}.bundle ${BRANCH} --
git bundle verify ${HEAD}.bundle

git clone ${HEAD}.bundle ${ENJOLIVER}<commit_msg>Fix the detached HEAD<commit_after>#!/bin/bash

set -ex
. /dgr/bin/functions.sh
isLevelEnabled "debug" && set -x

export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive

ENJOLIVER=${ROOTFS}/opt/enjoliver
SOURCE_PROJECT=/opt/source-project


apt-get update -q
apt-get install -y -q curl python build-essential python-virtualenv python-dev git file openssh-client tar rsync
ln -vs /usr/lib/python2.7/dist-packages/virtualenv.py /usr/local/bin/virtualenv
chmod +x /usr/local/bin/virtualenv


### CoreOS Baremetal ###
BOOTCFG_VERSION=v0.4.0
BOOTCFG_DIR=${ROOTFS}/usr/bin
BOOTCFG_INSTALL=/opt/bootcfg_install

BOOTCFG=${BOOTCFG_DIR}/bootcfg
BOOTCFG_RELEASE=https://github.com/coreos/coreos-baremetal/releases/download/${BOOTCFG_VERSION}/coreos-baremetal-${BOOTCFG_VERSION}-linux-amd64.tar.gz

mkdir -pv ${BOOTCFG_DIR} ${BOOTCFG_INSTALL}

curl -Lf ${BOOTCFG_RELEASE} -o ${BOOTCFG_INSTALL}/bootcfg.tar.gz
tar -C ${BOOTCFG_INSTALL} -xzf ${BOOTCFG_INSTALL}/bootcfg.tar.gz --strip-components=1
cp -v ${BOOTCFG_INSTALL}/bootcfg ${BOOTCFG}
chmod +x ${BOOTCFG}
${BOOTCFG} --version


### Git Bundle ###
cd -P ${SOURCE_PROJECT}/bundles

HEAD=$(git rev-parse HEAD)

# If in a detached HEAD symbolic-ref fail
BRANCH=$(git symbolic-ref -q HEAD --short) || BRANCH=$(git branch --contains ${HEAD} | tr -d '* ')

git bundle create ${HEAD}.bundle ${BRANCH} --
git bundle verify ${HEAD}.bundle

git clone ${HEAD}.bundle ${ENJOLIVER}
{'fraction_non_alphanumeric': 0.15373352855051245, 'fraction_numerical': 0.005856515373352855, 'mean_word_length': 5.155405405405405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2137302', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1013, 'n_words': 205}