Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.6 KiB
Newer Older
################################################################################
## Copyright © 2018 Privategrity Corporation                                   #
##                                                                             #
## All rights reserved.                                                        #
################################################################################

# This drives all the integration tests. When you create a new test, add it as a
# new stage to this file. The stage should have a very clear report and may need
# to run a couple commands to publish.

cache:
  untracked: true
  key: "$CI_BUILD_REF_NAME"
#  paths:
#    - vendor/

variables:
Spencer Brown's avatar
Spencer Brown committed
  REPO_DIR: gitlab.com/elixxir
  DOCKER_IMAGE: bmastc/golang-glide:latest
  # See https://docs.gitlab.com/ee/api/jobs.html#download-a-single-artifact-file-from-specific-tag-or-branch
  REPOS_API: https://gitlab.com/api/v4/projects/elixxir%2F
Richard Carback's avatar
Richard Carback committed
  DL_URL_FRAG: jobs/artifacts/dispatch/raw/release
  SERVER_URL: ${REPOS_API}server/$DL_URL_FRAG/server.linux64?job=build
  CLIENT_URL: ${REPOS_API}client/$DL_URL_FRAG/client.linux64?job=build
  UDB_URL: ${REPOS_API}user-discovery-bot/$DL_URL_FRAG/udb.linux64?job=build
  GATEWAY_URL: ${REPOS_API}gateway/$DL_URL_FRAG/gateway.linux64?job=build
  ##  - go version || echo "Go executable not found."
  ##  - mkdir -p $GOPATH/src/$REPO_DIR
  ##  - ln -s $CI_PROJECT_DIR $GOPATH/src/$REPO_DIR/$REPO_NAME
  ##  - cd $GOPATH/src/$REPO_DIR/$REPO_NAME
  - echo $CI_BUILD_REF
  - echo $CI_PROJECT_DIR

stages:
  - tests
Richard Carback's avatar
Richard Carback committed
  - benchmark
installbinaries:
  stage: installbinaries
  image: $DOCKER_IMAGE
  script:
    - mkdir -p bin
    - "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/server $SERVER_URL"
    - chmod +x bin/server
    - "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/client $CLIENT_URL"
    - chmod +x bin/client
Rick Carback's avatar
Rick Carback committed
    - "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/udb $UDB_URL"
    - chmod +x bin/udb
    - "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/gateway $GATEWAY_URL"
    - chmod +x bin/gateway
    - bin/server --version
    - bin/client --version
    - bin/udb --version
    - bin/gateway --version
  stage: tests
Rick Carback's avatar
Rick Carback committed
    - echo $PWD
Rick Carback's avatar
Rick Carback committed
    - cd basice2e
    - ./run.sh
Rick Carback's avatar
Rick Carback committed
    - cd ..
    when: always
Rick Carback's avatar
Rick Carback committed
     - basice2e/results/
Rick Carback's avatar
Rick Carback committed

smokeinfra:
  stage: tests
  image: $DOCKER_IMAGE
  script:
    - mkdir -p ~/.elixxir
    - echo $PWD
    - cd smokeinfra
    - ./run.sh
    - cd ..
  artifacts:
    when: always
    paths:
     - smokeinfra/results/
     - bin/


smokeinfraBatch4:
  stage: tests
  image: $DOCKER_IMAGE
  script:
    - mkdir -p ~/.elixxir
    - echo $PWD
    - cd smokeinfra
    - git checkout -- .
Richard Carback's avatar
Richard Carback committed
    - sed -i 's/\ 42/\ 4/g' *.yaml
    - ./run.sh
    - cd ..
  artifacts:
    when: always
    paths:
     - smokeinfra/results/
     - bin/

smokeinfraBatch1:
  stage: tests
  image: $DOCKER_IMAGE
  script:
    - mkdir -p ~/.elixxir
    - echo $PWD
    - cd smokeinfra
    - git checkout -- .
Richard Carback's avatar
Richard Carback committed
    - sed -i 's/\ 42/\ 1/g' *.yaml
    - ./run.sh
    - cd ..
  artifacts:
    when: always
    paths:
     - smokeinfra/results/
     - bin/


Rick Carback's avatar
Rick Carback committed
benchmark:
  stage: benchmark
  image: $DOCKER_IMAGE
  script:
    # These take about 2 minutes each right now, so 16 total
    - ./bin/server benchmark -b 1024 -n 1 -i 4
    - ./bin/server benchmark -b 1024 -n 5 -i 1