Disable dotnet20 build for now (issue #359)

#!/bin/sh

set -e
#set -x

DIR=$(realpath $(dirname $0))/../
BUILDDIR=$(realpath $DIR)/build

# Ensure we're on the master branch
check_branch() {
    curr_branch=$(git rev-parse --abbrev-ref HEAD)
    if [ $curr_branch != "master" ]
    then
	echo "Not on master branch."
	exit 1
    fi
}

# Ensure working dir is clean
check_clean() {
    if ! git diff-index --quiet HEAD --
    then
	echo "Unclean tree"
	exit 1
    fi
}

# Build CLI binaries for mac/linux/windows
build_all_cli() {
    build_cli "linux" "linux"
    build_cli "darwin" "osx"
    build_cli "windows" "windows"
}

# Build cli binary for one OS, and put it in $BUILDDIR/cli/<os>/
build_cli() {
    os=$1
    osName=$2
    arch="amd64" # parameterize if/when we need to

    pushd $DIR/fission
    GOOS=$os GOARCH=$arch go build .

    if [ "$os" == "windows" ]
    then
	binary=fission.exe
    else
	binary=fission
    fi

    outdir=$BUILDDIR/cli/$osName/
    mkdir -p $outdir
    mv $binary $outdir

    popd
}

# Build fission-bundle image
build_fission_bundle_image() {
    version=$1
    tag=fission/fission-bundle:$version

    pushd $DIR/fission-bundle

    ./build.sh
    docker build -t $tag .

    popd
}

# Push fission-bundle image
push_fission_bundle_image() {
    version=$1
    tag=fission/fission-bundle:$version
    docker push $tag
}

build_fetcher_image() {
    version=$1
    tag=fission/fetcher:$version

    pushd $DIR/environments/fetcher/cmd

    ./build.sh
    docker build -t $tag .

    popd
}

push_fetcher_image() {
    version=$1
    tag=fission/fetcher:$version
    docker push $tag
}

build_and_push_env_image() {
    version=$1
    envdir=$2
    imgname=$3

    echo "Building $envdir -> $imgname:$version"

    pushd $DIR/environments/$envdir
    if [ -f build.sh ]
    then
       ./build.sh
    fi
    docker build -t fission/$imgname:$version .
    docker tag  fission/$imgname:$version fission/$imgname:latest
    docker push fission/$imgname:$version
    docker push fission/$imgname:latest
    popd
}

build_and_push_all_envs() {
    version=$1

    build_and_push_env_image $version nodejs node-env
    build_and_push_env_image $version binary binary-env
    build_and_push_env_image $version dotnet dotnet-env
    # (See #359) build_and_push_env_image $version dotnet20 dotnet20-env
    build_and_push_env_image $version go go-env
    build_and_push_env_image $version perl perl-env
    build_and_push_env_image $version php7 php-env
    build_and_push_env_image $version python3 python-env
    build_and_push_env_image $version ruby ruby-env
}

build_charts() {
    version=$1
    mkdir -p $BUILDDIR/charts
    pushd $DIR/charts
    for c in all core
    do
	tgz=fission-$c-$version.tgz
	tar czvf $tgz fission-$c/
	mv $tgz $BUILDDIR/charts/
    done
    popd
}

build_all() {
    version=$1
    if [ -z "$version" ]
    then
	echo "Version unspecified"
	exit 1
    fi

    if [ -e $BUILDDIR ]
    then
	echo "Removing existing build dir ($BUILDDIR)."
	rm -rf $BUILDDIR
    fi

    mkdir -p $BUILDDIR

    build_fission_bundle_image $version
    build_fetcher_image $version
    build_all_cli
    build_charts $version
}

push_all() {
    push_fission_bundle_image $version
    push_fetcher_image $version
}

tag_and_release() {
    version=$1
    gittag=$version

    # tag the release
    git tag $gittag

    # push tag
    git push --tags

    # create gh release
    gothub release \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name "$version" \
	   --description "$version" \
	   --pre-release
}

attach_github_release_cli() {
    version=$1
    gittag=$version
    # cli
    echo "Uploading osx cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-osx \
	   --file $BUILDDIR/cli/osx/fission

    echo "Uploading linux cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-linux \
	   --file $BUILDDIR/cli/linux/fission

    echo "Uploading windows cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-windows.exe \
	   --file $BUILDDIR/cli/windows/fission.exe
}

attach_github_release_charts() {
    version=$1
    gittag=$version

    # helm charts
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-all-$version.tgz \
	   --file $BUILDDIR/charts/fission-all-$version.tgz

    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-core-$version.tgz \
	   --file $BUILDDIR/charts/fission-core-$version.tgz

}

export GITHUB_TOKEN=$(cat ~/.gh-access-token)

check_branch
check_clean
version=$1

build_all $version
push_all $version
build_and_push_all_envs $version
build_charts $version

tag_and_release $version
attach_github_release_cli $version
attach_github_release_charts $version

#!/bin/sh

set -e
#set -x

DIR=$(realpath $(dirname $0))/../
BUILDDIR=$(realpath $DIR)/build

# Ensure we're on the master branch
check_branch() {
    curr_branch=$(git rev-parse --abbrev-ref HEAD)
    if [ $curr_branch != "master" ]
    then
	echo "Not on master branch."
	exit 1
    fi
}

# Ensure working dir is clean
check_clean() {
    if ! git diff-index --quiet HEAD --
    then
	echo "Unclean tree"
	exit 1
    fi
}

# Build CLI binaries for mac/linux/windows
build_all_cli() {
    build_cli "linux" "linux"
    build_cli "darwin" "osx"
    build_cli "windows" "windows"
}

# Build cli binary for one OS, and put it in $BUILDDIR/cli/<os>/
build_cli() {
    os=$1
    osName=$2
    arch="amd64" # parameterize if/when we need to

    pushd $DIR/fission
    GOOS=$os GOARCH=$arch go build .

    if [ "$os" == "windows" ]
    then
	binary=fission.exe
    else
	binary=fission
    fi

    outdir=$BUILDDIR/cli/$osName/
    mkdir -p $outdir
    mv $binary $outdir

    popd
}

# Build fission-bundle image
build_fission_bundle_image() {
    version=$1
    tag=fission/fission-bundle:$version

    pushd $DIR/fission-bundle

    ./build.sh
    docker build -t $tag .

    popd
}

# Push fission-bundle image
push_fission_bundle_image() {
    version=$1
    tag=fission/fission-bundle:$version
    docker push $tag
}

build_fetcher_image() {
    version=$1
    tag=fission/fetcher:$version

    pushd $DIR/environments/fetcher/cmd

    ./build.sh
    docker build -t $tag .

    popd
}

push_fetcher_image() {
    version=$1
    tag=fission/fetcher:$version
    docker push $tag
}

build_and_push_env_image() {
    version=$1
    envdir=$2
    imgname=$3

    echo "Building $envdir -> $imgname:$version"

    pushd $DIR/environments/$envdir
    if [ -f build.sh ]
    then
       ./build.sh
    fi
    docker build -t fission/$imgname:$version .
    docker tag  fission/$imgname:$version fission/$imgname:latest
    docker push fission/$imgname:$version
    docker push fission/$imgname:latest
    popd
}

build_and_push_all_envs() {
    version=$1

    build_and_push_env_image $version nodejs node-env
    build_and_push_env_image $version binary binary-env
    build_and_push_env_image $version dotnet dotnet-env
    build_and_push_env_image $version dotnet20 dotnet20-env
    build_and_push_env_image $version go go-env
    build_and_push_env_image $version perl perl-env
    build_and_push_env_image $version php7 php-env
    build_and_push_env_image $version python3 python-env
    build_and_push_env_image $version ruby ruby-env
}

build_charts() {
    version=$1
    mkdir -p $BUILDDIR/charts
    pushd $DIR/charts
    for c in all core
    do
	tgz=fission-$c-$version.tgz
	tar czvf $tgz fission-$c/
	mv $tgz $BUILDDIR/charts/
    done
    popd
}

build_all() {
    version=$1
    if [ -z "$version" ]
    then
	echo "Version unspecified"
	exit 1
    fi

    if [ -e $BUILDDIR ]
    then
	echo "Removing existing build dir ($BUILDDIR)."
	rm -rf $BUILDDIR
    fi

    mkdir -p $BUILDDIR

    build_fission_bundle_image $version
    build_fetcher_image $version
    build_all_cli
    build_charts $version
}

push_all() {
    push_fission_bundle_image $version
    push_fetcher_image $version
}

tag_and_release() {
    version=$1
    gittag=$version

    # tag the release
    git tag $gittag

    # push tag
    git push --tags

    # create gh release
    gothub release \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name "$version" \
	   --description "$version" \
	   --pre-release
}

attach_github_release_cli() {
    version=$1
    gittag=$version
    # cli
    echo "Uploading osx cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-osx \
	   --file $BUILDDIR/cli/osx/fission

    echo "Uploading linux cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-linux \
	   --file $BUILDDIR/cli/linux/fission

    echo "Uploading windows cli"
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-cli-windows.exe \
	   --file $BUILDDIR/cli/windows/fission.exe
}

attach_github_release_charts() {
    version=$1
    gittag=$version

    # helm charts
    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-all-$version.tgz \
	   --file $BUILDDIR/charts/fission-all-$version.tgz

    gothub upload \
	   --replace \
	   --user fission \
	   --repo fission \
	   --tag $gittag \
	   --name fission-core-$version.tgz \
	   --file $BUILDDIR/charts/fission-core-$version.tgz

}

export GITHUB_TOKEN=$(cat ~/.gh-access-token)

check_branch
check_clean
version=$1

build_all $version
push_all $version
build_and_push_all_envs $version
build_charts $version

tag_and_release $version
attach_github_release_cli $version
attach_github_release_charts $version


Added script to create new files

Added script to create new files

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Peter-Lavigne/Project-Euler.git/'


Create poll-sys-uptime.sh

Create poll-sys-uptime.sh

error: pathspec 'poll-sys-uptime.sh' did not match any file(s) known to git


feature(node): add configuration

feature(node): add configuration

###########
# Node.js #
###########

# Load NVM
source_file "$NVM_DIR/nvm.sh"

error: pathspec 'node.d/init.sh' did not match any file(s) known to git


added w2v logistic regression

added w2v logistic regression

#!/bin/bash

source venv/bin/activate
COMMAND="vw --quiet -b 24 -d train_w2v.vw -c --ftrl -f model --holdout_off --loss_function logistic --link=logistic --passes 10"
echo "$COMMAND"
$COMMAND
vw -i model -t -d test_w2v.vw -p pred.txt --quiet
python accuracy.py pred.txt testdata.manual.2009.06.14.csv

error: pathspec 'logistic_w2v.sh' did not match any file(s) known to git


added for 8D products

added for 8D products

#!/bin/bash
DataRoot=/RSDATA/lst_terra

pre=MOD11A2_

#Define number of (virtual) cores
ncores=`grep -c 'core id' /proc/cpuinfo`
echo "ncores=" $ncores

for (( doy = 2000000 ; doy <= 2020000 ; doy++ ))
do
	#Test presence of tar.gz files at the given date
	test1=$(find $DataRoot -type f | grep A$doy | grep LST_LST | grep tar.gz | wc -l)
	test2=$(find $DataRoot -type f | grep A$doy | grep LST_QC | grep tar.gz |  wc -l)
	test3=$(find $DataRoot -type f | grep $pre$doy\_1Km_1D_LST.tar.gz | wc -l)
	echo "level1 $test1 $test2 $test3"
	if [ $test1 -eq 1 -a $test2 -eq 1 -a $test3 -eq 0 ]
	then
		# untar files and test for presence of tif files
		tar xvf $(find $DataRoot -type f | grep A$doy | grep LST_LST | grep tar.gz)
		tar xvf $(find $DataRoot -type f | grep A$doy | grep LST_QC | grep tar.gz)
		test1=$(find . -type f | grep A$doy | grep LST_LST | grep tif | wc -l)
		test2=$(find . -type f | grep A$doy | grep LST_QC | grep tif |  wc -l)
		echo "level2 $test1 $test2"
		if [ $test1 -eq 1 -a $test2 -eq 1 ]
		then
			# get the tif files input/output names
			inB2=$(find . -type f | grep A$doy | grep LST_LST | grep tif)
			inB3=$(find . -type f | grep A$doy | grep LST_QC | grep tif)
			outLST=$pre$doy\_1Km_8D_LST.tif
			echo $inB1
			echo $inB2
			echo $outLST
			#define number of prog running and add ncores
			# So 2 prog will run simultaneously on each core
			npid=$(echo "$(ps aux | grep lst | wc -l) * 2 - 1" | bc)
			while [ $npid -ge $ncores ]
			do
				sleep 1
				#update number of prog running
				npid=$(echo "$(ps aux | grep lst | wc -l) * 2 - 1" | bc)
				#update number of (virtual) cores (for heterogeneous systems)
				ncores=`grep -c 'core id' /proc/cpuinfo`
			done
			# process the thing, compress output and delete tif output file
			echo "./lst $inB2 $inB3 $outLST"
			./lst $inB2 $inB3 $outLST
			#rm -f $inB2 &
			#rm -f $inB3 &
			#tar czf $(echo $DataRoot$outLST | sed 's/\.tif//g').tar.gz $outLST
			#rm -f $outLST &
		fi
	fi
done

error: pathspec 'prog/prog_LST/run8D.sh' did not match any file(s) known to git


buildsys: add release script to ensure we do things the right way

#!/usr/bin/env bash

die() {
	echo $* > /dev/stderr
	exit 1
}

# find current release according to configure.ac
CURRELEASE=$(sed -n '/^AC_INIT/s/^.*\[\([0-9.]\+\)\].*$/\1/p' configure.ac)
[[ -z ${CURRELEASE} ]] && die "no release found from configure.ac"

# check this is the last release in the ChangeLog
CLRELEASE=$(sed -n 's/^# \([0-9.]\+\) ([0-9-]\{10\})/\1/p' ChangeLog.md \
	| head -n1)
[[ -z ${CLRELEASE} ]] && die "could not get latest release from ChangeLog.md"
[[ ${CURRELEASE} != ${CLRELEASE} ]] && \
	die "configure.ac ($CURRELEASE) and ChangeLog.md (${CLRELEASE}) disagree"

# prepare new version and release date
TODAY=$(date +%F)
EUTODAY=$(date +%d-%m-%Y)
if [[ $1 == "-M" || $1 == "--major" ]] ; then
	# major version bump
	NEXTRELEASE="$(( ${CURRELEASE%%.*} + 1 )).0"
	FUTURERELEASE="${NEXTRELEASE%.0}.1"
else
	# minor version bump
	MINOR=${CURRELEASE#*.}
	NEXTRELEASE="${CURRELEASE%%.*}.$(( ${MINOR%%.*} + 1 ))"
	FUTURERELEASE="${CURRELEASE%%.*}.$(( ${MINOR%%.*} + 2 ))"
fi

echo "Performing version bump from ${CURRELEASE} to ${NEXTRELEASE} (${TODAY})"

# prepare modifications to configure.ac and ChangeLog.md
CHANGES=.make-release-tmp.$$
mkdir "${CHANGES}"
trap "rm -Rf ${CHANGES}" EXIT

sed -e "/^AC_INIT/s:\[${CURRELEASE}\]:[${NEXTRELEASE}]:" \
	-e "/^AC_SUBST(\[RELEASEDATE\]/d" \
	-e "/^AC_INIT/a AC_SUBST([RELEASEDATE], [${TODAY}])" \
	configure.ac \
	| diff -u \
		--label "${CURRELEASE}/configure.ac" \
		--label "${NEXTRELEASE}/configure.ac" \
		configure.ac - \
	>> "${CHANGES}"/srcdiffs

{
	echo "# ${FUTURERELEASE} (unreleased master branch)"
	echo
	echo "### New Features"
	echo
	echo "### Bugfixes"
	echo
	echo
	echo "# ${NEXTRELEASE} (${EUTODAY})"
	sed -e "1d" ChangeLog.md
}	| diff -u \
		--label "${CURRELEASE}/ChangeLog.md" \
		--label "${NEXTRELEASE}/ChangeLog.md" \
		ChangeLog.md - \
	>> "${CHANGES}"/srcdiffs

cat "${CHANGES}"/srcdiffs
read -p "do you want to apply these changes? [yN] " answ
[[ ${answ} == "y" ]] || die "aborting"

patch -p1 < "${CHANGES}"/srcdiffs

echo "regenerating build files"
autoreconf -fiv || die
echo "committing and tagging version bump"
git commit -am "version bump to ${NEXTRELEASE}" || die
git tag "v${NEXTRELEASE}" || die

echo "building release tar"
SRCDIR=${PWD}
mkdir "${CHANGES}"/build || die
pushd "${CHANGES}"/build || die
git clone "${SRCDIR}" carbon-c-relay
pushd carbon-c-relay
./configure
make dist
mv carbon-c-relay-${NEXTRELEASE}.tar.* "${SRCDIR}"/ || die
popd || die
popd || die

RELEASETAR=$(echo carbon-c-relay-${NEXTRELEASE}.tar.*)
echo "please git push && git push --tags if ${RELEASETAR} is ok"

error: pathspec 'make-release.sh' did not match any file(s) known to git


git-Greybird

git-Greybird

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/j8r/confinux.git/'


Create entry.sh

Create entry.sh

#!/bin/bash
exec /usr/sbin/unbound -c /etc/unbound/unbound.conf -d -v

error: pathspec 'mail/unbound/data/entry.sh' did not match any file(s) known to git


we should specify nginx as nginx-light or it will conflict o nginx-full from swift with message like Package nginx is a virtual package provided by:   nginx-full 1.2.7-0ubuntu0ppa1~precise   nginx-light 1.2.7-0ubuntu0ppa1~precise

#!/bin/bash
# Ubuntu specific chef install functionality
DVD_PATH="/tftpboot/ubuntu_dvd"
BASEDIR="/tftpboot/ubuntu_dvd"
[[ -f /etc/lsb-release ]] || {
    echo "No lsb-release file, cannot determine proper OS information!"
    exit 1
}
. /etc/lsb-release
OS_TOKEN="ubuntu-${DISTRIB_RELEASE}"

update_hostname() { update_hostname.sh $FQDN; }

install_base_packages() {
    log_to apt sed -i "s/__HOSTNAME__/$FQDN/g" ./debsel.conf
    log_to apt /usr/bin/debconf-set-selections ./debsel.conf
    log_to apt apt-get -y install rubygems gcc ruby tcpdump \
        libcurl4-gnutls-dev build-essential ruby-dev libxml2-dev zlib1g-dev nginx-light \
        ipmitool efibootmgr

    # stop nginx
    service nginx stop
    rm -f /etc/nginx/sites-enabled/default
}

bring_up_chef() {
    log_to apt apt-get -y install chef kwalify
    service chef-client stop
    killall chef-client
    log_to apt apt-get -y install chef-server chef-server-webui
    (cd "$DVD_PATH/extra/patches"; chmod +x ./patch.sh ; ./patch.sh) || exit 1
    # increase chef-solr index field size
    perl -i -ne 'if ($_ =~ /<maxFieldLength>(.*)<\/maxFieldLength>/){ print "<maxFieldLength>200000</maxFieldLength> \n" } else { print } '  /var/lib/chef/solr/conf/solrconfig.xml
    # Fix ruby-gems and merb-core mismatch
    sed -i -e "s/Gem.activate(dep)/dep.to_spec.activate/g" /usr/lib/ruby/1.8/merb-core/core_ext/kernel.rb

    ## JMALTIN
    ## append to /etc/chef/client.rb to enable report handlers
#    cat >> /etc/chef/client.rb <<EOF
#
### JMALTIN
### append to /etc/chef/client.rb to enable report handlers - also needs an LWRP
#require 'chef/handler/json_file'
#report_handlers << Chef::Handler::JsonFile.new(:path => "/var/chef/reports")
#exception_handlers << Chef::Handler::JsonFile.new(:path => "/var/chef/reports")
#EOF

    log_to svc service chef-server restart
}

pre_crowbar_fixups() { : ; }

post_crowbar_fixups() { : ; }

update_admin_node() {
    log_to apt apt-get -y upgrade
}

restart_ssh() {
    service ssh restart
}

#!/bin/bash
# Ubuntu specific chef install functionality
DVD_PATH="/tftpboot/ubuntu_dvd"
BASEDIR="/tftpboot/ubuntu_dvd"
[[ -f /etc/lsb-release ]] || {
    echo "No lsb-release file, cannot determine proper OS information!"
    exit 1
}
. /etc/lsb-release
OS_TOKEN="ubuntu-${DISTRIB_RELEASE}"

update_hostname() { update_hostname.sh $FQDN; }

install_base_packages() {
    log_to apt sed -i "s/__HOSTNAME__/$FQDN/g" ./debsel.conf
    log_to apt /usr/bin/debconf-set-selections ./debsel.conf
    log_to apt apt-get -y install rubygems gcc ruby tcpdump \
        libcurl4-gnutls-dev build-essential ruby-dev libxml2-dev zlib1g-dev nginx \
        ipmitool efibootmgr

    # stop nginx
    service nginx stop
    rm -f /etc/nginx/sites-enabled/default
}

bring_up_chef() {
    log_to apt apt-get -y install chef kwalify
    service chef-client stop
    killall chef-client
    log_to apt apt-get -y install chef-server chef-server-webui
    (cd "$DVD_PATH/extra/patches"; chmod +x ./patch.sh ; ./patch.sh) || exit 1
    # increase chef-solr index field size
    perl -i -ne 'if ($_ =~ /<maxFieldLength>(.*)<\/maxFieldLength>/){ print "<maxFieldLength>200000</maxFieldLength> \n" } else { print } '  /var/lib/chef/solr/conf/solrconfig.xml
    # Fix ruby-gems and merb-core mismatch
    sed -i -e "s/Gem.activate(dep)/dep.to_spec.activate/g" /usr/lib/ruby/1.8/merb-core/core_ext/kernel.rb

    ## JMALTIN
    ## append to /etc/chef/client.rb to enable report handlers
#    cat >> /etc/chef/client.rb <<EOF
#
### JMALTIN
### append to /etc/chef/client.rb to enable report handlers - also needs an LWRP
#require 'chef/handler/json_file'
#report_handlers << Chef::Handler::JsonFile.new(:path => "/var/chef/reports")
#exception_handlers << Chef::Handler::JsonFile.new(:path => "/var/chef/reports")
#EOF

    log_to svc service chef-server restart
}

pre_crowbar_fixups() { : ; }

post_crowbar_fixups() { : ; }

update_admin_node() {
    log_to apt apt-get -y upgrade
}

restart_ssh() {
    service ssh restart
}


Wrong variable name killed the timer

Wrong variable name killed the timer

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mettatw/probable-octo-guacamole.git/'


Fixed a typo

Fixed a typo

#!/bin/bash
set +x

mkdir -p ${HOME}/.m2
mkdir -p ${HOME}/.gradle

ROOT_IN_M2_RESOURCE="${ROOT_FOLDER}/${M2_REPO}/root"
export M2_HOME="${ROOT_IN_M2_RESOURCE}/.m2"
export NEW_LOCAL_REPO="${M2_HOME}/repository/"

cat > ${HOME}/.m2/settings.xml <<EOF

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
      <servers>
        <server>
          <id>${M2_SETTINGS_REPO_ID}</id>
          <username>${M2_SETTINGS_REPO_USERNAME}</username>
          <password>${M2_SETTINGS_REPO_PASSWORD}</password>
        </server>
      </servers>
</settings>

EOF
set -x

echo "Settings xml written"

export GRADLE_USER_HOME="${ROOT_IN_M2_RESOURCE}/.gradle"

echo "Writing gradle.properties to [${GRADLE_USER_HOME}/gradle.properties]"

set +x
cat > ${GRADLE_USER_HOME}/gradle.properties <<EOF

repoUsername=${M2_SETTINGS_REPO_USERNAME}
repoPassword=${M2_SETTINGS_REPO_PASSWORD}

EOF
set -x

echo "gradle.properties written"

echo "Moving [${NEW_LOCAL_REPO}] [${HOME}] folder"
mv ${NEW_LOCAL_REPO} ${HOME}/.m2/repository

#!/bin/bash
set +x

mkdir -p ${HOME}/.m2
mkdir -p ${HOME}/.gradle

ROOT_IN_M2_RESOURCE="${ROOT_FOLDER}/${M2_REPO}/root"
export M2_HOME="${ROOT_IN_M2_RESOURCE}/.m2"
export NEW_LOCAL_REPO="${M2_HOME}/repository/"

cat > ${HOME}/.m2/settings.xml <<EOF

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
      <servers>
        <server>
          <id>${M2_SETTINGS_REPO_ID}</id>
          <username>${M2_SETTINGS_REPO_USERNAME}</username>
          <password>${M2_SETTINGS_REPO_PASSWORD}</password>
        </server>
      </servers>
</settings>

EOF
set -x

echo "Settings xml written"

export GRADLE_USER_HOME="${ROOT_IN_M2_RESOURCE}/.gradle"

echo "Writing gradle.properties to [${GRADLE_USER_HOME}/gradle.properties]"

set +x
cat > ${GRADLE_USER_HOME}/gradle.properties <<EOF

repoUsername=${M2_SETTINGS_REPO_USERNAME}
repoPassword=${M2_SETTINGS_REPO_PASSWORD}

EOF
set -x

echo "gradle.properties written"

echo "Moving [${${NEW_LOCAL_REPO}] [${HOME}] folder"
mv ${NEW_LOCAL_REPO} ${HOME}/.m2/repository


added print system settings

added print system settings

#!/bin/bash
set -euo pipefail

# Author: Zheng Hao Tan <tanzhao@umich.edu>
# MIT License

echo 'Here are your system settings:'
echo ''

# Print shell name.
echo 'Shell name:'
echo "${BASH:?}"
echo ''

# Print bash version.
echo 'Bash version:'
echo "${BASH_VERSION:?}"
echo ''

# Print home path.
echo ''
echo 'Home path:'
echo "${HOME:?}"
echo ''

# Print OS type.
echo ''
echo 'OS Type:'
echo "${OSTYPE:?}"
echo ''

cleanup() {
  true;
}
trap cleanup EXIT

error: pathspec 'print-system-settings.sh' did not match any file(s) known to git


Fixes #63

Fixes #63

add missing print_result()

#!/usr/bin/env bash

###
# some colorized echo helpers
# @author Adam Eivy
###

# Colors
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"

function ok() {
    echo -e "$COL_GREEN[ok]$COL_RESET "$1
}

function bot() {
    echo -e "\n$COL_GREEN\[._.]/$COL_RESET - "$1
}

function running() {
    echo -en "$COL_YELLOW ⇒ $COL_RESET"$1": "
}

function action() {
    echo -e "\n$COL_YELLOW[action]:$COL_RESET\n ⇒ $1..."
}

function warn() {
    echo -e "$COL_YELLOW[warning]$COL_RESET "$1
}

function error() {
    echo -e "$COL_RED[error]$COL_RESET "$1
}

function print_error() {
    printf " [✖] %s\n" "$1"
}

function print_result() {

    if [ "$1" -eq 0 ]; then
        print_success "$2"
    else
        print_error "$2"
    fi

    return "$1"

}

function print_success() {
    printf " [✔] %s\n" "$1"
}


Improvements to handle timestamps and multiple inputs.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/sw1nn/dotfiles.git/'


Remove mscorlib.ni.dll before running tests

The test layout folder that is created when we run tests includes an
mscorlib native image. This native image is specific to windows (since
we use the windows version of the runtime when building a test layout,
even when building a test layout for Linux or OSX) and the runtime
will not boot if it is present.

When we run tests from CI, we instruct Jenkins to not copy native
images, but if you are running tests by hand you need to either make
sure you don't copy native images over or remove them before running
tests.

With more folks wanting to use run-test.sh by hand, we should just
make run-test.sh responsible for cleaning up these native images.

Fixes #2605

#!/usr/bin/env bash

# Enable globstar for the purposes of directory evaluation
shopt -s globstar

wait_on_pids()
{
  # Wait on the last processes
  for job in $1
  do
    wait $job
    if [ "$?" -ne 0 ]
    then
      TestsFailed=$(($TestsFailed+1))
    fi
  done
}

usage()
{
    echo "Runs tests on linux/mac that don't have native build support"
    echo "usage: run-test [options]"
    echo
    echo "Input sources:"
    echo "    --coreclr-bins <location>         Location of root of the binaries directory"
    echo "                                      containing the linux/mac coreclr build"
    echo "                                      default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
    echo "    --mscorlib-bins <location>        Location of the root binaries directory containing"
    echo "                                      the linux/mac mscorlib.dll"
    echo "                                      default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
    echo "    --corefx-tests <location>         Location of the root binaries location containing"
    echo "                                      the windows tests"
    echo "                                      default: <repo_root>/bin/tests/Windows_NT.AnyCPU.<Configuration>"
    echo "    --corefx-bins <location>          Location of the linux/mac corefx binaries"
    echo "                                      default: <repo_root>/bin/<OS>.AnyCPU.<Configuration>"
    echo "    --corefx-native-bins <location>   Location of the linux/mac native corefx binaries"
    echo "                                      default: <repo_root>/bin/<OS>.x64.<Configuration>"
    echo
    echo "Flavor/OS options:"
    echo "    --configuration <config>          Configuration to run (Debug/Release)"
    echo "                                      default: Debug"
    echo "    --os <os>                         OS to run (OSX/Linux)"
    echo "                                      default: detect current OS"
    echo
    echo "Execution options:"
    echo "    --restrict-proj <regex>       Run test projects that match regex"
    echo "                                  default: .* (all projects)"
    echo
    exit 1
}

ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Location parameters
# OS/Configuration defaults
Configuration="Debug"
OSName=$(uname -s)
case $OSName in
    Linux)
        OS=Linux
        ;;

    Darwin)
        OS=OSX
        ;;

    *)
        echo "Unsupported OS $OSName detected, configuring as if for Linux"
        OS=Linux
        ;;
