Skip to content
Snippets Groups Projects
Commit a3fc67b7 authored by Jono's avatar Jono
Browse files

Add ability to set project branches individually or as a group via

environment variables
parent a5740147
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# This intended for updating the tested repos and their dependencies to the
# latest versions before running the integration test.
# latest versions before running the integration test. All runtime options are
# set via environemnt variables:
# defaultBranch sets branch to use for all projects
# clientBranch sets branch to use for the client repository
# serverBranch sets branch to use for the server repository
# gatewayBranch sets branch to use for the gateway repository
# udbBranch sets branch to use for the user-discovery-bot repository
# regBranch sets branch to use for the registration repository
# Default branch to use when no explicit project branch is set. If not set, then
# it defaults to "master".
default="${defaultBranch-"master"}"
# Array of project names.
project_arr=(
client
server
gateway
user-discovery-bot
registration
)
# Array of each project's branch. If a branch is not explicitly set via an
# environemnt variable, then it defaults to defaultBranch.
branch_arr=(
"${clientBranch-$default}"
"${serverBranch-$default}"
"${gatewayBranch-$default}"
"${udbBranch-$default}"
"${regBranch-$default}"
)
update() {
git stash
git clean -ffdx
git checkout master
git checkout "$1"
git pull
glide cc && glide up
glide cache-clear && glide update
}
for DIR in client server gateway user-discovery-bot registration; do
echo $DIR
pushd $GOPATH/src/gitlab.com/elixxir/client
update
for ((i=0; i<${#project_arr[@]}; ++i)); do
printf "\n\033[1m%s\033[0m\n" "${project_arr[i]}"
pushd "$GOPATH"/src/gitlab.com/elixxir/client || exit
update "${branch_arr[i]}"
go test ./...
popd
popd || exit
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment