Skip to content
Snippets Groups Projects
Select Git revision
  • 0cc7719bc42b8bfbb0d985e369c2fa23fb22d4cb
  • release default
  • master protected
  • feature/xx-4717/logLevel
  • XX-4626/SingleUsePackage
  • josh/DmPackage
  • xx-4437/no-registration
  • feature/project/DM
  • project/channels
  • feature/ctidh
  • Jakub/rootless-CI
  • jono/wasmDemo
  • feature/XX-4108/updateProtoc
  • feature/hotfix/unsafe_send_to_self
  • Anne/OldSessionTesting
  • hotfix/groupChat
  • josh/groupCreationScript
  • feature/XX-3797/restore
  • feature/XX-3789/DeleteIndividualRequests
  • dev
  • feature/debugSendCMIX
21 results

update.sh

Blame
  • user avatar
    Jono authored
    f6522450
    History
    update.sh 1.45 KiB
    #!/bin/bash
    
    # This intended for updating the tested repos and their dependencies to the
    # 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 "$1"
        git pull
        glide cache-clear && glide update
    }
    
    for ((i=0; i<${#project_arr[@]}; ++i)); do
        printf "\n%s\n" "${project_arr[i]}"
        pushd "$GOPATH"/src/gitlab.com/elixxir/client || exit
        update "${branch_arr[i]}"
        go test ./...
        popd || exit
    done