esac
# Misc defaults
TestHostVersion="0.0.2-prerelease"
TestSelection=".*"
TestsFailed=0
OverlayDir="$ProjectRoot/bin/tests/$OS.AnyCPU.$Configuration/TestOverlay/"

create_test_overlay()
{
  # Creates the test overlay that will be copied on top of
  # Each of the test directories.

  local packageName="Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost.$TestHostVersion.nupkg"
  local packageDir="packages/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost.$TestHostVersion"
  rm -rf $packageDir
  mkdir -p $packageDir
  pushd $packageDir > /dev/null
  # Pull down the testhost package and unzip it.
  echo "Pulling down $packageName"
  wget -q https://www.myget.org/F/dotnet-buildtools/api/v2/package/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost/$TestHostVersion -O $packageName
  echo "Unzipping to $packageDir"
  unzip -q -o $packageName
  popd > /dev/null

  # Make the overlay

  rm -rf $OverlayDir
  mkdir -p $OverlayDir

  local LowerConfiguration="$(echo $Configuration | awk '{print tolower($0)}')"

  # First the temporary test host binaries
  local packageLibDir="$packageDir/lib"
  local mscorlibLocation="$MscorlibBins/mscorlib.dll"

  if [ ! -d $packageLibDir ]
  then
	echo "Package not laid out as expected"
	exit 1
  fi
  cp $packageLibDir/* $OverlayDir

  # Then the CoreCLR native binaries
  if [ ! -d $CoreClrBins ]
  then
	echo "Coreclr $OS binaries not found at $CoreClrBins"
	exit 1
  fi
  cp -r $CoreClrBins/* $OverlayDir

  # Then the mscorlib from the upstream build.
  # TODO When the mscorlib flavors get properly changed then
  if [ ! -f $mscorlibLocation ]
  then
	echo "Mscorlib not found at $mscorlibLocation"
	exit 1
  fi
  cp -r $mscorlibLocation $OverlayDir

  # Then the binaries from the linux build of corefx
  if [ ! -d $CoreFxBins ]
  then
	echo "Corefx binaries not found at $CoreFxBins"
	exit 1
  fi
  find $CoreFxBins -name '*.dll' -and -not -name "*Test*" -exec cp '{}' "$OverlayDir" ";"

  # Then the native CoreFX binaries
  if [ ! -d $CoreFxNativeBins ]
  then
	echo "Corefx native binaries should be built (use build.sh in root)"
	exit 1
  fi
  cp $CoreFxNativeBins/* $OverlayDir
}

copy_test_overlay()
{
  testDir=$1

  cp -r $OverlayDir/* $testDir/
}

# $1 is the name of the test project
runtest()
{
  testProject=$1

  # Check here to see whether we should run this project

  if grep "UnsupportedPlatforms.*$OS.*" $1
  then
    echo "Test project file $1 indicates this test is not supported on $OS, skipping"
    exit 0
  fi

  # Check for project restrictions

  if [[ ! $testProject =~ $TestSelection ]]; then
    echo "Skipping $testProject"
    exit 0
  fi

  # Grab the directory name that would correspond to this test

  lowerOS="$(echo $OS | awk '{print tolower($0)}')"
  fileName="${file##*/}"
  fileNameWithoutExtension="${fileName%.*}"
  testDllName="$fileNameWithoutExtension.dll"
  xunitOSCategory="non$lowerOS"
  xunitOSCategory+="tests"

  dirName="$CoreFxTests/$fileNameWithoutExtension/dnxcore50"

  if [ ! -d "$dirName" ] || [ ! -f "$dirName/$testDllName" ]
  then
    echo "Did not find corresponding test dll for $testProject at $dirName/$testDllName"
    exit 1
  fi

  copy_test_overlay $dirName

  pushd $dirName > /dev/null

  # Remove the mscorlib native image, since our current test layout build process
  # uses a windows runtime and so we include the windows native image for mscorlib
  if [ -e mscorlib.ni.dll ]
  then
    rm mscorlib.ni.dll
  fi

  # Invoke xunit

  echo
  echo "Running tests in $dirName"
  echo "./corerun xunit.console.netcore.exe $testDllName -xml testResults.xml -notrait category=failing -notrait category=OuterLoop -notrait category=$xunitOSCategory"
  echo
  ./corerun xunit.console.netcore.exe $testDllName -xml testResults.xml -notrait category=failing -notrait category=OuterLoop -notrait category=$xunitOSCategory
  exitCode=$?
  popd > /dev/null
  exit $exitCode
}

