<commit_before>#!/bin/bash

# This build script is for running the Jenkins builds using docker.
#
# It expects a few variables which are part of Jenkins build job matrix:
#   target = barreleye|palmetto|qemu
#   distro = fedora|ubuntu|ubuntu:14.04|ubuntu:16.04
#   obmcdir = <name of openbmc src dir> (default openbmc)
#   WORKSPACE = <location of base openbmc/openbmc repo>
#   BITBAKE_OPTS = <optional, set to "-c populate_sdk" or whatever other
#                   bitbake options you'd like to pass into the build>

# Trace bash processing. Set -e so when a step fails, we fail the build
set -xeo pipefail

# Default variables
target=${target:-qemu}
distro=${distro:-ubuntu}
obmcdir=${obmcdir:-openbmc}
WORKSPACE=${WORKSPACE:-${HOME}/${RANDOM}${RANDOM}}
http_proxy=${http_proxy:-}
PROXY=""

# Determine our architecture, ppc64le or the other one
if [ $(uname -m) == "ppc64le" ]; then
    DOCKER_BASE="ppc64le/"
else
    DOCKER_BASE=""
fi

# Timestamp for job
echo "Build started, $(date)"

# If there's no openbmc dir in WORKSPACE then just clone in master
if [ ! -d ${WORKSPACE}/${obmcdir} ]; then
    echo "Clone in openbmc master to ${WORKSPACE}/${obmcdir}"
    git clone https://github.com/openbmc/openbmc ${WORKSPACE}/${obmcdir}
fi

# if user just passed in ubuntu then use latest
if [[ $distro == "ubuntu" ]]; then
    distro="ubuntu:latest"
fi

# Work out what build target we should be running and set bitbake command
case ${target} in
  barreleye)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf source oe-init-build-env"
    ;;
  palmetto)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf source oe-init-build-env"
    ;;
  witherspoon)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf source oe-init-build-env"
    ;;
  firestone)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf source oe-init-build-env"
    ;;
  garrison)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf source oe-init-build-env"
    ;;
  evb-ast2500)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-evb/meta-evb-aspeed/meta-evb-ast2500/conf source oe-init-build-env"
    ;;
  qemu)
    BITBAKE_CMD="source openbmc-env"
    ;;
  *)
    exit 1
    ;;
esac

# Configure docker build
if [[ "${distro}" == fedora ]];then

  if [[ -n "${http_proxy}" ]]; then
    PROXY="RUN echo \"proxy=${http_proxy}\" >> /etc/dnf/dnf.conf"
  fi

  Dockerfile=$(cat << EOF
FROM ${DOCKER_BASE}fedora:latest

${PROXY}

RUN dnf --refresh install -y \
	bzip2 \
	chrpath \<commit_msg>build-setup: Add openbmc machines Zaius and Romulus<commit_after>#!/bin/bash

# This build script is for running the Jenkins builds using docker.
#
# It expects a few variables which are part of Jenkins build job matrix:
#   target = barreleye|palmetto|qemu
#   distro = fedora|ubuntu|ubuntu:14.04|ubuntu:16.04
#   obmcdir = <name of openbmc src dir> (default openbmc)
#   WORKSPACE = <location of base openbmc/openbmc repo>
#   BITBAKE_OPTS = <optional, set to "-c populate_sdk" or whatever other
#                   bitbake options you'd like to pass into the build>

# Trace bash processing. Set -e so when a step fails, we fail the build
set -xeo pipefail

# Default variables
target=${target:-qemu}
distro=${distro:-ubuntu}
obmcdir=${obmcdir:-openbmc}
WORKSPACE=${WORKSPACE:-${HOME}/${RANDOM}${RANDOM}}
http_proxy=${http_proxy:-}
PROXY=""

# Determine our architecture, ppc64le or the other one
if [ $(uname -m) == "ppc64le" ]; then
    DOCKER_BASE="ppc64le/"
else
    DOCKER_BASE=""
fi

# Timestamp for job
echo "Build started, $(date)"

# If there's no openbmc dir in WORKSPACE then just clone in master
if [ ! -d ${WORKSPACE}/${obmcdir} ]; then
    echo "Clone in openbmc master to ${WORKSPACE}/${obmcdir}"
    git clone https://github.com/openbmc/openbmc ${WORKSPACE}/${obmcdir}
fi

# if user just passed in ubuntu then use latest
if [[ $distro == "ubuntu" ]]; then
    distro="ubuntu:latest"
fi

# Work out what build target we should be running and set bitbake command
case ${target} in
  barreleye)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf source oe-init-build-env"
    ;;
  palmetto)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf source oe-init-build-env"
    ;;
  witherspoon)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf source oe-init-build-env"
    ;;
  firestone)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-firestone/conf source oe-init-build-env"
    ;;
  garrison)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-garrison/conf source oe-init-build-env"
    ;;
  evb-ast2500)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-evb/meta-evb-aspeed/meta-evb-ast2500/conf source oe-init-build-env"
    ;;
  zaius)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/conf source oe-init-build-env"
    ;;
  romulus)
    BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/conf source oe-init-build-env"
    ;;
  qemu)
    BITBAKE_CMD="source openbmc-env"
    ;;
  *)
    exit 1
    ;;
esac

# Configure docker build
if [[ "${distro}" == fedora ]];then

  if [[ -n "${http_proxy}" ]]; then
    PROXY="RUN echo \"proxy=${http_proxy}\" >> /etc/dnf/dnf.conf"
  fi

  Dockerfile=$(cat << EOF
FROM ${DOCKER_BASE}fedora:latest

${PROXY}

RUN dnf --refresh install -y \
	bzip2 \
	chrpath \
{'fraction_non_alphanumeric': 0.13466596528143082, 'fraction_numerical': 0.008416622830089426, 'mean_word_length': 3.96, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '175828', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2162, 'n_words': 468}