-
Notifications
You must be signed in to change notification settings - Fork 7
72 lines (69 loc) · 2.86 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# 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 Docker image
on:
push:
tags:
- '*'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- suffix-name: ''
opts: '--flink-provided --spark-provided --hive-provided'
- suffix-name: '-spark'
opts: '--flink-provided --hive-provided'
- suffix-name: '-flink'
opts: '--spark-provided --hive-provided'
- suffix-name: '-all'
opts: ''
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Kyuubi Docker Image
run: |
# See simple version normalization: http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
function version { echo "$@" | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
extra_build_args=""
export KYUUBI_VERSION=$(cat release/release_version)
if [ $(version $KYUUBI_VERSION) -ge $(version "1.8.0") ]; then
extra_build_args="$extra_build_args --web-ui"
fi
wget https://archive.apache.org/dist/kyuubi/kyuubi-${KYUUBI_VERSION}/apache-kyuubi-${KYUUBI_VERSION}-source.tgz
tar -xvf apache-kyuubi-${KYUUBI_VERSION}-source.tgz
cd apache-kyuubi-${KYUUBI_VERSION}-source
./build/dist ${{ matrix.opts }} $extra_build_args
cd ..
docker build --tag apache/kyuubi:${KYUUBI_VERSION}${{ matrix.suffix-name }} --file ${KYUUBI_VERSION}/*/Dockerfile apache-kyuubi-${KYUUBI_VERSION}-source/dist
- name: Validate docker image
run: docker images
- name: Push Docker image
run: docker push apache/kyuubi:$(cat release/release_version)${{ matrix.suffix-name }}