# Parse arguments

while [[ $# > 0 ]]
do
    opt="$1"
    case $opt in
        -h|--help)
        usage
        ;;
        --coreclr-bins)
        CoreClrBins=$2
        ;;
        --mscorlib-bins)
        MscorlibBins=$2
        ;;
        --corefx-tests)
        CoreFxTests=$2
        ;;
        --corefx-bins)
        CoreFxBins=$2
        ;;
        --corefx-native-bins)
        CoreFxNativeBins=$2
        ;;
        --restrict-proj)
        TestSelection=$2
        ;;
        --configuration)
        Configuration=$2
        ;;
        --os)
        OS=$2
        ;;
        *)
        ;;
    esac
    shift
done

# Compute paths to the binaries if they haven't already been computed

if [ "$CoreClrBins" == "" ]
then
    CoreClrBins="$ProjectRoot/bin/Product/$OS.x64.$Configuration"
fi

if [ "$MscorlibBins" == "" ]
then
    MscorlibBins="$ProjectRoot/bin/Product/$OS.x64.$Configuration"
fi

if [ "$CoreFxTests" == "" ]
then
    CoreFxTests="$ProjectRoot/bin/tests/Windows_NT.AnyCPU.$Configuration"
fi

if [ "$CoreFxBins" == "" ]
then
    CoreFxBins="$ProjectRoot/bin/$OS.AnyCPU.$Configuration"
