Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 11e931c

Browse files
authored
ci: configure copyright year for ci/kokoro/readme (#98)
To generate the ci/kokoro/readme files in google-cloud-cpp we need the copyright year to be configurable. No changes in the generated files for this repository.
1 parent 1bdbe7a commit 11e931c

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 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+
declare -A ORIGINAL_COPYRIGHT_YEAR=(
17+
[centos-7]=2019
18+
[centos-8]=2019
19+
[debian-buster]=2019
20+
[debian-stretch]=2019
21+
[fedora]=2019
22+
[opensuse-leap]=2019
23+
[opensuse-tumbleweed]=2019
24+
[ubuntu-trusty]=2019
25+
[ubuntu-xenial]=2019
26+
[ubuntu-bionic]=2019
27+
)

ci/templates/generate-kokoro-readme.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ readonly BUILD_NAMES
4848
source "${PROJECT_ROOT}/ci/templates/kokoro/docker-fragments-functions.sh"
4949
# shellcheck source=../../ci/etc/kokoro/docker-fragments.sh
5050
source "${PROJECT_ROOT}/ci/templates/kokoro/docker-fragments.sh"
51+
# shellcheck source=../../ci/etc/kokoro/readme/project-config.sh
52+
source "${DESTINATION_ROOT}/ci/etc/kokoro/readme/project-config.sh"
5153

5254
generate_dockerfile() {
5355
local -r build="$1"
@@ -64,7 +66,8 @@ generate_dockerfile() {
6466
"INSTALL_CRC32C_FROM_SOURCE" \
6567
"INSTALL_GOOGLE_CLOUD_CPP_COMMON_FROM_SOURCE" \
6668
"BUILD_PROJECT_CMAKE_SUPER_FRAGMENT" \
67-
<"${PROJECT_ROOT}/ci/templates/kokoro/readme/Dockerfile.${build}.in" \
69+
<"${PROJECT_ROOT}/ci/templates/kokoro/readme/Dockerfile.${build}.in" | \
70+
sed -e "s/Copyright [0-9][0-9][0-9][0-9]/Copyright ${ORIGINAL_COPYRIGHT_YEAR[${build}]}/" \
6871
>"${target}"
6972
}
7073

0 commit comments

Comments
 (0)