|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# This runs the `librarian update-image` command with a provided repository, |
| 16 | +# secret name, and optional library ID |
| 17 | +steps: |
| 18 | + - name: gcr.io/cloud-builders/git |
| 19 | + id: clone-language-repo |
| 20 | + waitFor: ['-'] |
| 21 | + args: |
| 22 | + - 'clone' |
| 23 | + - '--depth=1' |
| 24 | + - '--branch=$_BRANCH' |
| 25 | + - $_FULL_REPOSITORY |
| 26 | + - name: gcr.io/cloud-builders/git |
| 27 | + id: configure-language-repo-name |
| 28 | + waitFor: ['clone-language-repo'] |
| 29 | + dir: /workspace/$_REPOSITORY |
| 30 | + args: |
| 31 | + - 'config' |
| 32 | + - 'user.name' |
| 33 | + - 'Cloud SDK Librarian' |
| 34 | + - name: gcr.io/cloud-builders/git |
| 35 | + id: configure-language-repo-email |
| 36 | + waitFor: ['configure-language-repo-name'] |
| 37 | + dir: /workspace/$_REPOSITORY |
| 38 | + args: |
| 39 | + - 'config' |
| 40 | + - 'user.email' |
| 41 | + |
| 42 | + - name: gcr.io/cloud-builders/git |
| 43 | + id: clone-googleapis |
| 44 | + waitFor: ['-'] |
| 45 | + args: |
| 46 | + - 'clone' |
| 47 | + - '--single-branch' |
| 48 | + - '--branch=master' |
| 49 | + - https://github.com/googleapis/googleapis |
| 50 | + - name: 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian@sha256:5a001095dcee6b6fdaf3f826a4a339853786b55b21f571daefdfffa995e01272' |
| 51 | + id: update-image |
| 52 | + waitFor: ['configure-language-repo-email', 'clone-googleapis'] |
| 53 | + dir: tmp |
| 54 | + args: |
| 55 | + - 'update-image' |
| 56 | + - '-repo' |
| 57 | + - '/workspace/$_REPOSITORY' |
| 58 | + - '-api-source' |
| 59 | + - '/workspace/googleapis' |
| 60 | + - '-branch=$_BRANCH' |
| 61 | + - '-commit=true' |
| 62 | + - '-push=$_PUSH' |
| 63 | + - '-build=$_BUILD' |
| 64 | + secretEnv: ['LIBRARIAN_GITHUB_TOKEN'] |
| 65 | +tags: ['update-image-$_REPOSITORY'] |
| 66 | +availableSecrets: |
| 67 | + secretManager: |
| 68 | + - versionName: projects/$PROJECT_ID/secrets/$_GITHUB_TOKEN_SECRET_NAME/versions/latest |
| 69 | + env: 'LIBRARIAN_GITHUB_TOKEN' |
| 70 | +options: |
| 71 | + logging: CLOUD_LOGGING_ONLY |
| 72 | +timeout: 10h |
0 commit comments