Skip to content

Commit 1611bc2

Browse files
authored
adds multiple php versions to Kokoro (GoogleCloudPlatform#611)
1 parent 2048a21 commit 1611bc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1820
-738
lines changed

.kokoro/common.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR}
44
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
55

6+
# Download credentials from Cloud Storage.
7+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/php-docs-samples"
8+
69
# All builds use the trampoline script to run in docker.
710
build_file: "php-docs-samples/.kokoro/trampoline.sh"
811

912
# Configure the docker image for kokoro-trampoline.
1013
env_vars: {
11-
key: "TRAMPOLINE_IMAGE"
12-
value: "gcr.io/cloud-devrel-kokoro-resources/php72"
14+
key: "TRAMPOLINE_BUILD_FILE"
15+
value: "github/php-docs-samples/.kokoro/system_tests.sh"
1316
}

.kokoro/docker/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
php56/Dockerfile
2+
php70/Dockerfile
3+
php71/Dockerfile
4+
php72/Dockerfile
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gcr.io/google_appengine/php72
1+
FROM gcr.io/google_appengine/PHP_VERSION
22

33
RUN apt-get update && apt-get install -y \
44
python-ipaddr \
@@ -12,10 +12,10 @@ RUN git clone https://github.com/GoogleCloudPlatform/php-tools.git ${HOME}/php-t
1212

1313
# install / enable PHP extensions
1414
RUN pecl install grpc \
15-
&& echo "extension=grpc.so" >> /opt/php72/lib/conf.d/ext-grpc.ini \
16-
&& echo "extension=bcmath.so" >> /opt/php72/lib/conf.d/ext-bcmath.ini
15+
&& echo "extension=grpc.so" >> /opt/PHP_VERSION/lib/conf.d/ext-grpc.ini \
16+
&& echo "extension=bcmath.so" >> /opt/PHP_VERSION/lib/conf.d/ext-bcmath.ini
1717

18-
# Install composer globally
18+
# Install phpunit globally
1919
RUN composer global require phpunit/phpunit:^5.0
2020

2121
# Install Google Cloud SDK
@@ -27,6 +27,15 @@ RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz \
2727
--path-update false \
2828
--command-completion false
2929

30+
# Make composer and gcloud bins available via the PATH variable
3031
ENV PATH="$PATH:/opt/composer/vendor/bin:/root/google-cloud-sdk/bin"
3132

33+
# Configure Google Cloud SDK
34+
RUN gcloud config set app/promote_by_default false && \
35+
gcloud config set disable_prompts true && \
36+
gcloud -q components install app-engine-python && \
37+
gcloud -q components install app-engine-php && \
38+
gcloud -q components update
39+
3240
ENTRYPOINT /bin/bash
41+

.kokoro/docker/Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2018, Google, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
.PHONY: all build push php56 php70 php71 php72
14+
php56:
15+
mkdir -p php56
16+
sed -e 's/PHP_VERSION/php56/g' Dockerfile.template > php56/Dockerfile
17+
echo "# Add steps specific to PHP 5.6" >> php56/Dockerfile
18+
echo "RUN apt-get install -y php5-cgi" >> php56/Dockerfile
19+
echo "RUN rm /opt/php56/lib/ext.enabled/ext-memcached.ini" >> php56/Dockerfile
20+
echo "ENV RUN_DEVSERVER_TESTS=true" >> php56/Dockerfile
21+
echo "ENV RUN_CS_FIXER=true\n" >> php56/Dockerfile
22+
23+
php70:
24+
mkdir -p php70
25+
sed -e 's/PHP_VERSION/php70/g' Dockerfile.template > php70/Dockerfile
26+
27+
php71:
28+
mkdir -p php71
29+
sed -e 's/PHP_VERSION/php71/g' Dockerfile.template > php71/Dockerfile
30+
31+
php72:
32+
mkdir -p php72
33+
sed -e 's/PHP_VERSION/php72/g' Dockerfile.template > php72/Dockerfile
34+
35+
build:
36+
make php56 && docker build php56 -t gcr.io/cloud-devrel-kokoro-resources/php56
37+
make php70 && docker build php70 -t gcr.io/cloud-devrel-kokoro-resources/php70
38+
make php71 && docker build php71 -t gcr.io/cloud-devrel-kokoro-resources/php71
39+
make php72 && docker build php72 -t gcr.io/cloud-devrel-kokoro-resources/php72
40+
41+
push:
42+
docker push gcr.io/cloud-devrel-kokoro-resources/php56
43+
docker push gcr.io/cloud-devrel-kokoro-resources/php70
44+
docker push gcr.io/cloud-devrel-kokoro-resources/php71
45+
docker push gcr.io/cloud-devrel-kokoro-resources/php72
46+
47+
all:
48+
make build
49+
make push

.kokoro/php56.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php56"
7+
}

.kokoro/php70.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php70"
7+
}

.kokoro/php71.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php71"
7+
}

.kokoro/php72.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php72"
7+
}

.kokoro/presubmit.cfg

Lines changed: 0 additions & 10 deletions
This file was deleted.

.kokoro/secrets-example.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
################################################################################
44
# Run the following gcloud command to decrypt secrets.sh.enc as follows: #
55
# #
6-
# gcloud kms decrypt -location=global --keyring=ci --key=ci \ #
6+
# gcloud kms decrypt --location=global --keyring=ci --key=ci \ #
77
# --ciphertext-file=.kokoro/secrets.sh.enc \ #
88
# --plaintext-file=.kokoro/secrets.sh #
99
# #
@@ -12,7 +12,6 @@
1212

1313
# General
1414
export GOOGLE_PROJECT_ID=
15-
export GOOGLE_API_KEY=
1615
export GOOGLE_STORAGE_BUCKET=$GOOGLE_PROJECT_ID
1716
export GOOGLE_CLIENT_ID=
1817
export GOOGLE_CLIENT_SECRET=

0 commit comments

Comments
 (0)