agones.dev/agones@v1.54.0/build/release/pre_cloudbuild.yaml (about)

     1  ---
     2  # Copyright 2023 Google LLC
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  steps:
    16  
    17    #
    18    # Clean out the working dir, so we can replace it.
    19    #
    20    - name: ubuntu
    21      script: rm *
    22  
    23    #
    24    # Shallow clone of the release-{x.y.z} branch from the Agones repository.
    25    #
    26    - name: gcr.io/cloud-builders/git
    27      id: clone
    28      args:
    29        - clone
    30        - --depth=1
    31        - --branch=${_BRANCH_NAME}
    32        - https://github.com/googleforgames/agones.git
    33        - .
    34  
    35    #
    36    # Creates the initial make + docker build platform.
    37    # This image is used to run subsequent 'make' commands.
    38    #
    39    - name: ubuntu
    40      args:
    41        - bash
    42        - -c
    43        - "echo 'FROM gcr.io/cloud-builders/docker:24.0.6\nRUN apt-get install make\nENTRYPOINT\
    44          \ [\"/usr/bin/make\"]' > Dockerfile.build"
    45    - name: gcr.io/cloud-builders/docker:24.0.6
    46      id: build-make-docker
    47      args: [build, -f, Dockerfile.build, -t, make-docker, .]
    48  
    49    #
    50    # Pull the build environment image if it exists.
    51    # This image contains all the tools needed to run the build and test commands.
    52    #
    53    - name: make-docker
    54      id: pull-build-image
    55      dir: build
    56      env: ['REGISTRY=us-docker.pkg.dev/${PROJECT_ID}/ci']
    57      args: [pull-build-image]
    58      waitFor:
    59        - build-make-docker
    60  
    61    #
    62    # Build the build environment image if we were unable to pull it.
    63    #
    64    - name: "make-docker"
    65      id: "ensure-build-image"
    66      dir: "build"
    67      args: ["ensure-build-image"]
    68      waitFor:
    69        - pull-build-image
    70  
    71    #
    72    # Ensure example images exists. Requires build image to exist in Cloudbuild environment.
    73    #
    74    - name: make-docker
    75      id: test-examples-on-gar
    76      dir: build
    77      env:
    78        - REGISTRY=us-docker.pkg.dev/${PROJECT_ID}
    79        - DOCKER_RUN_ARGS=--network=cloudbuild
    80      args: [test-examples-on-gar]
    81      waitFor:
    82        - ensure-build-image
    83  
    84    #
    85    # Deploys the site by taking in the base version and deploying the previous version.
    86    #
    87    - name: make-docker
    88      id: release-deploy-site
    89      dir: build
    90      env:
    91        - VERSION=${_VERSION}
    92      args: [release-deploy-site]
    93      waitFor:
    94        - test-examples-on-gar
    95  timeout: 5400s