fi

if [ "$CoreFxNativeBins" == "" ]
then
    CoreFxNativeBins="$ProjectRoot/bin/$OS.x64.$Configuration/Native"
fi

# Check parameters up front for valid values:

if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ]
then
    echo "Configuration should be Debug or Release"
    exit 1
fi

if [ ! "$OS" == "OSX" ] && [ ! "$OS" == "Linux" ]
then
    echo "OS should be Linux or OSX"
    exit 1
fi

create_test_overlay

# Walk the directory tree rooted at src bin/tests/Windows_NT.AnyCPU.$Configuration/

TestsFailed=0
numberOfProcesses=0
maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1))
for file in src/**/tests/**/*.Tests.csproj
do
  runtest $file &
  pids="$pids $!"
  numberOfProcesses=$(($numberOfProcesses+1))
  if [ "$numberOfProcesses" -ge $maxProcesses ]; then
    wait_on_pids "$pids"
    numberOfProcesses=0
    pids=""
  fi
done

# Wait on the last processes
wait_on_pids "$pids"

if [ "$TestsFailed" -gt 0 ]
then
  echo "$TestsFailed test(s) failed"
fi
exit $TestsFailed

#!/usr/bin/env bash

# Enable globstar for the purposes of directory evaluation
shopt -s globstar

wait_on_pids()
{
  # Wait on the last processes
  for job in $1
  do
    wait $job
    if [ "$?" -ne 0 ]
    then
      TestsFailed=$(($TestsFailed+1))
    fi
  done
}

usage()
{
    echo "Runs tests on linux/mac that don't have native build support"
    echo "usage: run-test [options]"
    echo
    echo "Input sources:"
    echo "    --coreclr-bins <location>         Location of root of the binaries directory"
    echo "                                      containing the linux/mac coreclr build"
    echo "                                      default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
    echo "    --mscorlib-bins <location>        Location of the root binaries directory containing"
    echo "                                      the linux/mac mscorlib.dll"
    echo "                                      default: <repo_root>/bin/Product/<OS>.x64.<Configuration>"
    echo "    --corefx-tests <location>         Location of the root binaries location containing"
    echo "                                      the windows tests"
    echo "                                      default: <repo_root>/bin/tests/Windows_NT.AnyCPU.<Configuration>"
    echo "    --corefx-bins <location>          Location of the linux/mac corefx binaries"
    echo "                                      default: <repo_root>/bin/<OS>.AnyCPU.<Configuration>"
    echo "    --corefx-native-bins <location>   Location of the linux/mac native corefx binaries"
    echo "                                      default: <repo_root>/bin/<OS>.x64.<Configuration>"
    echo
    echo "Flavor/OS options:"
    echo "    --configuration <config>          Configuration to run (Debug/Release)"
    echo "                                      default: Debug"
    echo "    --os <os>                         OS to run (OSX/Linux)"
    echo "                                      default: detect current OS"
    echo
    echo "Execution options:"
    echo "    --restrict-proj <regex>       Run test projects that match regex"
    echo "                                  default: .* (all projects)"
    echo
    exit 1
}

ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Location parameters
# OS/Configuration defaults
Configuration="Debug"
OSName=$(uname -s)
case $OSName in
    Linux)
        OS=Linux
        ;;

    Darwin)
        OS=OSX
        ;;

    *)
        echo "Unsupported OS $OSName detected, configuring as if for Linux"
        OS=Linux
        ;;
esac
# Misc defaults
TestHostVersion="0.0.2-prerelease"
TestSelection=".*"
TestsFailed=0
OverlayDir="$ProjectRoot/bin/tests/$OS.AnyCPU.$Configuration/TestOverlay/"

create_test_overlay()
{
  # Creates the test overlay that will be copied on top of
  # Each of the test directories.

  local packageName="Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost.$TestHostVersion.nupkg"
  local packageDir="packages/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost.$TestHostVersion"
  rm -rf $packageDir
  mkdir -p $packageDir
  pushd $packageDir > /dev/null
  # Pull down the testhost package and unzip it.
  echo "Pulling down $packageName"
  wget -q https://www.myget.org/F/dotnet-buildtools/api/v2/package/Microsoft.DotNet.CoreFx.$OS.TemporaryTestHost/$TestHostVersion -O $packageName
  echo "Unzipping to $packageDir"
  unzip -q -o $packageName
  popd > /dev/null

  # Make the overlay

  rm -rf $OverlayDir
  mkdir -p $OverlayDir

  local LowerConfiguration="$(echo $Configuration | awk '{print tolower($0)}')"

  # First the temporary test host binaries
  local packageLibDir="$packageDir/lib"
  local mscorlibLocation="$MscorlibBins/mscorlib.dll"

  if [ ! -d $packageLibDir ]
  then
	echo "Package not laid out as expected"
	exit 1
  fi
  cp $packageLibDir/* $OverlayDir

  # Then the CoreCLR native binaries
  if [ ! -d $CoreClrBins ]
  then
	echo "Coreclr $OS binaries not found at $CoreClrBins"
	exit 1
  fi
  cp -r $CoreClrBins/* $OverlayDir

  # Then the mscorlib from the upstream build.
  # TODO When the mscorlib flavors get properly changed then
  if [ ! -f $mscorlibLocation ]
  then
	echo "Mscorlib not found at $mscorlibLocation"
	exit 1
  fi
  cp -r $mscorlibLocation $OverlayDir

  # Then the binaries from the linux build of corefx
  if [ ! -d $CoreFxBins ]
  then
	echo "Corefx binaries not found at $CoreFxBins"
	exit 1
  fi
  find $CoreFxBins -name '*.dll' -and -not -name "*Test*" -exec cp '{}' "$OverlayDir" ";"

  # Then the native CoreFX binaries
  if [ ! -d $CoreFxNativeBins ]
  then
	echo "Corefx native binaries should be built (use build.sh in root)"
	exit 1
  fi
  cp $CoreFxNativeBins/* $OverlayDir
}

copy_test_overlay()
{
  testDir=$1

  cp -r $OverlayDir/* $testDir/
}

# $1 is the name of the test project
runtest()
{
  testProject=$1

  # Check here to see whether we should run this project

  if grep "UnsupportedPlatforms.*$OS.*" $1
  then
    echo "Test project file $1 indicates this test is not supported on $OS, skipping"
    exit 0
  fi

  # Check for project restrictions

  if [[ ! $testProject =~ $TestSelection ]]; then
    echo "Skipping $testProject"
    exit 0
  fi

  # Grab the directory name that would correspond to this test

  lowerOS="$(echo $OS | awk '{print tolower($0)}')"
  fileName="${file##*/}"
  fileNameWithoutExtension="${fileName%.*}"
  testDllName="$fileNameWithoutExtension.dll"
  xunitOSCategory="non$lowerOS"
  xunitOSCategory+="tests"

  dirName="$CoreFxTests/$fileNameWithoutExtension/dnxcore50"

  if [ ! -d "$dirName" ] || [ ! -f "$dirName/$testDllName" ]
  then
    echo "Did not find corresponding test dll for $testProject at $dirName/$testDllName"
    exit 1
  fi

  copy_test_overlay $dirName

  # Invoke xunit

  pushd $dirName > /dev/null
  echo
  echo "Running tests in $dirName"
  echo "./corerun xunit.console.netcore.exe $testDllName -xml testResults.xml -notrait category=failing -notrait category=OuterLoop -notrait category=$xunitOSCategory"
  echo
  ./corerun xunit.console.netcore.exe $testDllName -xml testResults.xml -notrait category=failing -notrait category=OuterLoop -notrait category=$xunitOSCategory
  exitCode=$?
  popd > /dev/null
  exit $exitCode
}

