Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ name: Build and Publish docker images for Hive GA

on:
create:
schedule:
- cron: '17 3 * * *'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose an odd time, following the guidance.

The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. If the load is sufficiently high enough, some queued jobs may be dropped. To decrease the chance of delay, schedule your workflow to run at a different time of the hour.

workflow_dispatch:
inputs:
hiveVersion:
Expand All @@ -40,7 +42,7 @@ env:

jobs:
buildAndPush:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'create' && github.event.ref_type == 'tag' && startsWith(github.event.ref, 'rel/')
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || (github.event_name == 'create' && github.event.ref_type == 'tag' && startsWith(github.event.ref, 'rel/'))
runs-on: ubuntu-latest
steps:
- name: Free disk space
Expand Down Expand Up @@ -76,8 +78,8 @@ jobs:
echo "TEZ_VERSION=${{ github.event.inputs.tezVersion }}" >> $GITHUB_ENV
echo "BUILD_ENV=release" >> $GITHUB_ENV

- name: Prepare environment variables for Release
if: github.event_name == 'create' && github.event.ref_type == 'tag' && startsWith(github.event.ref, 'rel/')
- name: Prepare environment variables from repository
if: github.event_name != 'workflow_dispatch'
run: |
echo "HIVE_VERSION=$(mvn -f "pom.xml" -q help:evaluate -Dexpression=project.version -DforceStdout)" >> $GITHUB_ENV
echo "HADOOP_VERSION=$(mvn -f "pom.xml" -q help:evaluate -Dexpression=hadoop.version -DforceStdout)" >> $GITHUB_ENV
Expand All @@ -87,10 +89,19 @@ jobs:
- name: Prepare common environment variables
run: |
echo "namespace=${{ vars.DOCKER_NAMESPACE || 'apache' }}" >> $GITHUB_ENV
echo "tag=$HIVE_VERSION" | awk '{print tolower($0)}' >> $GITHUB_ENV

- name: Prepare an image tag for release
if: github.event_name != 'schedule'
run: |
echo "tag=$HIVE_VERSION" >> $GITHUB_ENV
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't have a case where we have to keep the tolower.

Also, this PR currently assumes we want to replace 4.3.0-SNAPSHOT and standalone-metastore-4.3.0-SNAPSHOT every day. I'd say it is a good starting point; we can add the date or checksum later if we want.


- name: Prepare an image tag for nightly
if: github.event_name == 'schedule'
run: |
echo "tag=nightly" >> $GITHUB_ENV

- name: Build Hive project
if: github.event_name == 'create' && github.event.ref_type == 'tag' && startsWith(github.event.ref, 'rel/')
if: github.event_name != 'workflow_dispatch'
run: |
mvn --batch-mode clean package -DskipTests -Pdist
ls ./packaging/target/
Expand Down
Loading