You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "ruslan-ikhsan (via GitHub)" <gi...@apache.org> on 2023/03/16 09:30:25 UTC

[GitHub] [beam] ruslan-ikhsan commented on a diff in pull request #25117: Playground ci webhook

ruslan-ikhsan commented on code in PR #25117:
URL: https://github.com/apache/beam/pull/25117#discussion_r1138361740


##########
playground/infrastructure/cloudbuild/playground_cd_stable.yaml:
##########
@@ -0,0 +1,96 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+ # contributor license agreements.  See the NOTICE file distributed with
+ # this work for additional information regarding copyright ownership.
+ # The ASF licenses this file to You 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.
+
+steps:
+  - name: ubuntu
+    args:
+      - '-c'
+      - |-
+        echo "Search for CDLOG keyword to find valuable logs entries"
+        echo "CDLOG $(date --utc '+%D %T') Trigger run inputs: 
+        1. PR URL: $_PR_URL; 
+        2. PR Source Repo: $_FORK_REPO; 
+        3. PR Branch: $_PR_BRANCH;
+        4. PR Commit: $_PR_COMMIT; 
+        5. WebHook Action: $_PR_TYPE; 
+        6. Merged to: $_TARGET_PR_REPO_BRANCH; 
+        7. Playground DNS: $_DNS_NAME; "
+        if [[ "${_PR_BRANCH}" != "playground-ci-webhook" ]]; then
+           exit 0
+        fi
+        if [[ ${_TARGET_PR_REPO_BRANCH} == "apache:master" ]]; then
+            echo "CDLOG $(date --utc '+%D %T').
+
+          Pull Request $_PR_URL has been successfully merged into Apache/Beam Master repository (https://github.com/apache/beam).
+            
+          Continous Deployment of Playground Examples (CD) in the progress."
+
+            apt update > /dev/null 2>&1
+
+            apt install -y git curl > /dev/null 2>&1
+
+            apt-get install -y apt-transport-https ca-certificates gnupg > /dev/null 2>&1
+
+            echo "deb https://packages.cloud.google.com/apt cloud-sdk main" > /dev/null 2>&1 | tee -a
+            /etc/apt/sources.list.d/google-cloud-sdk.list > /dev/null 2>&1
+
+            curl https://packages.cloud.google.com/apt/doc/apt-key.gpg > /dev/null 2>&1 | apt-key add - > /dev/null 2>&1 
+
+            apt-get update && apt-get install -y google-cloud-sdk > /dev/null 2>&1
+
+            git clone --branch master https://github.com/apache/beam.git > /dev/null 2>&1
+
+            cd beam
+
+            git remote add forked https://github.com/${_FORK_REPO}.git > /dev/null 2>&1
+
+            curl -O --output-dir /tmp https://raw.githubusercontent.com/akvelon/beam/playground-ci-webhook/playground/infrastructure/cloudbuild/examples_cd.sh
+
+            chmod +x /tmp/examples_cd.sh
+            
+            env -i bash -c "/tmp/examples_cd.sh PROJECT_ID='"'${PROJECT_ID}'"' DNS_NAME='"'${_DNS_NAME}'"' COMMIT='"'${_PR_COMMIT}'"' "

Review Comment:
   @rshamunov added the parameter and all required logic elsewhere



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org