# Parse arguments

while [[ $# > 0 ]]
do
    opt="$1"
    case $opt in
        -h|--help)
        usage
        ;;
        --coreclr-bins)
        CoreClrBins=$2
        ;;
        --mscorlib-bins)
        MscorlibBins=$2
        ;;
        --corefx-tests)
        CoreFxTests=$2
        ;;
        --corefx-bins)
        CoreFxBins=$2
        ;;
        --corefx-native-bins)
        CoreFxNativeBins=$2
        ;;
        --restrict-proj)
        TestSelection=$2
        ;;
        --configuration)
        Configuration=$2
        ;;
        --os)
        OS=$2
        ;;
        *)
        ;;
    esac
    shift
done

# Compute paths to the binaries if they haven't already been computed

if [ "$CoreClrBins" == "" ]
then
    CoreClrBins="$ProjectRoot/bin/Product/$OS.x64.$Configuration"
fi

if [ "$MscorlibBins" == "" ]
then
    MscorlibBins="$ProjectRoot/bin/Product/$OS.x64.$Configuration"
fi

if [ "$CoreFxTests" == "" ]
then
    CoreFxTests="$ProjectRoot/bin/tests/Windows_NT.AnyCPU.$Configuration"
fi

if [ "$CoreFxBins" == "" ]
then
    CoreFxBins="$ProjectRoot/bin/$OS.AnyCPU.$Configuration"
fi

if [ "$CoreFxNativeBins" == "" ]
then
    CoreFxNativeBins="$ProjectRoot/bin/$OS.x64.$Configuration/Native"
fi

# Check parameters up front for valid values:

if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ]
then
    echo "Configuration should be Debug or Release"
    exit 1
fi

if [ ! "$OS" == "OSX" ] && [ ! "$OS" == "Linux" ]
then
    echo "OS should be Linux or OSX"
    exit 1
fi

create_test_overlay

# Walk the directory tree rooted at src bin/tests/Windows_NT.AnyCPU.$Configuration/

TestsFailed=0
numberOfProcesses=0
maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1))
for file in src/**/tests/**/*.Tests.csproj
do
  runtest $file &
  pids="$pids $!"
  numberOfProcesses=$(($numberOfProcesses+1))
  if [ "$numberOfProcesses" -ge $maxProcesses ]; then
    wait_on_pids "$pids"
    numberOfProcesses=0
    pids=""
  fi
done

# Wait on the last processes
wait_on_pids "$pids"

if [ "$TestsFailed" -gt 0 ]
then
  echo "$TestsFailed test(s) failed"
fi
exit $TestsFailed


initial upload

initial upload

