[GitHub] [flink-docker] afedulov commented on a diff in pull request #116: Publish snapshot images

2022-05-17 Thread GitBox


afedulov commented on code in PR #116:
URL: https://github.com/apache/flink-docker/pull/116#discussion_r866937358


##
.github/workflows/snapshot.yml:
##
@@ -0,0 +1,68 @@
+# 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.
+
+name: "Publish SNAPSHOTs"
+
+on:
+  # schedule:
+  #   - cron: '0 0 * * *' # Deploy every day
+  push:
+branches:
+  - snapshot-dev-master
+
+env:
+  REGISTRY: ghcr.io
+  VERSION: 1.16-SNAPSHOT
+
+jobs:
+  ci:
+uses: ./.github/workflows/ci.yml
+  snapshot:
+needs: ci
+runs-on: ubuntu-latest
+permissions:
+  contents: read
+  packages: write
+strategy:
+  matrix:
+config:
+  - java_version: 8
+  - java_version: 11
+steps:
+  - name: Set env
+run: |
+  repo=${{ github.repository }}# 
apache/flink-docker
+  echo "IMAGE_REPO=$(echo ${repo##*/})" >> $GITHUB_ENV # apache
+  echo "OWNER=$(echo ${repo%%/*})" >> $GITHUB_ENV  # flink-docker
+  - uses: actions/checkout@v3
+  - name: Variables
+run: | 
+  echo "OWNER: $OWNER"
+  echo "IMAGE_REPO: $IMAGE_REPO"
+  - name: Prepare Dockerfiles
+run: |
+  ./add-custom.sh -u 
"https://s3.amazonaws.com/flink-nightly/flink-${VERSION}-bin-scala_2.12.tgz"; -j 
${{ matrix.config.java_version }} -n ${VERSION}-scala_2.12-java${{ 
matrix.config.java_version }}

Review Comment:
   I thought that we were going to put the snapshot.yaml to the dev-master 
branch. If I get you correctly, this won't work with the scheduled runs, 
because they can only be triggered from master. Is my understanding correct?
   



-- 
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: issues-unsubscr...@flink.apache.org

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



[GitHub] [flink-docker] afedulov commented on a diff in pull request #116: Publish snapshot images

2022-05-06 Thread GitBox


afedulov commented on code in PR #116:
URL: https://github.com/apache/flink-docker/pull/116#discussion_r866998834


##
utils.sh:
##
@@ -0,0 +1,59 @@
+#!/bin/bash -e
+
+IMAGE_REPO=$1
+echo "Image repository: $IMAGE_REPO"
+
+function image_tag() {
+local dockerfile
+dockerfile="$1"
+
+local variant minor_version
+variant="$(basename "$(dirname "$dockerfile")")"
+
+echo "${variant}"
+}
+
+function image_name() {
+local image_tag
+image_tag="$1"
+
+echo "${IMAGE_REPO}:${image_tag}"
+}
+
+function build_image() {
+local dockerfile
+dockerfile="$1"
+
+local image_tag image_name dockerfile_dir
+image_tag="$(image_tag "$dockerfile")"
+image_name="$(image_name "$image_tag")"
+dockerfile_dir="$(dirname "$dockerfile")"
+
+echo >&2 "===> Building ${image_tag} image..."
+docker build -t "$image_name" "$dockerfile_dir"
+}
+
+function publish_snapshots() {

Review Comment:
   I guess you are right, I'll inline this logic into the pipeline.



-- 
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: issues-unsubscr...@flink.apache.org

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



[GitHub] [flink-docker] afedulov commented on a diff in pull request #116: Publish snapshot images

2022-05-06 Thread GitBox


afedulov commented on code in PR #116:
URL: https://github.com/apache/flink-docker/pull/116#discussion_r866937358


##
.github/workflows/snapshot.yml:
##
@@ -0,0 +1,68 @@
+# 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.
+
+name: "Publish SNAPSHOTs"
+
+on:
+  # schedule:
+  #   - cron: '0 0 * * *' # Deploy every day
+  push:
+branches:
+  - snapshot-dev-master
+
+env:
+  REGISTRY: ghcr.io
+  VERSION: 1.16-SNAPSHOT
+
+jobs:
+  ci:
+uses: ./.github/workflows/ci.yml
+  snapshot:
+needs: ci
+runs-on: ubuntu-latest
+permissions:
+  contents: read
+  packages: write
+strategy:
+  matrix:
+config:
+  - java_version: 8
+  - java_version: 11
+steps:
+  - name: Set env
+run: |
+  repo=${{ github.repository }}# 
apache/flink-docker
+  echo "IMAGE_REPO=$(echo ${repo##*/})" >> $GITHUB_ENV # apache
+  echo "OWNER=$(echo ${repo%%/*})" >> $GITHUB_ENV  # flink-docker
+  - uses: actions/checkout@v3
+  - name: Variables
+run: | 
+  echo "OWNER: $OWNER"
+  echo "IMAGE_REPO: $IMAGE_REPO"
+  - name: Prepare Dockerfiles
+run: |
+  ./add-custom.sh -u 
"https://s3.amazonaws.com/flink-nightly/flink-${VERSION}-bin-scala_2.12.tgz"; -j 
${{ matrix.config.java_version }} -n ${VERSION}-scala_2.12-java${{ 
matrix.config.java_version }}

Review Comment:
   I thought that we were going to snapshot.yaml to the dev-master branch. If I 
get you correctly, this won't work with the scheduled runs, because they can 
only be triggered from master. Is my understanding correct?
   



-- 
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: issues-unsubscr...@flink.apache.org

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



[GitHub] [flink-docker] afedulov commented on a diff in pull request #116: Publish snapshot images

2022-05-06 Thread GitBox


afedulov commented on code in PR #116:
URL: https://github.com/apache/flink-docker/pull/116#discussion_r866934213


##
.github/workflows/snapshot.yml:
##
@@ -0,0 +1,68 @@
+# 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.
+
+name: "Publish SNAPSHOTs"
+
+on:
+  # schedule:
+  #   - cron: '0 0 * * *' # Deploy every day
+  push:
+branches:
+  - snapshot-dev-master
+
+env:
+  REGISTRY: ghcr.io
+  VERSION: 1.16-SNAPSHOT
+
+jobs:
+  ci:
+uses: ./.github/workflows/ci.yml

Review Comment:
   @zentol I did not know about this limitation. Do you propose to skip the CI 
step?



-- 
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: issues-unsubscr...@flink.apache.org

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