Skip to content
Snippets Groups Projects
.gitlab-ci.yml 5.09 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
  SERVER_URL: ${REPOS_API}server/jobs/artifacts/$SERVER_ID/raw/release/server.linux64?job=build
  CLIENT_URL: ${REPOS_API}client/jobs/artifacts/$CLIENT_ID/raw/release/client.linux64?job=build
  REGISTRATION_URL: ${REPOS_API}registration/jobs/artifacts/$REGISTRATION_ID/raw/release/registration.linux64?job=build
  UDB_URL: ${REPOS_API}user-discovery-bot/jobs/artifacts/$UDB_ID/raw/release/udb.linux64?job=build
  GATEWAY_URL: ${REPOS_API}gateway/jobs/artifacts/$GATEWAY_ID/raw/release/gateway.linux64?job=build
  DEFAULTBRANCH: "release"
  ##  - 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
  - tests
Richard Carback's avatar
Richard Carback committed
  - benchmark
installbinaries:
  stage: installbinaries
  image: $DOCKER_IMAGE
  script:
    - git clean -ffdx
    - "DOWNLOADS=\"$SERVER_URL $CLIENT_URL $REGISTRATION_URL $UDB_URL $GATEWAY_URL\""
    - >
      if [ "$CI_BUILD_REF_NAME" == "master" ]; then
        DOWNLOADS=$(echo $DOWNLOADS | sed "s/artifacts\/$DEFAULTBRANCH\/raw/artifacts\/master\/raw/g")
    - >
      for D in $DOWNLOADS; do
        curl -f -O -s -L -H "PRIVATE-TOKEN: $PATKEY" $D
    - mv server.linux64?job=build server
    - mv client.linux64?job=build client
    - mv udb.linux64?job=build udb
    - mv registration.linux64?job=build permissioning
    - mv gateway.linux64?job=build 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


# NOTE: This was removed because of port conflicts with the base test. Instead
# we run in TLS mode by default and disable this version
# basice2eTLS:
#   stage: tests
#   image: $DOCKER_IMAGE
#   script:
#     - mkdir -p ~/.elixxir
#     - echo $PWD
#     - cd basice2e
#     - for CONFIG in $(echo *.yaml); do echo $CONFIG; sed -i 's/cert\:\ \"\"/cert\:\ \"\.\.\/keys\/cmix\.rip\.crt\"/g'  $CONFIG; sed -i 's/key\:\ \ \"\"/key\:\ \ \"\.\.\/keys\/cmix\.rip\.key\"/g'  $CONFIG; done
#     - for CONFIG in $(echo *.yaml); do echo $CONFIG; sed -i 's/ertPath\:\ \"\"/ertPath\:\ \"\.\.\/keys\/cmix\.rip\.crt\"/g'  $CONFIG; sed -i 's/keyPath\:\ \"\"/keyPath\:\ \"\.\.\/keys\/cmix\.rip\.key\"/g'  $CONFIG; done
#     - sed -i "s/\"Tls\_certificate\"\:\ \"\"/\"Tls\_certificate\"\:\ \"$(awk -v ORS='\\n' '1' ../keys/cmix.rip.crt | sed -e 's/[\/&]/\\&/g')\"/g" ndf.json
#     - sed -i 's/\-\-noTLS//g' run.sh
#     - ./run.sh
#     - cd ..
#   artifacts:
#     when: always
#     paths:
#      - basice2e/
#      - bin/
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 -- .
#     - 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