#!/bin/bash
git clone https://bitbucket.org/DataspeedInc/velodyne_simulator.git; cd velodyne_simulator; git checkout  f3d04c84f4ca1a662e8a52feeb8191c855a41535; cd ..
git clone https://github.com/AutonomyLab/ardrone_autonomy.git; cd ardrone_autonomy; git checkout  30dc1b0febc67f5d3559dc661cb9e7535e49691f; cd ..
git clone https://github.com/AutonomyLab/bebop_autonomy.git; cd bebop_autonomy; git checkout  e3209eda2625c3c7682a36656dc2e0552cd87a72; cd ..
git clone https://github.com/CPFL/Autoware.git; cd Autoware; git checkout  73584db7ebe2817351d4d3083c5ac72a91c561cf; cd ..
git clone https://github.com/DLu/navigation_layers.git; cd navigation_layers; git checkout  de3f6706e50c7a37e68b3abfd51a36323c35e726; cd ..
git clone https://github.com/GT-RAIL/carl_bot.git; cd carl_bot; git checkout  5e64991da9b0d30cabf1b7635c346157832377ca; cd ..
git clone https://github.com/GT-RAIL/carl_moveit.git; cd carl_moveit; git checkout  3f5a091943166f19abd35666863e8adc836a1d91; cd ..
git clone https://github.com/GT-RAIL/carl_navigation.git; cd carl_navigation; git checkout  a66497efee442f789a73426b023444d2b8d25cf1; cd ..
git clone https://github.com/GT-RAIL/rail_ceiling.git; cd rail_ceiling; git checkout  5508c477f112e72270d83dfc6bf37011ae7e359c; cd ..
git clone https://github.com/GT-RAIL/rail_pick_and_place.git; cd rail_pick_and_place; git checkout  06a71bff80f468e5dd4049a8f500f793e2be914f; cd ..
git clone https://github.com/GT-RAIL/rail_segmentation.git; cd rail_segmentation; git checkout  294742b031acaf806f98333455b32f972b09495c; cd ..
git clone https://github.com/GT-RAIL/robot_pose_publisher.git; cd robot_pose_publisher; git checkout  b51d2d070bfbd69eafe9011f3533abe91bea20b7; cd ..
git clone https://github.com/OSUrobotics/ros-head-tracking.git; cd ros-head-tracking; git checkout  b252a3d012bbd6afb51a2df29a88ea34897051f2; cd ..
git clone https://github.com/OctoMap/octomap_mapping.git; cd octomap_mapping; git checkout  9266838a01865a5668de955becc5fb2b5dcaf448; cd ..
git clone https://github.com/OctoMap/octomap_ros.git; cd octomap_ros; git checkout  1bd5597531bbfcb8739b818136a7d81f0262d5d8; cd ..
git clone https://github.com/Oriense/orsens_ros.git; cd orsens_ros; git checkout  a9673b62d1271674c7c95df50a92625931b06c1b; cd ..
git clone https://github.com/PR2/pr2_ethercat_drivers.git; cd pr2_ethercat_drivers; git checkout  35e9cebff74c26f6cf32efc7d441d8ac50b624d2; cd ..
git clone https://github.com/RIVeR-Lab/apriltags_ros.git; cd apriltags_ros; git checkout  06d8f00df5f640ae5fc747f9f4bb4cad91b67f87; cd ..
git clone https://github.com/RIVeR-Lab/orientus_driver.git; cd orientus_driver; git checkout  7017ee89b0f5f8bf2f989ce86a06dbfad920359e; cd ..
git clone https://github.com/RIVeR-Lab/wpi_jaco.git; cd wpi_jaco; git checkout  66080b3b7e6daf84790738548878d40b4239b4da; cd ..
git clone https://github.com/RainerKuemmerle/g2o.git; cd g2o; git checkout  da8ff701f7d4137e606afc83833d8280ab1bfcde; cd ..
git clone https://github.com/RainerKuemmerle/g2o.git; cd g2o; git checkout  da8ff701f7d4137e606afc83833d8280ab1bfcde; cd ..
git clone https://github.com/RobotWebTools/tf2_web_republisher.git; cd tf2_web_republisher; git checkout  099959826e9df80a51b9edc402752642c3ac55a5; cd ..
git clone https://github.com/Sahloul/ar_sys.git; cd ar_sys; git checkout  142c965d48f422e86b36aae5e664ef8571e6859e; cd ..
git clone https://github.com/SmartRoboticSystems/aruco_mapping.git; cd aruco_mapping; git checkout  ce63e38046f8304c5b856ddeb5b818b38ca30f88; cd ..
git clone https://github.com/WPI-RAIL/spatial_temporal_learning.git; cd spatial_temporal_learning; git checkout  cc77c887c5f9bb6b7121405559037b9ecd99fcf8; cd ..
git clone https://github.com/aau-ros/aau_multi_robot.git; cd aau_multi_robot; git checkout  af87925be629521462ec22cf638669ffcb9f82b8; cd ..
git clone https://github.com/allenh1/p2os.git; cd p2os; git checkout  0acbe4a2510dd450a44763b1cab1e44d386bfae9; cd ..
git clone https://github.com/at-wat/hokuyo3d.git; cd hokuyo3d; git checkout  139484ca92d84bbe03e5a671507878713647999a; cd ..
git clone https://github.com/atenpas/agile_grasp.git; cd agile_grasp; git checkout  a020f0886510f0c48895eafec94c8a29ea1b0026; cd ..
git clone https://github.com/atenpas/handle_detector.git; cd handle_detector; git checkout  2c8a7cda2a5e6f2e77c7171b2ccb62b6881ccfc5; cd ..
git clone https://github.com/autonohm/ohm_tsd_slam.git; cd ohm_tsd_slam; git checkout  db3b3ae55440741e7a58c9f89ed201bd1bbb6e16; cd ..
git clone https://github.com/babaksit/aras_visual_servo.git; cd aras_visual_servo; git checkout  47823a4ffe62bef5843383e207927dc0685b299a; cd ..
git clone https://github.com/ccny-ros-pkg/imu_tools.git; cd imu_tools; git checkout  6d13b7048fd1e0ee772fc0439305f5429b6ba28c; cd ..
git clone https://github.com/ccny-ros-pkg/phidgets_drivers.git; cd phidgets_drivers; git checkout  bed081632b99672bfaebfb3da4f6ed320d294982; cd ..
git clone https://github.com/ccny-ros-pkg/scan_tools.git; cd scan_tools; git checkout  752a8ea0ce1d55852edf9777e504f826d8d43b91; cd ..
git clone https://github.com/clearpathrobotics/imu_compass.git; cd imu_compass; git checkout  ce9d07dfbf0eaa763e64fa51949d312477e66aed; cd ..
git clone https://github.com/clearpathrobotics/lms1xx.git; cd lms1xx; git checkout  c418dc4937efaa2da8c881ccc0460160524c38e4; cd ..
git clone https://github.com/clearpathrobotics/puma_motor_driver.git; cd puma_motor_driver; git checkout  8c27b76efb12d2b85a4f9698c6e93986db977109; cd ..
git clone https://github.com/clearpathrobotics/viso2.git; cd viso2; git checkout  672c5771f0f42e765fb1b414978053b20779025e; cd ..
git clone https://github.com/code-iai/nav_pcontroller.git; cd nav_pcontroller; git checkout  70b0184ce02965654b6534623fde380c121dd432; cd ..
git clone https://github.com/code-iai/tortugabot.git; cd tortugabot; git checkout  fa339ee7cf72ebcf10a0ea74316e3d640275b05f; cd ..
git clone https://github.com/cra-ros-pkg/robot_localization.git; cd robot_localization; git checkout  bae0d53cd7824be78ea3169d0f500c9f1d53b9ac; cd ..
git clone https://github.com/davetcoleman/moveit_simple_grasps.git; cd moveit_simple_grasps; git checkout  285f1082c6fb03c751f39901e7ccf55a74a17615; cd ..
git clone https://github.com/davetcoleman/moveit_visual_tools.git; cd moveit_visual_tools; git checkout  1f6bb0c762f421246e0168c6966e18c1d72ce981; cd ..
git clone https://github.com/davetcoleman/ompl_visual_tools.git; cd ompl_visual_tools; git checkout  3f79261df1146bcc20c176b59e30591214d61340; cd ..
git clone https://github.com/davetcoleman/rviz_visual_tools.git; cd rviz_visual_tools; git checkout  832c111ad1a44fb2fe42082f3b3bc2d178ea1ed0; cd ..
git clone https://github.com/davidbsp/patrolling_sim.git; cd patrolling_sim; git checkout  ca24e06cbf592b484c99c8d331f26bd96c10919f; cd ..
git clone https://github.com/davidfischinger/haf_grasping.git; cd haf_grasping; git checkout  6115f26781e0fab8fc7ab917b5b11f6306fa09f8; cd ..
git clone https://github.com/ethz-asl/asctec_mav_framework.git; cd asctec_mav_framework; git checkout  e1580f986cb9e1dddc13915e04118d20c58de2c0; cd ..
git clone https://github.com/ethz-asl/grid_map.git; cd grid_map; git checkout  d0e184ca83e8c34d05e299e014a51a30428d15b2; cd ..
git clone https://github.com/ethz-asl/rotors_simulator.git; cd rotors_simulator; git checkout  a55293dd1c877729ec392e61bdfa7d59c3209be6; cd ..
git clone https://github.com/ethz-asl/vicon_bridge.git; cd vicon_bridge; git checkout  613317862ef540c16f84d73bccfa3d9b55e6006d; cd ..
git clone https://github.com/etsardou/crsm-slam-ros-pkg.git; cd crsm-slam-ros-pkg; git checkout  48172a58d54efeea026da224aa6bc4970150801f; cd ..
git clone https://github.com/fetchrobotics/fetch_gazebo.git; cd fetch_gazebo; git checkout  1e3e10258b0fcbf73c090507b9ea4d1346ca3fc9; cd ..
git clone https://github.com/fetchrobotics/fetch_ros.git; cd fetch_ros; git checkout  4dc5c90579eeddace63a724861719ed110152f5e; cd ..
git clone https://github.com/fetchrobotics/robot_controllers.git; cd robot_controllers; git checkout  551199fce4d8d20de679622d3088868f8de5949b; cd ..
git clone https://github.com/frontw/voronoi_planner.git; cd voronoi_planner; git checkout  e8695664554b2743a440e02d622d787b03e9d6e6; cd ..
git clone https://github.com/fzi-forschungszentrum-informatik/schunk_svh_driver.git; cd schunk_svh_driver; git checkout  4524fe77017c311e63aee95868c240569ec114ae; cd ..
git clone https://github.com/g/grizzly.git; cd grizzly; git checkout  6d67684d490d03ad81a9530f0b6a871396efd563; cd ..
git clone https://github.com/g/grizzly_simulator.git; cd grizzly_simulator; git checkout  5fbc6bed70c38c21fd48341803eb1a9d909aac79; cd ..
git clone https://github.com/g/roboteq.git; cd roboteq; git checkout  c8bc77e03924e88999b652487e5ccb78c55a20dc; cd ..
git clone https://github.com/hrnr/robo-rescue.git; cd robo-rescue; git checkout  52e8b2f794ac7be97826dcf030bc3fb94d3d5cc3; cd ..
git clone https://github.com/inomuh/evapc_ros.git; cd evapc_ros; git checkout  5c52f9166239cbc9595268c19cccaeb2009ffeff; cd ..
git clone https://github.com/inomuh/evapi_ros.git; cd evapi_ros; git checkout  83e75dc79d47cd085f04b8f03906d6853e4ca2f6; cd ..
git clone https://github.com/introlab/rtabmap_ros.git; cd rtabmap_ros; git checkout  36f283851257eb3d65dc3b4b918a2a4efdfe26d6; cd ..
git clone https://github.com/ipa-rmb/cob_people_perception.git; cd cob_people_perception; git checkout  52f7cc05b636f56606a393ee718daaa6e1f2f31b; cd ..
git clone https://github.com/ipa320/cob_command_tools.git; cd cob_command_tools; git checkout  49fe6b1f900cf146aa6f246651ef4c870ca22782; cd ..
git clone https://github.com/ipa320/cob_control.git; cd cob_control; git checkout  479f3e6a0b57d6d3c1c883959245ac48149651c9; cd ..
git clone https://github.com/ipa320/cob_driver.git; cd cob_driver; git checkout  d54f858846071f9452df6b8255126143900ab9b4; cd ..
git clone https://github.com/ipa320/cob_gazebo_plugins.git; cd cob_gazebo_plugins; git checkout  234a70b03019b38d1253875e863f9c8ef5a6a529; cd ..
git clone https://github.com/ipa320/cob_manipulation.git; cd cob_manipulation; git checkout  e82a7accce1d40df8c88ddc2206481362ec90a2d; cd ..
git clone https://github.com/ipa320/cob_navigation.git; cd cob_navigation; git checkout  d7e84e3adf16de7272441a76876f1f5b61ceed2a; cd ..
git clone https://github.com/ipa320/cob_perception_common.git; cd cob_perception_common; git checkout  b26e25eb5def2fc57ae6cc3f4db9a1eab2ca8f64; cd ..
git clone https://github.com/ipa320/ipa_canopen.git; cd ipa_canopen; git checkout  cb0f9628015ecba8487fda5de10f74276f37f923; cd ..
git clone https://github.com/ipa320/schunk_modular_robotics.git; cd schunk_modular_robotics; git checkout  30b9e63b3b54b0edbf4c7c8029139d5cf5e8cb4e; cd ..
git clone https://github.com/ipa320/seneka_deployment_strategies.git; cd seneka_deployment_strategies; git checkout  0878c6c790599e914e0e80fa029d6b7917652af9; cd ..
git clone https://github.com/jackal/jackal_robot.git; cd jackal_robot; git checkout  45b1b2b562c1cfc4d44de4bfe59c33c832672239; cd ..
git clone https://github.com/jizhang-cmu/receive_ublox.git; cd receive_ublox; git checkout  6589ec8fa6a06550857d719495ad37afa30194a0; cd ..
git clone https://github.com/jizhang-cmu/receive_xsens.git; cd receive_xsens; git checkout  4c3f957a77029d674f7f03453e71bc242cf5a72b; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_common.git; cd jsk_common; git checkout  df07e75eb0170c139d0d5672cbace92788d1ac99; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_control.git; cd jsk_control; git checkout  f1842fec5809d40d9789a40fc6c0aa6dae2b66f1; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_recognition.git; cd jsk_recognition; git checkout  ca2279dbf0166125cbb770532982a28c0eb36691; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_roseus.git; cd jsk_roseus; git checkout  dc27db97f457f32aab74021cdcdaeb184b222bba; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_smart_apps.git; cd jsk_smart_apps; git checkout  3250218082655574f89a86285a903bc4496143bf; cd ..
git clone https://github.com/jsk-ros-pkg/jsk_visualization.git; cd jsk_visualization; git checkout  f78641462b9b3e67fa2d7afbffecc0a2f2bfda45; cd ..
git clone https://github.com/lagadic/demo_pioneer.git; cd demo_pioneer; git checkout  9bd6d9bdffe32049f98fdf89e9c6bfa6d9edbf37; cd ..
git clone https://github.com/lagadic/vision_visp.git; cd vision_visp; git checkout  b92ce803b6f6d342885e42a7772b868c351addf2; cd ..
git clone https://github.com/lagadic/visp_ros.git; cd visp_ros; git checkout  f7fd96c1605ea52221e1dfd30dbfea4f8b4398ac; cd ..
git clone https://github.com/lagadic/vrep_ros_bridge.git; cd vrep_ros_bridge; git checkout  d567bcfebcb00c1e2eee175114344687417e0d74; cd ..
git clone https://github.com/lama-imr/lama.git; cd lama; git checkout  913e3efc17cd706865ff1915ca152b5a0af9ecc2; cd ..
git clone https://github.com/lama-imr/lama_costmap.git; cd lama_costmap; git checkout  dc8148de3c20029224c399bcca75e53be5e3d4d8; cd ..
git clone https://github.com/lama-imr/lama_featurenav.git; cd lama_featurenav; git checkout  aadc30dc7cf62166b9f28b36739cdb20f8a5b94c; cd ..
git clone https://github.com/lama-imr/lama_laser.git; cd lama_laser; git checkout  b77d3aa5cc3b631502af3a32e7d0eb1687f3b253; cd ..
git clone https://github.com/lama-imr/lama_polygon_matcher.git; cd lama_polygon_matcher; git checkout  c62ec9d637954522f6e68ab7de6d27c1f313be3b; cd ..
git clone https://github.com/lama-imr/lama_utilities.git; cd lama_utilities; git checkout  f0b137c52d6b97c5cf96e28f1c163eeeaebd4589; cd ..
git clone https://github.com/lukscasanova/mtig_driver.git; cd mtig_driver; git checkout  38e5e42bda0ef19d350cfcf9c90a7a19c3281018; cd ..
git clone https://github.com/mavlink/mavros.git; cd mavros; git checkout  c2d4d13b7b6c436fbfdc6a9397817164d463a089; cd ..
git clone https://github.com/mikeferguson/robot_calibration.git; cd robot_calibration; git checkout  9cc4cc77449d2a68ff38b18c1bd0a8b7a917c371; cd ..
git clone https://github.com/mikeferguson/simple_grasping.git; cd simple_grasping; git checkout  cbb92c4f75721cee076dcd986536c58a0291e8b2; cd ..
git clone https://github.com/muhrix/kinect_aux.git; cd kinect_aux; git checkout  4ae1ee4da7bebec7b7032b44b836b9c80370fa44; cd ..
git clone https://github.com/neobotix/neo_driver.git; cd neo_driver; git checkout  0207dbc07c2f00cb1dbd548c0e06dacc4c1773de; cd ..
git clone https://github.com/nerian-vision/nerian_sp1.git; cd nerian_sp1; git checkout  3c160a53b09d8fea24564ad81a312ee2b8e3fc13; cd ..
git clone https://github.com/orocos/rtt_ros_integration.git; cd rtt_ros_integration; git checkout  4708ccb7c1c6c25f30bd91ce697525cc8f70afdb; cd ..
git clone https://github.com/pal-robotics/head_action.git; cd head_action; git checkout  5e938a982b34619cff00fe311379bd0c7c093cce; cd ..
git clone https://github.com/paulbovbel/frontier_exploration.git; cd frontier_exploration; git checkout  fefc005f9d19538a78dafccbb59cb1bd3e4ec9a8; cd ..
git clone https://github.com/paulbovbel/nav2_platform.git; cd nav2_platform; git checkout  a177d45faac9f74f24537c1a9d849674f23b0e13; cd ..
git clone https://github.com/pr2/pr2_apps.git; cd pr2_apps; git checkout  604064cb72ad301503c564366810d0ff66c3d3b7; cd ..
git clone https://github.com/pr2/pr2_common_actions.git; cd pr2_common_actions; git checkout  f7b55c90f7c23ca7831c8219a8ee037e13b231d2; cd ..
git clone https://github.com/pr2/pr2_controllers.git; cd pr2_controllers; git checkout  8ba81be897df1e8d096546ac26547aebc92f1ace; cd ..
git clone https://github.com/pr2/pr2_kinematics.git; cd pr2_kinematics; git checkout  edaa6eb57c729c7979a4ddc6dd0b5f4732e64e69; cd ..
git clone https://github.com/pr2/pr2_mechanism.git; cd pr2_mechanism; git checkout  8a709698d8de928c163e6ca803d7ac008462c657; cd ..
git clone https://github.com/pr2/pr2_navigation.git; cd pr2_navigation; git checkout  04f3af4c3de6fa51e615685642ae18a1035651ea; cd ..
git clone https://github.com/ridgeback/ridgeback.git; cd ridgeback; git checkout  919e9ac45859092eeb05da641584627248e80b02; cd ..
git clone https://github.com/ridgeback/ridgeback_robot.git; cd ridgeback_robot; git checkout  6f0b2b6760bc9cdb84603aabae242f0e82528a71; cd ..
git clone https://github.com/robotican/ric.git; cd ric; git checkout  e6751988ac89f0691095b3226c7afdc99c51e6a4; cd ..
git clone https://github.com/robotics-in-concert/rocon_tutorials.git; cd rocon_tutorials; git checkout  c969cc168daa6135d07b782bfb3ee6ac18b8d433; cd ..
git clone https://github.com/robotpilot/myahrs_driver.git; cd myahrs_driver; git checkout  6cfbb8b8b9b8aa7a798baf94e5379f0121d28430; cd ..
git clone https://github.com/rohbotics/xv_11_laser_driver.git; cd xv_11_laser_driver; git checkout  4685c20b93c77ff408e944d06a170af7c4c7ff8f; cd ..
git clone https://github.com/ros-aldebaran/romeo_moveit_actions.git; cd romeo_moveit_actions; git checkout  1de1b0df326f85e986dc836a914dca16b3819e62; cd ..
git clone https://github.com/ros-controls/control_toolbox.git; cd control_toolbox; git checkout  17e41b50e6cc7c23a4ff4b41d0971d3bde994be6; cd ..
git clone https://github.com/ros-controls/ros_controllers.git; cd ros_controllers; git checkout  2d8dc95be51cca75a0c0b83b9a98c464f49bac7d; cd ..
git clone https://github.com/ros-drivers/flir_ptu.git; cd flir_ptu; git checkout  2a837fcdd70f65245cd07492823e17b0fdaa20d0; cd ..
git clone https://github.com/ros-drivers/hokuyo_node.git; cd hokuyo_node; git checkout  c25283fe48ad8eabf6a1b72241ee40cbe0a2cf72; cd ..
git clone https://github.com/ros-drivers/joystick_drivers.git; cd joystick_drivers; git checkout  9ac74e4520893ef52ab166e214a7dbd68df65599; cd ..
git clone https://github.com/ros-drivers/microstrain_3dmgx2_imu.git; cd microstrain_3dmgx2_imu; git checkout  ae7715d57f354e16cd3ae0098789608df276c14c; cd ..
git clone https://github.com/ros-drivers/omron.git; cd omron; git checkout  de0e2a2a63f660dbd2a40a068bcd1292cff6b7bf; cd ..
git clone https://github.com/ros-drivers/prosilica_driver.git; cd prosilica_driver; git checkout  050ddcb9d25cc30f1fd5c95d344e3cf391088178; cd ..
git clone https://github.com/ros-drivers/rosserial.git; cd rosserial; git checkout  e9714994d85663e6dc654f6083130a7cbb327e2b; cd ..
git clone https://github.com/ros-drivers/sicktoolbox_wrapper.git; cd sicktoolbox_wrapper; git checkout  c9ab879a1955bd8ceadb69b4e6f2998a1cd37b5b; cd ..
git clone https://github.com/ros-drivers/um6.git; cd um6; git checkout  a453de37c1622852906eea8c681cf05e0f837799; cd ..
git clone https://github.com/ros-drivers/urg_node.git; cd urg_node; git checkout  3de1b41a4194e094abc14622281cbb21fa86c874; cd ..
git clone https://github.com/ros-geographic-info/geographic_info.git; cd geographic_info; git checkout  0219220c2d22952cd0a8f7caf8147477e59a4012; cd ..
git clone https://github.com/ros-industrial/industrial_core.git; cd industrial_core; git checkout  52276c02614a78b7427f44d33aaa40d48bda2e78; cd ..
git clone https://github.com/ros-industrial/robotiq.git; cd robotiq; git checkout  0f7eb546497599c5a280848e2e10cf419f4e7601; cd ..
git clone https://github.com/ros-naoqi/nao_extras.git; cd nao_extras; git checkout  de34b7400eba1aa39fbb6d43cd8c7fb93a8c84fd; cd ..
git clone https://github.com/ros-naoqi/nao_robot.git; cd nao_robot; git checkout  1d1e6d4eb63dc1bcd5bfac4afab69fd5cca9ff5f; cd ..
git clone https://github.com/ros-perception/calibration.git; cd calibration; git checkout  56de96c5656488b525daa44ada4c3459344771f4; cd ..
git clone https://github.com/ros-perception/depthimage_to_laserscan.git; cd depthimage_to_laserscan; git checkout  f135fbd5f60dc7b33aa6d01f9d60c0ec9cb9d787; cd ..
git clone https://github.com/ros-perception/graft.git; cd graft; git checkout  0b8071dbc9e0ad12eb49b037e963c5a885d6fff0; cd ..
git clone https://github.com/ros-perception/image_pipeline.git; cd image_pipeline; git checkout  2c14eb46884b80a3e95a810bd10cbbe1a4387c67; cd ..
git clone https://github.com/ros-perception/laser_assembler.git; cd laser_assembler; git checkout  6eda263ba03770df19e8a3133cd575f76b8b119b; cd ..
git clone https://github.com/ros-perception/laser_geometry.git; cd laser_geometry; git checkout  df0be5687241a1e7cd1f757523f5cc80d86da026; cd ..
git clone https://github.com/ros-perception/laser_proc.git; cd laser_proc; git checkout  3785ccbf424298d9fa6f3089e9c68d1ae6a0f6b4; cd ..
git clone https://github.com/ros-perception/pcl_conversions.git; cd pcl_conversions; git checkout  98d99aa91c371d9f09fbe224ee527fc8b6affa63; cd ..
git clone https://github.com/ros-perception/slam_gmapping.git; cd slam_gmapping; git checkout  56b515592b9982d6eed31e059bb89516aad847f9; cd ..
git clone https://github.com/ros-perception/slam_karto.git; cd slam_karto; git checkout  5d31abf6f994b53d86f0568237f373b21e457f83; cd ..
git clone https://github.com/ros-planning/3d_navigation.git; cd 3d_navigation; git checkout  7767052d56c42f28f6a4e8c9155cf947700c829d; cd ..
git clone https://github.com/ros-planning/moveit_core.git; cd moveit_core; git checkout  8357350ab9a8d6cff0eda2fd3d26923c766c77cb; cd ..
git clone https://github.com/ros-planning/moveit_planners.git; cd moveit_planners; git checkout  0fe5bec4c33b573025ebbc0de963af7a39667a8d; cd ..
git clone https://github.com/ros-planning/moveit_plugins.git; cd moveit_plugins; git checkout  9a0831131a44300e662ef0590ef407219ebbd7de; cd ..
git clone https://github.com/ros-planning/moveit_pr2.git; cd moveit_pr2; git checkout  09de6c3628015dd3c9da63d88d01cc9f6cfd4545; cd ..
git clone https://github.com/ros-planning/moveit_ros.git; cd moveit_ros; git checkout  f1609ad04a28e4ee04f09bbad6d5493507d1145c; cd ..
git clone https://github.com/ros-planning/navigation.git; cd navigation; git checkout  b3e8caa4449dc8a6b96305472e17989275612507; cd ..
git clone https://github.com/ros-planning/navigation_tutorials.git; cd navigation_tutorials; git checkout  bc6d09dcf45f38ac106c89a9d758ddc3f7ed49ad; cd ..
git clone https://github.com/ros-planning/navigation_tutorials.git; cd navigation_tutorials; git checkout  bc6d09dcf45f38ac106c89a9d758ddc3f7ed49ad; cd ..
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git; cd gazebo_ros_pkgs; git checkout  46d773d2e6eb894c0b69375643f7cb0268a0460c; cd ..
git clone https://github.com/ros-simulation/stage_ros.git; cd stage_ros; git checkout  ffed6ca3e2508dada1e045435d1b8185ba6a7198; cd ..
git clone https://github.com/ros-teleop/teleop_twist_joy.git; cd teleop_twist_joy; git checkout  234a7a4672e51a55b4d02047e3421bb21fde21a1; cd ..
git clone https://github.com/ros-visualization/interactive_marker_twist_server.git; cd interactive_marker_twist_server; git checkout  085ed3c0d5fbe82649da32fc1f64e2d78ad6b4de; cd ..
git clone https://github.com/ros-visualization/interactive_markers.git; cd interactive_markers; git checkout  b6b27fbe95ffb95a9226645c44ced2e949490ab7; cd ..
git clone https://github.com/ros-visualization/rviz.git; cd rviz; git checkout  24e14c58e53f56b838c4de80cec0f79a98c11f67; cd ..
git clone https://github.com/ros-visualization/rviz_animated_view_controller.git; cd rviz_animated_view_controller; git checkout  87647d345f8d43424e75e2dfddb368b4014ca97e; cd ..
git clone https://github.com/ros-visualization/visualization_tutorials.git; cd visualization_tutorials; git checkout  f34b05a39386f31ab53077d60f2a17cf5e34910a; cd ..
git clone https://github.com/ros/common_tutorials.git; cd common_tutorials; git checkout  3d3940eb9968b2ee98dbf7eb8f75df079fcd485a; cd ..
git clone https://github.com/ros/geometry.git; cd geometry; git checkout  3885c8184d8448a247122c014ff6e4a07de5612a; cd ..
git clone https://github.com/ros/geometry2.git; cd geometry2; git checkout  72fa60575aad885bd1de289240f7b4b20d0a418b; cd ..
git clone https://github.com/ros/geometry_experimental.git; cd geometry_experimental; git checkout  49e0072baba3612855cc228ce786c6d02ed5b4c5; cd ..
git clone https://github.com/ros/geometry_tutorials.git; cd geometry_tutorials; git checkout  46953ef90f38c7f029c0d311381a6849c7a51ea3; cd ..
git clone https://github.com/ros/robot_state_publisher.git; cd robot_state_publisher; git checkout  d2d11bc27e9cf3df11ea83a6f195e666d1d345f0; cd ..
git clone https://github.com/rst-tu-dortmund/costmap_converter.git; cd costmap_converter; git checkout  404198d36bc72c393c75114fee2804263b0d7838; cd ..
git clone https://github.com/rst-tu-dortmund/teb_local_planner.git; cd teb_local_planner; git checkout  3530f4baa71de397116ea8512cbbb7a28069a320; cd ..
git clone https://github.com/segwayrmp/segway-rmp-ros-pkg.git; cd segway-rmp-ros-pkg; git checkout  9ebae97dab57c559c4d1470f11ebe46b3f59a117; cd ..
git clone https://github.com/skasperski/navigation_2d.git; cd navigation_2d; git checkout  b9cd8ed3236726e0bf50c10cb9a7bbbeaec9e671; cd ..
git clone https://github.com/sniekum/ar_track_alvar.git; cd ar_track_alvar; git checkout  f9e9eb89adbd409d9d9a353ff1346e9581dfaedc; cd ..
git clone https://github.com/srv/srv_tools.git; cd srv_tools; git checkout  8d81c288d8b064b8b5a863997d3cc37392f4e34a; cd ..
git clone https://github.com/start-jsk/rtmros_common.git; cd rtmros_common; git checkout  e037f17d1417a9b37582fded0ac9ecf54a5c2403; cd ..
git clone https://github.com/stdr-simulator-ros-pkg/stdr_simulator.git; cd stdr_simulator; git checkout  dc64565706932f108f80e8046cb24288f089e0eb; cd ..
git clone https://github.com/swri-robotics/mapviz.git; cd mapviz; git checkout  916187be2ae45732577d0e8a1aba702451d2963b; cd ..
git clone https://github.com/swri-robotics/marti_common.git; cd marti_common; git checkout  0e50cc34adc63164fbd941f1a596e9dbe634c310; cd ..
git clone https://github.com/thinclab/uga_tum_ardrone.git; cd uga_tum_ardrone; git checkout  732b3a132a0b35e42f350d09d31a26643eea5422; cd ..
git clone https://github.com/tork-a/dynpick_driver.git; cd dynpick_driver; git checkout  0cbb9ee7f1bfc03b088f5c95a201ecf02d8ad28b; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_gazebo.git; cd hector_gazebo; git checkout  ef1238ab33e9c9573a91e9a0a919ee4283a42cb9; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_localization.git; cd hector_localization; git checkout  25b22a4c9dd82f897193fae642e1a9322b20c918; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_navigation.git; cd hector_navigation; git checkout  2f8217435c8bec0a1684f32c1b8875aeb36b6217; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_quadrotor.git; cd hector_quadrotor; git checkout  5e79350897140b22124970c6304ab63f69a13722; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_slam.git; cd hector_slam; git checkout  cfa25bf5f562ce4d4b11d9dacb06d4816355857d; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/hector_worldmodel.git; cd hector_worldmodel; git checkout  d1205912ad9e34563b36f3802cbe52c35475d89b; cd ..
git clone https://github.com/tu-darmstadt-ros-pkg/ublox.git; cd ublox; git checkout  af5d33b8ac00a45817a29fb277cb2e91dfa50f79; cd ..
git clone https://github.com/tum-vision/tum_ardrone.git; cd tum_ardrone; git checkout  6bcfb34512adc12d7b10a1e67e09854f01678ac8; cd ..
git clone https://github.com/turtlebot/turtlebot_arm.git; cd turtlebot_arm; git checkout  9a9f4ff3e0096f437dd2fdf47db8a7c69a770947; cd ..
git clone https://github.com/turtlebot/turtlebot_create_desktop.git; cd turtlebot_create_desktop; git checkout  99f81f10afdeb371460937db3abd5952a3eafcaf; cd ..
git clone https://github.com/turtlebot/turtlebot_interactions.git; cd turtlebot_interactions; git checkout  5e9d19c56e893e88af16690124c262976eec6fcd; cd ..
git clone https://github.com/ual-arm-ros-pkg/mvsim.git; cd mvsim; git checkout  b6a599e8290a8675def1d392fe998250dad8b6ae; cd ..
git clone https://github.com/uos/calvin_robot.git; cd calvin_robot; git checkout  0e1320185ab7a4e9728bb69163db4906452ee163; cd ..
git clone https://github.com/uos/diffdrive_gazebo_plugin.git; cd diffdrive_gazebo_plugin; git checkout  9ad76bfaaf447ed8ad7dac8fab30e7be21146deb; cd ..
git clone https://github.com/uos/katana_driver.git; cd katana_driver; git checkout  dc78871a041b15b2e22c72a391203a432edb27ac; cd ..
git clone https://github.com/uos/kurt_driver.git; cd kurt_driver; git checkout  b94db2ab745e263eb07e469bde6a95704ed06fce; cd ..
git clone https://github.com/uos/sick_tim.git; cd sick_tim; git checkout  fed24e19e09f11f9381b9467c31be5e2d2de6fe7; cd ..
git clone https://github.com/uos/uos_rotunit.git; cd uos_rotunit; git checkout  6d352d018eb1c025588deb55d9e7cb20ee915220; cd ..
git clone https://github.com/uos/uos_tools.git; cd uos_tools; git checkout  eb337ee336774e938b94ff7fcd57f163959fef3b; cd ..
git clone https://github.com/uos/volksbot_driver.git; cd volksbot_driver; git checkout  50bf1a4018fbf937fc3ca8dbd46977967befc257; cd ..
git clone https://github.com/utexas-bwi/bwi_common.git; cd bwi_common; git checkout  b3a6b022a782bec11a45e33bda5751669061a3ed; cd ..
git clone https://github.com/utexas-bwi/eband_local_planner.git; cd eband_local_planner; git checkout  31a123daa3be1cd4582e4f8a6d81b2bb29d1fa91; cd ..
git clone https://github.com/wg-perception/opencv_candidate.git; cd opencv_candidate; git checkout  cb0a758e978c84cfd6b70df2094bd617653ab829; cd ..
git clone https://github.com/wg-perception/people.git; cd people; git checkout  8935ab35a3b9b837d395269d6622cb257144f69c; cd ..
git clone https://github.com/whoenig/crazyflie_ros.git; cd crazyflie_ros; git checkout  60da94b4406de66cb5895cb4320a50e97529ca9f; cd ..
git clone https://github.com/wjwwood/ax2550.git; cd ax2550; git checkout  d65769e108900d0def3beafbbfa85a8cb97b6dba; cd ..
git clone https://github.com/yincanben/micros_dynamic_objects_filter.git; cd micros_dynamic_objects_filter; git checkout  4635fc6afd9087e4b0a49ce32b43a2d72a5d24d4; cd ..
git clone https://github.com/yujinrobot/kobuki.git; cd kobuki; git checkout  93b9f3f8927595c74fda82d418a9f8cd665b75d1; cd ..
git clone https://github.com/yujinrobot/kobuki_desktop.git; cd kobuki_desktop; git checkout  702db9f17a9bdb4692400d9213a72c1feda0074d; cd ..
git clone https://github.com/yujinrobot/yujin_ocs.git; cd yujin_ocs; git checkout  92ef8086e61ff727bdfaaeaf0d8a068377db8272; cd ..

