This is an automated email from the ASF dual-hosted git repository.
ouyangwen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 3292814 Automatically publish image to docker registry when released
(#12414)
3292814 is described below
commit 3292814e3eabe724b8b1264ea6957fb47a828ece
Author: Torch-Fan <[email protected]>
AuthorDate: Sat Sep 18 08:44:50 2021 +0800
Automatically publish image to docker registry when released (#12414)
* add registry push
* update name
* build docker image according to the document
* fix bugs
* modify package to install
* add package
* build all packages
* test
* fix bugs
* problems about docker
* add debug information
* OPS -> OPTS
* add tests
* push all images
* final tests
* final-nal-al-l testgit add .git add .!
* finish tests right in this timegit add .
* absolutely the last commit!
* I promise the last commit
---
.github/workflows/docker.yml | 73 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
new file mode 100644
index 0000000..b0691ea
--- /dev/null
+++ b/.github/workflows/docker.yml
@@ -0,0 +1,73 @@
+#
+# 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: Deploy Docker Image
+
+on:
+ release:
+ types:
+ - published
+ workflow_dispatch:
+
+env:
+ MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.count=3
-Dmaven.wagon.httpconnectionManager.ttlSeconds=30 -DskipTests
+
+jobs:
+
+ deploy-docker-iamge:
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@v2
+
+ # setup docker
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ # build target with maven
+ - name: Cache Maven Repos
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+ - name: Set up JDK 8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 8
+ - name: set environment
+ run: export MAVEN_OPTS=' -Dmaven.javadoc.skip=true -Drat.skip=true
-Djacoco.skip=true $MAVEN_OPTS'
+ - name: Build Project
+ run: |
+ ./mvnw -B -Prelease,docker -DskipTests clean install
+ docker image ls --format "{{.ID}} {{.Repository}} {{.Tag}}" | grep
apache| sed 's/apache\//${{ secrets.DOCKERHUB_USERNAME }}\//' |tr A-Z a-z |awk
'{system("docker tag "$1" "$2":latest;docker tag "$1" "$2":"$3";")}'
+
+ - name: Push Docker Image
+ run: |
+ echo Docker Images:
+ echo `docker image ls|grep -i ${{ secrets.DOCKERHUB_USERNAME }}|awk
'{print $1":"$2}'`
+ docker image ls|grep -i ${{ secrets.DOCKERHUB_USERNAME }}|awk
'{print $1":"$2}'|xargs -i docker push {}