github.com/aminovpavel/nomad@v0.11.8/.circleci/config.yml (about)

     1  ### ***
     2  ### WARNING: DO NOT manually EDIT or MERGE this file, it is generated by 'make ci-config'.
     3  ### INSTEAD: Edit or merge the source in config/ then run 'make ci-config'.
     4  ### ***
     5  version: 2
     6  jobs:
     7    test-nomad:
     8      machine:
     9        image: ubuntu-1604:201903-01
    10      working_directory: ~/go/src/github.com/hashicorp/nomad
    11      environment:
    12      - GIT_PAGER: cat
    13      - GOLANG_VERSION: 1.14.6
    14      - GOMAXPROCS: 1
    15      - GOPATH: /home/circleci/go
    16      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
    17      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
    18      - NOMAD_SLOW_TEST: 1
    19      - PAGER: cat
    20      - GOTEST_PKGS: ./nomad/...
    21      - GOTEST_PKGS_EXCLUDE: ''
    22      - GOTESTARCH: amd64
    23      steps:
    24      - checkout
    25      - run:
    26          command: |
    27            set -x
    28  
    29            echo installing golang ${GOLANG_VERSION}
    30  
    31            case "${OSTYPE}" in
    32              linux*)  os="linux" ;;
    33              darwin*) os="darwin" ;;
    34              msys*)   os="windows" ;;
    35              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
    36            esac
    37  
    38            if [[ "${os}" != "windows" ]]
    39            then
    40              sudo rm -rf /usr/local/go
    41              sudo mkdir -p /usr/local
    42              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
    43              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
    44              rm -rf /tmp/golang.tar.gz
    45            else
    46              rm -rf /usr/local/go
    47              mkdir -p /usr/local
    48              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
    49              unzip -q -o /tmp/go.zip -d /usr/local
    50              rm -rf /tmp/go.zip
    51            fi
    52          name: Install golang
    53      - run:
    54          command: |
    55            sudo rm -rf /usr/bin/protoc
    56            sudo ./scripts/vagrant-linux-priv-protoc.sh
    57          name: install protoc
    58      - run:
    59          command: |
    60            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
    61            sudo unzip -d /usr/local/bin /tmp/consul.zip
    62            rm -rf /tmp/consul*
    63          name: Install Consul 1.6.4
    64      - run:
    65          command: |
    66            set -x
    67  
    68            case "${OSTYPE}" in
    69              linux*)  os="linux" ;;
    70              darwin*) os="darwin" ;;
    71              msys*)   os="windows" ;;
    72              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
    73            esac
    74  
    75            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
    76  
    77            if [[ "${os}" != "windows" ]]; then
    78              sudo unzip -d /usr/local/bin /tmp/vault.zip
    79              rm -rf /tmp/vault*
    80            else
    81              rm -rf c:\Windows\vault.exe
    82              unzip /tmp/vault.zip -d "/c/Windows"
    83              rm -rf /tmp/vault*
    84            fi
    85          name: Install Vault
    86      - run:
    87          command: |
    88            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
    89              sudo apt-get update
    90              sudo apt-get install -y gcc-multilib
    91            else
    92              echo "Skipping 32bit lib installation while building for not 386"
    93            fi
    94          name: Install 32bit gcc libs
    95      - run:
    96          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
    97      - run:
    98          command: |
    99            if [ -z $GOTEST_PKGS_EXCLUDE ];
   100            then
   101              unset GOTEST_PKGS_EXCLUDE
   102            else
   103              unset GOTEST_PKGS
   104            fi
   105  
   106            if [ ! -z $GOTESTARCH ]; then
   107              export GOARCH="$GOTESTARCH";
   108            fi
   109  
   110            mkdir -p /tmp/test-reports
   111            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   112            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   113          name: Running Nomad Tests
   114          no_output_timeout: 20m
   115      - store_test_results:
   116          path: /tmp/test-reports
   117      - store_artifacts:
   118          path: /tmp/test-reports
   119    test-api:
   120      machine:
   121        image: ubuntu-1604:201903-01
   122      working_directory: ~/go/src/github.com/hashicorp/nomad
   123      environment:
   124      - GIT_PAGER: cat
   125      - GOLANG_VERSION: 1.14.6
   126      - GOMAXPROCS: 1
   127      - GOPATH: /home/circleci/go
   128      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   129      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   130      - NOMAD_SLOW_TEST: 1
   131      - PAGER: cat
   132      - GOTEST_PKGS: ./api/...
   133      - GOTEST_PKGS_EXCLUDE: ''
   134      - GOTESTARCH: amd64
   135      steps:
   136      - checkout
   137      - run:
   138          command: |
   139            set -x
   140  
   141            echo installing golang ${GOLANG_VERSION}
   142  
   143            case "${OSTYPE}" in
   144              linux*)  os="linux" ;;
   145              darwin*) os="darwin" ;;
   146              msys*)   os="windows" ;;
   147              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   148            esac
   149  
   150            if [[ "${os}" != "windows" ]]
   151            then
   152              sudo rm -rf /usr/local/go
   153              sudo mkdir -p /usr/local
   154              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   155              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   156              rm -rf /tmp/golang.tar.gz
   157            else
   158              rm -rf /usr/local/go
   159              mkdir -p /usr/local
   160              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   161              unzip -q -o /tmp/go.zip -d /usr/local
   162              rm -rf /tmp/go.zip
   163            fi
   164          name: Install golang
   165      - run:
   166          command: |
   167            sudo rm -rf /usr/bin/protoc
   168            sudo ./scripts/vagrant-linux-priv-protoc.sh
   169          name: install protoc
   170      - run:
   171          command: |
   172            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   173            sudo unzip -d /usr/local/bin /tmp/consul.zip
   174            rm -rf /tmp/consul*
   175          name: Install Consul 1.6.4
   176      - run:
   177          command: |
   178            set -x
   179  
   180            case "${OSTYPE}" in
   181              linux*)  os="linux" ;;
   182              darwin*) os="darwin" ;;
   183              msys*)   os="windows" ;;
   184              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   185            esac
   186  
   187            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   188  
   189            if [[ "${os}" != "windows" ]]; then
   190              sudo unzip -d /usr/local/bin /tmp/vault.zip
   191              rm -rf /tmp/vault*
   192            else
   193              rm -rf c:\Windows\vault.exe
   194              unzip /tmp/vault.zip -d "/c/Windows"
   195              rm -rf /tmp/vault*
   196            fi
   197          name: Install Vault
   198      - run:
   199          command: |
   200            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
   201              sudo apt-get update
   202              sudo apt-get install -y gcc-multilib
   203            else
   204              echo "Skipping 32bit lib installation while building for not 386"
   205            fi
   206          name: Install 32bit gcc libs
   207      - run:
   208          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
   209      - run:
   210          command: |
   211            if [ -z $GOTEST_PKGS_EXCLUDE ];
   212            then
   213              unset GOTEST_PKGS_EXCLUDE
   214            else
   215              unset GOTEST_PKGS
   216            fi
   217  
   218            if [ ! -z $GOTESTARCH ]; then
   219              export GOARCH="$GOTESTARCH";
   220            fi
   221  
   222            mkdir -p /tmp/test-reports
   223            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   224            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   225          name: Running Nomad Tests
   226          no_output_timeout: 20m
   227      - store_test_results:
   228          path: /tmp/test-reports
   229      - store_artifacts:
   230          path: /tmp/test-reports
   231    test-exec:
   232      machine:
   233        image: ubuntu-1604:201903-01
   234      working_directory: ~/go/src/github.com/hashicorp/nomad
   235      environment:
   236      - GIT_PAGER: cat
   237      - GOLANG_VERSION: 1.14.6
   238      - GOMAXPROCS: 1
   239      - GOPATH: /home/circleci/go
   240      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   241      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   242      - NOMAD_SLOW_TEST: 1
   243      - PAGER: cat
   244      - GOTEST_PKGS: ./drivers/exec
   245      - GOTEST_PKGS_EXCLUDE: ''
   246      - GOTESTARCH: amd64
   247      steps:
   248      - checkout
   249      - run:
   250          command: |
   251            set -x
   252  
   253            echo installing golang ${GOLANG_VERSION}
   254  
   255            case "${OSTYPE}" in
   256              linux*)  os="linux" ;;
   257              darwin*) os="darwin" ;;
   258              msys*)   os="windows" ;;
   259              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   260            esac
   261  
   262            if [[ "${os}" != "windows" ]]
   263            then
   264              sudo rm -rf /usr/local/go
   265              sudo mkdir -p /usr/local
   266              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   267              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   268              rm -rf /tmp/golang.tar.gz
   269            else
   270              rm -rf /usr/local/go
   271              mkdir -p /usr/local
   272              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   273              unzip -q -o /tmp/go.zip -d /usr/local
   274              rm -rf /tmp/go.zip
   275            fi
   276          name: Install golang
   277      - run:
   278          command: |
   279            sudo rm -rf /usr/bin/protoc
   280            sudo ./scripts/vagrant-linux-priv-protoc.sh
   281          name: install protoc
   282      - run:
   283          command: |
   284            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   285            sudo unzip -d /usr/local/bin /tmp/consul.zip
   286            rm -rf /tmp/consul*
   287          name: Install Consul 1.6.4
   288      - run:
   289          command: |
   290            set -x
   291  
   292            case "${OSTYPE}" in
   293              linux*)  os="linux" ;;
   294              darwin*) os="darwin" ;;
   295              msys*)   os="windows" ;;
   296              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   297            esac
   298  
   299            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   300  
   301            if [[ "${os}" != "windows" ]]; then
   302              sudo unzip -d /usr/local/bin /tmp/vault.zip
   303              rm -rf /tmp/vault*
   304            else
   305              rm -rf c:\Windows\vault.exe
   306              unzip /tmp/vault.zip -d "/c/Windows"
   307              rm -rf /tmp/vault*
   308            fi
   309          name: Install Vault
   310      - run:
   311          command: |
   312            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
   313              sudo apt-get update
   314              sudo apt-get install -y gcc-multilib
   315            else
   316              echo "Skipping 32bit lib installation while building for not 386"
   317            fi
   318          name: Install 32bit gcc libs
   319      - run:
   320          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
   321      - run:
   322          command: |
   323            if [ -z $GOTEST_PKGS_EXCLUDE ];
   324            then
   325              unset GOTEST_PKGS_EXCLUDE
   326            else
   327              unset GOTEST_PKGS
   328            fi
   329  
   330            if [ ! -z $GOTESTARCH ]; then
   331              export GOARCH="$GOTESTARCH";
   332            fi
   333  
   334            mkdir -p /tmp/test-reports
   335            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   336            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   337          name: Running Nomad Tests
   338          no_output_timeout: 20m
   339      - store_test_results:
   340          path: /tmp/test-reports
   341      - store_artifacts:
   342          path: /tmp/test-reports
   343    test-client:
   344      machine:
   345        image: ubuntu-1604:201903-01
   346      working_directory: ~/go/src/github.com/hashicorp/nomad
   347      environment:
   348      - GIT_PAGER: cat
   349      - GOLANG_VERSION: 1.14.6
   350      - GOMAXPROCS: 1
   351      - GOPATH: /home/circleci/go
   352      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   353      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   354      - NOMAD_SLOW_TEST: 1
   355      - PAGER: cat
   356      - GOTEST_PKGS: ./client/...
   357      - GOTEST_PKGS_EXCLUDE: ''
   358      - GOTESTARCH: amd64
   359      steps:
   360      - checkout
   361      - run:
   362          command: |
   363            set -x
   364  
   365            echo installing golang ${GOLANG_VERSION}
   366  
   367            case "${OSTYPE}" in
   368              linux*)  os="linux" ;;
   369              darwin*) os="darwin" ;;
   370              msys*)   os="windows" ;;
   371              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   372            esac
   373  
   374            if [[ "${os}" != "windows" ]]
   375            then
   376              sudo rm -rf /usr/local/go
   377              sudo mkdir -p /usr/local
   378              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   379              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   380              rm -rf /tmp/golang.tar.gz
   381            else
   382              rm -rf /usr/local/go
   383              mkdir -p /usr/local
   384              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   385              unzip -q -o /tmp/go.zip -d /usr/local
   386              rm -rf /tmp/go.zip
   387            fi
   388          name: Install golang
   389      - run:
   390          command: |
   391            sudo rm -rf /usr/bin/protoc
   392            sudo ./scripts/vagrant-linux-priv-protoc.sh
   393          name: install protoc
   394      - run:
   395          command: |
   396            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   397            sudo unzip -d /usr/local/bin /tmp/consul.zip
   398            rm -rf /tmp/consul*
   399          name: Install Consul 1.6.4
   400      - run:
   401          command: |
   402            set -x
   403  
   404            case "${OSTYPE}" in
   405              linux*)  os="linux" ;;
   406              darwin*) os="darwin" ;;
   407              msys*)   os="windows" ;;
   408              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   409            esac
   410  
   411            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   412  
   413            if [[ "${os}" != "windows" ]]; then
   414              sudo unzip -d /usr/local/bin /tmp/vault.zip
   415              rm -rf /tmp/vault*
   416            else
   417              rm -rf c:\Windows\vault.exe
   418              unzip /tmp/vault.zip -d "/c/Windows"
   419              rm -rf /tmp/vault*
   420            fi
   421          name: Install Vault
   422      - run:
   423          command: |
   424            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
   425              sudo apt-get update
   426              sudo apt-get install -y gcc-multilib
   427            else
   428              echo "Skipping 32bit lib installation while building for not 386"
   429            fi
   430          name: Install 32bit gcc libs
   431      - run:
   432          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
   433      - run:
   434          command: |
   435            if [ -z $GOTEST_PKGS_EXCLUDE ];
   436            then
   437              unset GOTEST_PKGS_EXCLUDE
   438            else
   439              unset GOTEST_PKGS
   440            fi
   441  
   442            if [ ! -z $GOTESTARCH ]; then
   443              export GOARCH="$GOTESTARCH";
   444            fi
   445  
   446            mkdir -p /tmp/test-reports
   447            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   448            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   449          name: Running Nomad Tests
   450          no_output_timeout: 20m
   451      - store_test_results:
   452          path: /tmp/test-reports
   453      - store_artifacts:
   454          path: /tmp/test-reports
   455    test-windows:
   456      machine:
   457        image: windows-server-2019-vs2019:stable
   458      working_directory: c:\gopath\src\github.com\hashicorp\nomad
   459      steps:
   460      - run:
   461          command: git config --global core.autocrlf false
   462      - checkout
   463      - run:
   464          command: |
   465            mkdir -p $GOBIN
   466            mkdir -p $GOTESTSUM_PATH
   467          name: Setup
   468      - run:
   469          command: |
   470            set -x
   471  
   472            echo installing golang ${GOLANG_VERSION}
   473  
   474            case "${OSTYPE}" in
   475              linux*)  os="linux" ;;
   476              darwin*) os="darwin" ;;
   477              msys*)   os="windows" ;;
   478              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   479            esac
   480  
   481            if [[ "${os}" != "windows" ]]
   482            then
   483              sudo rm -rf c:/go
   484              sudo mkdir -p c:
   485              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   486              sudo tar -C c: -xzf /tmp/golang.tar.gz
   487              rm -rf /tmp/golang.tar.gz
   488            else
   489              rm -rf c:/go
   490              mkdir -p c:
   491              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   492              unzip -q -o /tmp/go.zip -d c:
   493              rm -rf /tmp/go.zip
   494            fi
   495          name: Install golang
   496      - run:
   497          command: go version
   498      - run:
   499          command: |
   500            set -x
   501  
   502            case "${OSTYPE}" in
   503              linux*)  os="linux" ;;
   504              darwin*) os="darwin" ;;
   505              msys*)   os="windows" ;;
   506              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   507            esac
   508  
   509            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"$VAULT_VERSION"/vault_"$VAULT_VERSION"_"${os}"_amd64.zip
   510  
   511            if [[ "${os}" != "windows" ]]; then
   512              sudo unzip -d /usr/local/bin /tmp/vault.zip
   513              rm -rf /tmp/vault*
   514            else
   515              rm -rf c:\Windows\vault.exe
   516              unzip /tmp/vault.zip -d "/c/Windows"
   517              rm -rf /tmp/vault*
   518            fi
   519          name: Install Vault
   520      - run:
   521          command: vault version
   522      - run:
   523          command: choco install make
   524      - run:
   525          command: |
   526            export PATH=$PATH:/c/go/bin:/c/gopath/bin
   527            make deps
   528          name: Install golang dependencies
   529      - run:
   530          command: docker pull hashicorpnomad/busybox-windows:server2016-0.1
   531          name: Pre-download docker test image
   532      - run:
   533          command: |
   534            export PATH=$PATH:/c/go/bin:/c/gopath/bin
   535            go build -o $GOBIN\nomad.exe
   536          name: Build nomad
   537      - run:
   538          command: |
   539            # Only test docker driver tests for now
   540            export PATH=$PATH:/c/go/bin:/c/gopath/bin
   541            gotestsum --format=short-verbose \
   542              --junitfile $GOTESTSUM_PATH/results.xml \
   543              github.com/hashicorp/nomad/drivers/docker \
   544              github.com/hashicorp/nomad/client/lib/fifo \
   545              github.com/hashicorp/nomad/client/logmon
   546          name: Run tests with gotestsum
   547      - store_test_results:
   548          path: c:\tmp\test-reports
   549      - store_artifacts:
   550          path: c:\tmp\test-reports
   551      environment:
   552      - GOBIN: c:\gopath\bin
   553      - GOLANG_VERSION: 1.14.6
   554      - GOPATH: c:\gopath
   555      - GOTESTSUM_PATH: c:\tmp\test-reports
   556      - GOTESTSUM_VERSION: 0.4.2
   557      - VAULT_VERSION: 1.4.1
   558      resource_class: windows.medium
   559      shell: bash --login -eo pipefail
   560    test-shared-exec:
   561      machine:
   562        image: ubuntu-1604:201903-01
   563      working_directory: ~/go/src/github.com/hashicorp/nomad
   564      environment:
   565      - GIT_PAGER: cat
   566      - GOLANG_VERSION: 1.14.6
   567      - GOMAXPROCS: 1
   568      - GOPATH: /home/circleci/go
   569      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   570      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   571      - NOMAD_SLOW_TEST: 1
   572      - PAGER: cat
   573      - GOTEST_PKGS: ./drivers/shared/executor
   574      - GOTEST_PKGS_EXCLUDE: ''
   575      - GOTESTARCH: amd64
   576      steps:
   577      - checkout
   578      - run:
   579          command: |
   580            set -x
   581  
   582            echo installing golang ${GOLANG_VERSION}
   583  
   584            case "${OSTYPE}" in
   585              linux*)  os="linux" ;;
   586              darwin*) os="darwin" ;;
   587              msys*)   os="windows" ;;
   588              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   589            esac
   590  
   591            if [[ "${os}" != "windows" ]]
   592            then
   593              sudo rm -rf /usr/local/go
   594              sudo mkdir -p /usr/local
   595              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   596              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   597              rm -rf /tmp/golang.tar.gz
   598            else
   599              rm -rf /usr/local/go
   600              mkdir -p /usr/local
   601              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   602              unzip -q -o /tmp/go.zip -d /usr/local
   603              rm -rf /tmp/go.zip
   604            fi
   605          name: Install golang
   606      - run:
   607          command: |
   608            sudo rm -rf /usr/bin/protoc
   609            sudo ./scripts/vagrant-linux-priv-protoc.sh
   610          name: install protoc
   611      - run:
   612          command: |
   613            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   614            sudo unzip -d /usr/local/bin /tmp/consul.zip
   615            rm -rf /tmp/consul*
   616          name: Install Consul 1.6.4
   617      - run:
   618          command: |
   619            set -x
   620  
   621            case "${OSTYPE}" in
   622              linux*)  os="linux" ;;
   623              darwin*) os="darwin" ;;
   624              msys*)   os="windows" ;;
   625              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   626            esac
   627  
   628            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   629  
   630            if [[ "${os}" != "windows" ]]; then
   631              sudo unzip -d /usr/local/bin /tmp/vault.zip
   632              rm -rf /tmp/vault*
   633            else
   634              rm -rf c:\Windows\vault.exe
   635              unzip /tmp/vault.zip -d "/c/Windows"
   636              rm -rf /tmp/vault*
   637            fi
   638          name: Install Vault
   639      - run:
   640          command: |
   641            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
   642              sudo apt-get update
   643              sudo apt-get install -y gcc-multilib
   644            else
   645              echo "Skipping 32bit lib installation while building for not 386"
   646            fi
   647          name: Install 32bit gcc libs
   648      - run:
   649          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
   650      - run:
   651          command: |
   652            if [ -z $GOTEST_PKGS_EXCLUDE ];
   653            then
   654              unset GOTEST_PKGS_EXCLUDE
   655            else
   656              unset GOTEST_PKGS
   657            fi
   658  
   659            if [ ! -z $GOTESTARCH ]; then
   660              export GOARCH="$GOTESTARCH";
   661            fi
   662  
   663            mkdir -p /tmp/test-reports
   664            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   665            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   666          name: Running Nomad Tests
   667          no_output_timeout: 20m
   668      - store_test_results:
   669          path: /tmp/test-reports
   670      - store_artifacts:
   671          path: /tmp/test-reports
   672    test-ui:
   673      docker:
   674      - environment:
   675          JOBS: 2
   676        image: circleci/node:10-browsers
   677      steps:
   678      - checkout
   679      - restore_cache:
   680          keys:
   681          - v1-deps-{{ checksum "ui/yarn.lock" }}
   682          - v1-deps-
   683      - run:
   684          command: cd ui && yarn install
   685          name: yarn install
   686      - save_cache:
   687          key: v1-deps-{{ checksum "ui/yarn.lock" }}
   688          paths:
   689          - ./ui/node_modules
   690      - run:
   691          command: cd ui && yarn run lint:js
   692          name: lint:js
   693      - run:
   694          command: cd ui && yarn run lint:hbs
   695          name: lint:hbs
   696      - run:
   697          command: mkdir -p /tmp/test-reports && cd ui && yarn test
   698          name: Ember tests
   699      - store_test_results:
   700          path: /tmp/test-reports
   701      - store_artifacts:
   702          path: /tmp/test-reports
   703    lint-go:
   704      docker:
   705      - image: golang:1.14.6
   706      working_directory: /go/src/github.com/hashicorp/nomad
   707      steps:
   708      - checkout
   709      - run:
   710          command: apt-get update; apt-get install -y shellcheck sudo unzip
   711      - run:
   712          command: |
   713            sudo rm -rf /usr/bin/protoc
   714            sudo ./scripts/vagrant-linux-priv-protoc.sh
   715          name: install protoc
   716      - run:
   717          command: "CCI_VERSION=\"0.1.5879\"\nCCI_SHA256=\"f178ea62c781aec06267017404f87983c87f171fd0e66ef3737916246ae66dd6\"\n\nURL=\"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CCI_VERSION}/circleci-cli_${CCI_VERSION}_linux_amd64.tar.gz\"\n\nmkdir -p /tmp/circleci-cli/\ncurl --fail --show-error --location \\\n  -o /tmp/circleci-cli/cli.tar.gz \"${URL}\"\n\necho \"$CCI_SHA256 /tmp/circleci-cli/cli.tar.gz\" | sha256sum -c\n\ntar -xz --strip-components=1 \\\n  -C /tmp/circleci-cli \\\n  -f /tmp/circleci-cli/cli.tar.gz \\\n  \"circleci-cli_${CCI_VERSION}_linux_amd64/circleci\" \n\nsudo cp /tmp/circleci-cli/circleci /usr/bin/circleci-local-cli\n\ncircleci-local-cli version\n"
   718          name: Install CircleCI CLI 0.1.5879
   719      - run:
   720          command: make deps lint-deps
   721      - run:
   722          command: make check
   723      - run:
   724          command: make checkscripts
   725      - run:
   726          command: make -C .circleci CIRCLECI="circleci-local-cli --skip-update-check" ci-verify
   727          name: check .circleci/config.yml is up-to-date
   728      environment:
   729      - GIT_PAGER: cat
   730      - GOMAXPROCS: 1
   731      - GOPATH: /go
   732      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   733      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   734      - NOMAD_SLOW_TEST: 1
   735      - PAGER: cat
   736    website-docker-image:
   737      docker:
   738      - image: circleci/buildpack-deps
   739      shell: /usr/bin/env bash -euo pipefail -c
   740      steps:
   741      - checkout
   742      - setup_remote_docker
   743      - run:
   744          command: |
   745            # There is an edge case that would cause an issue here - if dependencies are updated to an exact copy
   746            # of a previous version, for example if packge-lock.json is reverted, we need to manually push the new
   747            # image to the "latest" tag
   748            # Ignore job if running an enterprise build
   749            IMAGE_TAG=$(cat website/Dockerfile website/package-lock.json | sha256sum | awk '{print $1;}')
   750            echo "Using $IMAGE_TAG"
   751            if  [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/nomad.git" ]; then
   752              echo "Not Nomad OSS Repo, not building website docker image"
   753            elif curl https://hub.docker.com/v2/repositories/hashicorp/nomad-website/tags/$IMAGE_TAG -fsL > /dev/null; then
   754                echo "Dependencies have not changed, not building a new website docker image."
   755            else
   756                cd website/
   757                docker build -t hashicorp/nomad-website:$IMAGE_TAG .
   758                docker tag hashicorp/nomad-website:$IMAGE_TAG hashicorp/nomad-website:latest
   759                docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS
   760                docker push hashicorp/nomad-website
   761            fi
   762          name: Build Docker Image if Necessary
   763    test-other:
   764      machine:
   765        image: ubuntu-1604:201903-01
   766      working_directory: ~/go/src/github.com/hashicorp/nomad
   767      environment:
   768      - GIT_PAGER: cat
   769      - GOLANG_VERSION: 1.14.6
   770      - GOMAXPROCS: 1
   771      - GOPATH: /home/circleci/go
   772      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   773      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   774      - NOMAD_SLOW_TEST: 1
   775      - PAGER: cat
   776      - GOTEST_PKGS: ''
   777      - GOTEST_PKGS_EXCLUDE: ./api|./client|./drivers/docker|./drivers/exec|./drivers/shared/executor|./nomad|./devices
   778      - GOTESTARCH: amd64
   779      steps:
   780      - checkout
   781      - run:
   782          command: |
   783            set -x
   784  
   785            echo installing golang ${GOLANG_VERSION}
   786  
   787            case "${OSTYPE}" in
   788              linux*)  os="linux" ;;
   789              darwin*) os="darwin" ;;
   790              msys*)   os="windows" ;;
   791              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   792            esac
   793  
   794            if [[ "${os}" != "windows" ]]
   795            then
   796              sudo rm -rf /usr/local/go
   797              sudo mkdir -p /usr/local
   798              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   799              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   800              rm -rf /tmp/golang.tar.gz
   801            else
   802              rm -rf /usr/local/go
   803              mkdir -p /usr/local
   804              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   805              unzip -q -o /tmp/go.zip -d /usr/local
   806              rm -rf /tmp/go.zip
   807            fi
   808          name: Install golang
   809      - run:
   810          command: |
   811            sudo rm -rf /usr/bin/protoc
   812            sudo ./scripts/vagrant-linux-priv-protoc.sh
   813          name: install protoc
   814      - run:
   815          command: |
   816            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   817            sudo unzip -d /usr/local/bin /tmp/consul.zip
   818            rm -rf /tmp/consul*
   819          name: Install Consul 1.6.4
   820      - run:
   821          command: |
   822            set -x
   823  
   824            case "${OSTYPE}" in
   825              linux*)  os="linux" ;;
   826              darwin*) os="darwin" ;;
   827              msys*)   os="windows" ;;
   828              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   829            esac
   830  
   831            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   832  
   833            if [[ "${os}" != "windows" ]]; then
   834              sudo unzip -d /usr/local/bin /tmp/vault.zip
   835              rm -rf /tmp/vault*
   836            else
   837              rm -rf c:\Windows\vault.exe
   838              unzip /tmp/vault.zip -d "/c/Windows"
   839              rm -rf /tmp/vault*
   840            fi
   841          name: Install Vault
   842      - run:
   843          command: |
   844            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
   845              sudo apt-get update
   846              sudo apt-get install -y gcc-multilib
   847            else
   848              echo "Skipping 32bit lib installation while building for not 386"
   849            fi
   850          name: Install 32bit gcc libs
   851      - run:
   852          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
   853      - run:
   854          command: |
   855            if [ -z $GOTEST_PKGS_EXCLUDE ];
   856            then
   857              unset GOTEST_PKGS_EXCLUDE
   858            else
   859              unset GOTEST_PKGS
   860            fi
   861  
   862            if [ ! -z $GOTESTARCH ]; then
   863              export GOARCH="$GOTESTARCH";
   864            fi
   865  
   866            mkdir -p /tmp/test-reports
   867            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   868            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   869          name: Running Nomad Tests
   870          no_output_timeout: 20m
   871      - store_test_results:
   872          path: /tmp/test-reports
   873      - store_artifacts:
   874          path: /tmp/test-reports
   875    test-devices:
   876      docker:
   877      - image: golang:1.14.6
   878      working_directory: /go/src/github.com/hashicorp/nomad
   879      environment:
   880      - GIT_PAGER: cat
   881      - GOMAXPROCS: 1
   882      - GOPATH: /go
   883      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   884      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   885      - NOMAD_SLOW_TEST: 1
   886      - PAGER: cat
   887      - GOTEST_PKGS: ./devices/...
   888      - GOTEST_PKGS_EXCLUDE: ''
   889      - GOTESTARCH: amd64
   890      steps:
   891      - checkout
   892      - run:
   893          command: apt-get update; apt-get install -y shellcheck sudo unzip
   894      - run:
   895          command: make deps
   896      - run:
   897          command: |
   898            sudo rm -rf /usr/bin/protoc
   899            sudo ./scripts/vagrant-linux-priv-protoc.sh
   900          name: install protoc
   901      - run:
   902          command: |
   903            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
   904            sudo unzip -d /usr/local/bin /tmp/consul.zip
   905            rm -rf /tmp/consul*
   906          name: Install Consul 1.6.4
   907      - run:
   908          command: |
   909            set -x
   910  
   911            case "${OSTYPE}" in
   912              linux*)  os="linux" ;;
   913              darwin*) os="darwin" ;;
   914              msys*)   os="windows" ;;
   915              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   916            esac
   917  
   918            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
   919  
   920            if [[ "${os}" != "windows" ]]; then
   921              sudo unzip -d /usr/local/bin /tmp/vault.zip
   922              rm -rf /tmp/vault*
   923            else
   924              rm -rf c:\Windows\vault.exe
   925              unzip /tmp/vault.zip -d "/c/Windows"
   926              rm -rf /tmp/vault*
   927            fi
   928          name: Install Vault
   929      - run:
   930          command: |
   931            if [ -z $GOTEST_PKGS_EXCLUDE ];
   932            then
   933              unset GOTEST_PKGS_EXCLUDE
   934            else
   935              unset GOTEST_PKGS
   936            fi
   937  
   938            if [ ! -z $GOTESTARCH ]; then
   939              export GOARCH="$GOTESTARCH";
   940            fi
   941  
   942            mkdir -p /tmp/test-reports
   943            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
   944            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
   945          name: Running Nomad Tests
   946          no_output_timeout: 20m
   947      - store_test_results:
   948          path: /tmp/test-reports
   949      - store_artifacts:
   950          path: /tmp/test-reports
   951    test-docker:
   952      machine:
   953        image: circleci/classic:201808-01
   954      working_directory: ~/go/src/github.com/hashicorp/nomad
   955      environment:
   956      - GIT_PAGER: cat
   957      - GOLANG_VERSION: 1.14.6
   958      - GOMAXPROCS: 1
   959      - GOPATH: /home/circleci/go
   960      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
   961      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
   962      - NOMAD_SLOW_TEST: 1
   963      - PAGER: cat
   964      - GOTEST_PKGS: ./drivers/docker
   965      - GOTEST_PKGS_EXCLUDE: ''
   966      - GOTESTARCH: amd64
   967      steps:
   968      - checkout
   969      - run:
   970          command: |
   971            set -x
   972  
   973            echo installing golang ${GOLANG_VERSION}
   974  
   975            case "${OSTYPE}" in
   976              linux*)  os="linux" ;;
   977              darwin*) os="darwin" ;;
   978              msys*)   os="windows" ;;
   979              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
   980            esac
   981  
   982            if [[ "${os}" != "windows" ]]
   983            then
   984              sudo rm -rf /usr/local/go
   985              sudo mkdir -p /usr/local
   986              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
   987              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
   988              rm -rf /tmp/golang.tar.gz
   989            else
   990              rm -rf /usr/local/go
   991              mkdir -p /usr/local
   992              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
   993              unzip -q -o /tmp/go.zip -d /usr/local
   994              rm -rf /tmp/go.zip
   995            fi
   996          name: Install golang
   997      - run:
   998          command: |
   999            sudo rm -rf /usr/bin/protoc
  1000            sudo ./scripts/vagrant-linux-priv-protoc.sh
  1001          name: install protoc
  1002      - run:
  1003          command: |
  1004            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
  1005            sudo unzip -d /usr/local/bin /tmp/consul.zip
  1006            rm -rf /tmp/consul*
  1007          name: Install Consul 1.6.4
  1008      - run:
  1009          command: |
  1010            set -x
  1011  
  1012            case "${OSTYPE}" in
  1013              linux*)  os="linux" ;;
  1014              darwin*) os="darwin" ;;
  1015              msys*)   os="windows" ;;
  1016              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
  1017            esac
  1018  
  1019            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
  1020  
  1021            if [[ "${os}" != "windows" ]]; then
  1022              sudo unzip -d /usr/local/bin /tmp/vault.zip
  1023              rm -rf /tmp/vault*
  1024            else
  1025              rm -rf c:\Windows\vault.exe
  1026              unzip /tmp/vault.zip -d "/c/Windows"
  1027              rm -rf /tmp/vault*
  1028            fi
  1029          name: Install Vault
  1030      - run:
  1031          command: |
  1032            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
  1033              sudo apt-get update
  1034              sudo apt-get install -y gcc-multilib
  1035            else
  1036              echo "Skipping 32bit lib installation while building for not 386"
  1037            fi
  1038          name: Install 32bit gcc libs
  1039      - run:
  1040          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
  1041      - run:
  1042          command: |
  1043            if [ -z $GOTEST_PKGS_EXCLUDE ];
  1044            then
  1045              unset GOTEST_PKGS_EXCLUDE
  1046            else
  1047              unset GOTEST_PKGS
  1048            fi
  1049  
  1050            if [ ! -z $GOTESTARCH ]; then
  1051              export GOARCH="$GOTESTARCH";
  1052            fi
  1053  
  1054            mkdir -p /tmp/test-reports
  1055            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
  1056            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
  1057          name: Running Nomad Tests
  1058          no_output_timeout: 20m
  1059      - store_test_results:
  1060          path: /tmp/test-reports
  1061      - store_artifacts:
  1062          path: /tmp/test-reports
  1063    build-binaries:
  1064      docker:
  1065      - image: golang:1.14.6
  1066      working_directory: /go/src/github.com/hashicorp/nomad
  1067      environment:
  1068      - GIT_PAGER: cat
  1069      - GOMAXPROCS: 1
  1070      - GOPATH: /go
  1071      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
  1072      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
  1073      - NOMAD_SLOW_TEST: 1
  1074      - PAGER: cat
  1075      - GO_TAGS: codegen_generated
  1076      steps:
  1077      - checkout
  1078      - run:
  1079          command: apt-get update; apt-get install -y sudo unzip zip
  1080      - run:
  1081          command: make deps
  1082      - run:
  1083          command: |
  1084            sudo rm -rf /usr/bin/protoc
  1085            sudo ./scripts/vagrant-linux-priv-protoc.sh
  1086          name: install protoc
  1087      - run:
  1088          command: sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
  1089      - run:
  1090          command: make pkg/windows_amd64.zip pkg/linux_amd64.zip
  1091      - store_artifacts:
  1092          destination: /builds/nomad_windows_amd64.zip
  1093          path: pkg/windows_amd64.zip
  1094      - store_artifacts:
  1095          destination: /builds/nomad_linux_amd64.zip
  1096          path: pkg/linux_amd64.zip
  1097    test-e2e:
  1098      docker:
  1099      - image: golang:1.14.6
  1100      working_directory: /go/src/github.com/hashicorp/nomad
  1101      steps:
  1102      - checkout
  1103      - run:
  1104          command: apt-get update; apt-get install -y sudo unzip
  1105      - run:
  1106          command: |
  1107            groupadd --gid 3434 circleci
  1108            useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci
  1109            echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci
  1110            echo 'Defaults    env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
  1111            chown -R circleci:circleci /go
  1112          name: prepare non-root user
  1113      - run:
  1114          command: sudo -E -H -u circleci PATH=${PATH} make deps
  1115      - run:
  1116          command: sudo -E -H -u circleci PATH=${PATH} make e2e-test
  1117      environment:
  1118      - GIT_PAGER: cat
  1119      - GOMAXPROCS: 1
  1120      - GOPATH: /go
  1121      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
  1122      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
  1123      - NOMAD_SLOW_TEST: 1
  1124      - PAGER: cat
  1125    test-32bit:
  1126      machine:
  1127        image: ubuntu-1604:201903-01
  1128      working_directory: ~/go/src/github.com/hashicorp/nomad
  1129      environment:
  1130      - GIT_PAGER: cat
  1131      - GOLANG_VERSION: 1.14.6
  1132      - GOMAXPROCS: 1
  1133      - GOPATH: /home/circleci/go
  1134      - GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
  1135      - GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
  1136      - NOMAD_SLOW_TEST: 1
  1137      - PAGER: cat
  1138      - GOTEST_PKGS: ./client/fingerprint
  1139      - GOTEST_PKGS_EXCLUDE: ''
  1140      - GOTESTARCH: '386'
  1141      steps:
  1142      - checkout
  1143      - run:
  1144          command: |
  1145            set -x
  1146  
  1147            echo installing golang ${GOLANG_VERSION}
  1148  
  1149            case "${OSTYPE}" in
  1150              linux*)  os="linux" ;;
  1151              darwin*) os="darwin" ;;
  1152              msys*)   os="windows" ;;
  1153              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
  1154            esac
  1155  
  1156            if [[ "${os}" != "windows" ]]
  1157            then
  1158              sudo rm -rf /usr/local/go
  1159              sudo mkdir -p /usr/local
  1160              curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
  1161              sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
  1162              rm -rf /tmp/golang.tar.gz
  1163            else
  1164              rm -rf /usr/local/go
  1165              mkdir -p /usr/local
  1166              curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
  1167              unzip -q -o /tmp/go.zip -d /usr/local
  1168              rm -rf /tmp/go.zip
  1169            fi
  1170          name: Install golang
  1171      - run:
  1172          command: |
  1173            sudo rm -rf /usr/bin/protoc
  1174            sudo ./scripts/vagrant-linux-priv-protoc.sh
  1175          name: install protoc
  1176      - run:
  1177          command: |
  1178            curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
  1179            sudo unzip -d /usr/local/bin /tmp/consul.zip
  1180            rm -rf /tmp/consul*
  1181          name: Install Consul 1.6.4
  1182      - run:
  1183          command: |
  1184            set -x
  1185  
  1186            case "${OSTYPE}" in
  1187              linux*)  os="linux" ;;
  1188              darwin*) os="darwin" ;;
  1189              msys*)   os="windows" ;;
  1190              *)       echo "unknown os: ${OSTYPE}"; exit 1 ;;
  1191            esac
  1192  
  1193            curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
  1194  
  1195            if [[ "${os}" != "windows" ]]; then
  1196              sudo unzip -d /usr/local/bin /tmp/vault.zip
  1197              rm -rf /tmp/vault*
  1198            else
  1199              rm -rf c:\Windows\vault.exe
  1200              unzip /tmp/vault.zip -d "/c/Windows"
  1201              rm -rf /tmp/vault*
  1202            fi
  1203          name: Install Vault
  1204      - run:
  1205          command: |
  1206            if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
  1207              sudo apt-get update
  1208              sudo apt-get install -y gcc-multilib
  1209            else
  1210              echo "Skipping 32bit lib installation while building for not 386"
  1211            fi
  1212          name: Install 32bit gcc libs
  1213      - run:
  1214          command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
  1215      - run:
  1216          command: |
  1217            if [ -z $GOTEST_PKGS_EXCLUDE ];
  1218            then
  1219              unset GOTEST_PKGS_EXCLUDE
  1220            else
  1221              unset GOTEST_PKGS
  1222            fi
  1223  
  1224            if [ ! -z $GOTESTARCH ]; then
  1225              export GOARCH="$GOTESTARCH";
  1226            fi
  1227  
  1228            mkdir -p /tmp/test-reports
  1229            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
  1230            sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
  1231          name: Running Nomad Tests
  1232          no_output_timeout: 20m
  1233      - store_test_results:
  1234          path: /tmp/test-reports
  1235      - store_artifacts:
  1236          path: /tmp/test-reports
  1237  workflows:
  1238    build-test:
  1239      jobs:
  1240      - build-binaries:
  1241          filters:
  1242            branches:
  1243              ignore:
  1244              - stable-website
  1245              - /^.-ui\b.*/
  1246      - lint-go:
  1247          filters:
  1248            branches:
  1249              ignore:
  1250              - /^.-ui\b.*/
  1251              - /^docs-.*/
  1252              - stable-website
  1253      - test-windows:
  1254          filters:
  1255            branches:
  1256              ignore:
  1257              - /^.-ui\b.*/
  1258              - /^docs-.*/
  1259              - stable-website
  1260      - test-client:
  1261          filters:
  1262            branches:
  1263              ignore:
  1264              - /^.-ui\b.*/
  1265              - /^docs-.*/
  1266              - stable-website
  1267      - test-nomad:
  1268          filters:
  1269            branches:
  1270              ignore:
  1271              - /^.-ui\b.*/
  1272              - /^docs-.*/
  1273              - stable-website
  1274      - test-api:
  1275          filters:
  1276            branches:
  1277              ignore:
  1278              - /^.-ui\b.*/
  1279              - /^docs-.*/
  1280              - stable-website
  1281      - test-devices:
  1282          filters:
  1283            branches:
  1284              ignore:
  1285              - /^.-ui\b.*/
  1286              - /^docs-.*/
  1287              - stable-website
  1288      - test-other:
  1289          filters:
  1290            branches:
  1291              ignore:
  1292              - /^.-ui\b.*/
  1293              - /^docs-.*/
  1294              - stable-website
  1295      - test-docker:
  1296          filters:
  1297            branches:
  1298              ignore:
  1299              - /^.-ui\b.*/
  1300              - /^docs-.*/
  1301              - stable-website
  1302      - test-exec:
  1303          filters:
  1304            branches:
  1305              ignore:
  1306              - /^.-ui\b.*/
  1307              - /^docs-.*/
  1308              - stable-website
  1309      - test-shared-exec:
  1310          filters:
  1311            branches:
  1312              ignore:
  1313              - /^.-ui\b.*/
  1314              - /^docs-.*/
  1315              - stable-website
  1316      - test-32bit:
  1317          filters:
  1318            branches:
  1319              ignore:
  1320              - /^.-ui\b.*/
  1321              - /^docs-.*/
  1322              - stable-website
  1323      - test-e2e:
  1324          filters:
  1325            branches:
  1326              ignore:
  1327              - /^.-ui\b.*/
  1328              - /^docs-.*/
  1329              - stable-website
  1330      - test-ui:
  1331          filters:
  1332            branches:
  1333              ignore:
  1334              - stable-website
  1335              - /^docs-.*/
  1336    website:
  1337      jobs:
  1338      - website-docker-image:
  1339          filters:
  1340            branches:
  1341              only:
  1342              - master
  1343          context: static-sites
  1344    version: 2