error: pathspec 'ISSTA_2017_GITHUB_SYSTEMS_STUDIED_DOWNLOAD.sh' did not match any file(s) known to git


生成代码的模板

生成代码的模板

#!/usr/bin/env bash

# 这是一个路由函数,根据参数的不同路由到不同的函数
function __gen_comp_grun() {
    #$COMP_CWORD是系统自动变量，表示当前命令单词索引。 0是第一个单词(也就是mgectl)的索引号，。
    case $COMP_CWORD in
        0)#仍在完成根命令，这里不需要处理
        ;;
        1)  #根命令已经完成，这里开始补充一级主命令
            #${COMP_WORDS[0]}是根命令，在这个例子中就是mgectl
            eval __gen_comp_grun_main
        ;;
        *)  #一级主命令已经完成，这里开始补充一级主命令的选项
            #${COMP_WORDS[1]}是一级主命令，在这个例子中就是stop、debug或者manager
            local curarg=${COMP_WORDS[COMP_CWORD]}
            case "${COMP_WORDS[$COMP_CWORD - 1]}" in
                "-ps")
                    local __comp_all=$(ls *.class)
                    COMPREPLY=( $(compgen -W "${__comp_all}" -- "${curarg}") )
                    ;;
                "-encoding")
                    local __comp_all=""gb2312" "gb18030" "utf-8" "shift-jis""
                    COMPREPLY=( $(compgen -W "${__comp_all}" -- "${curarg}") )
                    ;;
                "some")
                    local __comp_all=$(ls -d */)
                    COMPREPLY=( $(compgen -W "${__comp_all}" -- "${curarg}") )
                    ;;
                *)
                    eval __gen_comp_grun_main
                    ;;
            esac
    esac
}

function __gen_comp_grun_main() {
    local curarg=${COMP_WORDS[COMP_CWORD]}
    local __comp_grun_file=$(ls)
    local __comp_grun_file_only=$(ls -la | awk '/^-/{print $NF}')
    local __comp_all=""${__comp_grun_file}" "${__comp_grun_file_only}" "-tokens" "-tree" "-gui" "-ps" "-trace" "-encoding" "some""
    COMPREPLY=( $(compgen -W "${__comp_all}" -- "${curarg}") )
}
complete -F __gen_comp_grun grun

error: pathspec 'output_scripts/completion_grun.sh' did not match any file(s) known to git