Skip to content

Commit f7835a2

Browse files
committed
build: add librarian-release image for dogfooding release process
fix test fix fix format remove file
1 parent e7ae7ea commit f7835a2

File tree

5 files changed

+82
-1
lines changed

5 files changed

+82
-1
lines changed

.librarian/state.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-release:latest
2+
libraries:
3+
- id: librarian
4+
version: 0.1.1
5+
last_generated_commit: 97a83d76a09a7f6dcab43675c87bdfeb5bcf1cb5
6+
source_roots:
7+
- "internal"
8+
tag_format: "v{version}"

all_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ var ignoredDirs = []string{
5454
".git",
5555
".idea",
5656
".vscode",
57+
"infra",
5758
"testdata",
5859
}
5960

cloudbuild-exitgate.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@
2020
# published to the 'images-prod' repository.
2121
steps:
2222
- name: 'gcr.io/cloud-builders/docker'
23-
args: ['build', '-t', 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian', '.']
23+
waitFor: ['-']
24+
args:
25+
- 'build'
26+
- '-t'
27+
- 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian'
28+
- '.'
29+
- name: 'gcr.io/cloud-builders/docker'
30+
waitFor: ['-']
31+
args:
32+
- 'build'
33+
- '-f'
34+
- 'infra/container/Dockerfile'
35+
- '-t'
36+
- 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-release'
37+
- '.'
2438
images:
2539
- 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian'
40+
- 'us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-release'

infra/container/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
FROM marketplace.gcr.io/google/ubuntu2404 AS builder
16+
17+
RUN apt-get update && \
18+
apt-get install -y --no-install-recommends \
19+
jq \
20+
&& apt-get clean && \
21+
rm -rf /var/lib/apt/lists/*
22+
23+
WORKDIR /app
24+
COPY infra/container/run.sh /app/run.sh
25+
26+
ENTRYPOINT [ "/app/run.sh" ]

infra/container/run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# Copyright 2025 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+
16+
echo "in release container"
17+
cat /librarian/release-init-request.json
18+
19+
ls -al /librarian
20+
ls -al /repo
21+
ls -al /output
22+
23+
new_version=$(jq -r '.libraries[0].version' /librarian/release-init-request.json)
24+
echo "release version: ${new_version}"
25+
mkdir /output/internal/
26+
echo "${new_version}" > /output/internal/version.txt
27+
28+
ls -al /output
29+
30+
echo "writing empty response"
31+
echo "{}" > /librarian/release-init-response.json

0 commit comments

Comments
 (0)