Skip to content

Commit

Permalink
chore: add cloudbuild setup to publish docker images (#2298)
Browse files Browse the repository at this point in the history
* chore: add cloudbuild setup to publish docker images
  • Loading branch information
mpeddada1 authored Dec 15, 2023
1 parent 087253a commit fc140f7
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .cloudbuild/cloudbuild-test-a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.1'

steps:
# GraalVM A build
- name: gcr.io/cloud-builders/docker
args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."]
dir: .cloudbuild
id: graalvm-a-build
waitFor: ["-"]
- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-a-build" ]
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
33 changes: 33 additions & 0 deletions .cloudbuild/cloudbuild-test-b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.1'

steps:
# GraalVM A build
- name: gcr.io/cloud-builders/docker
args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."]
dir: .cloudbuild
id: graalvm-b-build
waitFor: ["-"]
- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-b-build" ]
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
37 changes: 37 additions & 0 deletions .cloudbuild/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.20.0' # {x-version-update:google-cloud-shared-dependencies:released}
_JAVA_SHARED_CONFIG_VERSION: '1.7.1'
steps:
# GraalVM A build
- name: gcr.io/cloud-builders/docker
args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_a.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "."]
dir: .cloudbuild
id: graalvm-a-build
waitFor: ["-"]

# GraalVM B build
- name: gcr.io/cloud-builders/docker
args: [ "build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", "--file", "graalvm_b.Dockerfile", "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", "." ]
dir: .cloudbuild
id: graalvm-b-build
waitFor: [ "-" ]


images:
- gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
- gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
8 changes: 8 additions & 0 deletions .cloudbuild/google-cloud-sdk.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
19 changes: 19 additions & 0 deletions .cloudbuild/graalvm_a.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


ARG JAVA_SHARED_CONFIG_VERSION

FROM gcr.io/cloud-devrel-public-resources/graalvm_a:$JAVA_SHARED_CONFIG_VERSION

18 changes: 18 additions & 0 deletions .cloudbuild/graalvm_b.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


ARG JAVA_SHARED_CONFIG_VERSION

FROM gcr.io/cloud-devrel-public-resources/graalvm_b:$JAVA_SHARED_CONFIG_VERSION
11 changes: 11 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
"value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm17:(?<currentValue>.*?)\""],
"depNameTemplate": "ghcr.io/graalvm/graalvm-ce",
"datasourceTemplate": "docker"
},
{
"customType": "regex",
"fileMatch": [
"^.cloudbuild/**"
],
"matchStrings": [
"_JAVA_SHARED_CONFIG_VERSION: \"(?<currentValue>.+?)\""
],
"depNameTemplate": "com.google.cloud:google-cloud-shared-config",
"datasourceTemplate": "maven"
}
],
"packageRules": [
Expand Down

0 comments on commit fc140f7

Please sign in to comment.