github.com/solo-io/service-mesh-hub@v0.9.2/cloudbuild.yaml (about)

     1  steps:
     2  # Setup SSH
     3  # These are required before dep
     4  - name: gcr.io/cloud-builders/gcloud
     5    args:
     6    - kms
     7    - decrypt
     8    - --ciphertext-file=ci/id_rsa.enc
     9    - --plaintext-file=/root/.ssh/id_rsa
    10    - --location=global
    11    - --keyring=buildkey
    12    - --key=buildkey
    13    id: 'get-ssh-key'
    14  - name: 'gcr.io/cloud-builders/git'
    15    entrypoint: 'bash'
    16    args:
    17    - '-c'
    18    - |
    19      chmod 600 /root/.ssh/id_rsa
    20      cat <<EOF >/root/.ssh/config
    21      Hostname github.com
    22      IdentityFile /root/.ssh/id_rsa
    23      EOF
    24      mv ./ci/github_known_hosts /root/.ssh/known_hosts
    25      git config --global url."ssh://git@github.com/solo-io".insteadOf https://github.com/solo-io
    26    id: 'configure-git'
    27  
    28  # This is required to instruct go not to use it's standard sumdb for pulling these deps
    29  - name: "golang:1.13.4"
    30    args: ["go", "env", "-w", "GOPRIVATE=github.com/solo-io"]
    31    id: "set-private"
    32  
    33  
    34  - name: gcr.io/cloud-builders/gsutil
    35    entrypoint: "bash"
    36    args:
    37      [
    38          "-c",
    39          "mkdir -p /go/pkg && cd /go/pkg && gsutil cat gs://$PROJECT_ID-cache/service-mesh-hub/service-mesh-hub-mod.tar.gz | tar -xzf -",
    40      ]
    41    id: "untar-mod-cache"
    42    waitFor: ["-"]
    43  
    44  # Using prepare-workspace container from github.com/solo-io/cloud-builders/prepare-go-workspace
    45  # This copies files into the proper workspace layout and so must be run before other tasks
    46  - name: "gcr.io/$PROJECT_ID/prepare-go-workspace:0.3.0"
    47    args:
    48    - "--repo-name"
    49    - "$REPO_NAME"
    50    - "--repo-sha"
    51    - "$COMMIT_SHA"
    52    - "--repo-output-dir"
    53    - "."
    54    - "--use-ssh"
    55    env:
    56    - "PROJECT_ROOT=github.com/solo-io/service-mesh-hub"
    57    id: "prepare-workspace"
    58  
    59  # Helm setup steps
    60  - name: gcr.io/cloud-builders/gsutil
    61    entrypoint: mkdir
    62    args: ['-p', './_output/helm']
    63    dir: &dir "/workspace/service-mesh-hub"
    64    waitFor: ['prepare-workspace']
    65    id: 'make-helm-dir'
    66  
    67  - name: 'gcr.io/$PROJECT_ID/go-mod-ginkgo:0.2.6'
    68    args: ['-r', '-p', '-failFast', '-trace', '-progress', '-race', '-compilers=4', '-failOnPending',  '-noColor', '-randomizeAllSpecs', '-randomizeSuites']
    69    env:
    70    - 'PROJECT_ROOT=github.com/solo-io/service-mesh-hub'
    71    - 'TAGGED_VERSION=$TAG_NAME'
    72    - 'HELM_HOME=/root/.helm'
    73    secretEnv: ["GITHUB_TOKEN"]
    74    dir: *dir
    75    id: 'test'
    76  
    77  - name: 'gcr.io/cloud-builders/docker'
    78    entrypoint: 'bash'
    79    args: ['-c', 'docker login --username soloiobot --password $$CI_ADMIN_DOCKER_HUB_PASSWORD']
    80    secretEnv: ['CI_ADMIN_DOCKER_HUB_PASSWORD']
    81    id: 'docker-login'
    82    waitFor: ['test']
    83  
    84  - name: 'gcr.io/$PROJECT_ID/go-mod-make:0.2.6'
    85    args: ['push-all-images']
    86    env:
    87    - 'PROJECT_ROOT=github.com/solo-io/service-mesh-hub'
    88    - 'TAGGED_VERSION=$TAG_NAME'
    89    - 'HELM_HOME=/root/.helm'
    90    dir: *dir
    91    id: 'docker-push'
    92    waitFor: ['docker-login']
    93  
    94  - name: 'gcr.io/$PROJECT_ID/go-mod-make:0.2.6'
    95    args: ['upload-github-release-assets']
    96    env:
    97    - 'PROJECT_ROOT=github.com/solo-io/service-mesh-hub'
    98    - 'TAGGED_VERSION=$TAG_NAME'
    99    - 'HELM_HOME=/root/.helm'
   100    dir: *dir
   101    waitFor: ['docker-login']
   102    secretEnv: ['GITHUB_TOKEN', 'CI_ADMIN_DOCKER_HUB_PASSWORD']
   103    id: 'release'
   104    # 2) Publish Helm charts to GCS
   105  - name: 'gcr.io/$PROJECT_ID/go-mod-make:0.2.6'
   106    args: ['publish-chart']
   107    env:
   108    - 'TAGGED_VERSION=$TAG_NAME'
   109    - 'PROJECT_ROOT=github.com/solo-io/service-mesh-hub'
   110    - 'HELM_HOME=/root/.helm' # tell helm where to find data
   111    dir: *dir
   112    id: 'release-helm'
   113  
   114  secrets:
   115  - kmsKeyName: projects/service-mesh-hub/locations/global/keyRings/buildkey/cryptoKeys/buildkey
   116    secretEnv:
   117      GITHUB_TOKEN: CiQAKyB5I9fr8p5nvPXPUGM9XiM+33WlWIsqpaTJv3+dHRnWwrcSUQCNH9Xw2VlfjBBwejOc6gsrxSpCBywVSl17DPIJ+D7a1ZUnqWftDabLyMCelzmVFYTZ/HMVycLntO+09UlXmpWKNR/Aly39oumqCMJkd1xTog==
   118      CI_ADMIN_DOCKER_HUB_PASSWORD: CiQAKyB5I2PPyxO8/dSDcJ2U3hjdxEZVdCDtXf2JvOD9+A2yl/ASTQCxdIW/67DDP9kEQrslrYKu7CNPOv428R/2maFvnInr/3nzW/NGDVvTC3Rnd8Vijozt94qW2tVhpwvtcQplz/cDGUlvQxksboM1c00q
   119  timeout: 1800s
   120  tags: ['service-mesh-hub']
   121  options:
   122    machineType: 'N1_HIGHCPU_32'
   123    volumes:
   124    - name: "gopath"
   125      path: "/go"
   126    - name: "ssh"
   127      path: /root/.ssh