Skip to content

Commit

Permalink
Repo Init
Browse files Browse the repository at this point in the history
  • Loading branch information
kameshsampath committed Feb 14, 2025
0 parents commit faa491c
Show file tree
Hide file tree
Showing 9 changed files with 812 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/polaris-admin-tool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build Polaris Admin Tool PostgreSQL

on:
push:
branches:
- main
paths:
- "docker/**"
- ".github/workflows/polaris-admin-tool.yml"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Polaris
uses: actions/checkout@v4
with:
repository: apache/polaris
path: polaris

- name: Prepare repository name
id: repo
run: |
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "lowercase=$REPO_LOWER" >> $GITHUB_OUTPUT
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: gradle

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images:
ghcr.io/${{
steps.repo.outputs.lowercase}}/apache-polaris-admin-tool-pgsql
tags: |
type=raw,value=latest
type=sha
type=ref,event=branch
type=ref,event=tag
- name: Process tags for Quarkus
id: tags
run: |
# Convert metadata tags to comma-separated list
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ',' | sed 's/,$//')
# Remove the registry prefix from each tag
CLEAN_TAGS=$(echo $TAGS | sed "s|ghcr.io/${{ steps.repo.outputs.lowercase }}/apache-polaris-admin-tool-pgsql:||g")
echo "tags=$CLEAN_TAGS" >> $GITHUB_OUTPUT
- name: Build with Gradle and Create Docker Image
working-directory: ./polaris
env:
ECLIPSE_LINK_DEPS: "org.postgresql:postgresql:42.7.4" # Add if needed
IMAGE_REGISTRY: ghcr.io
run: |
./gradlew clean :polaris-quarkus-admin:build \
-PeclipseLinkDeps=${ECLIPSE_LINK_DEPS} \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.group= \
-Dquarkus.container-image.name=${{ steps.repo.outputs.lowercase }}/apache-polaris-admin-tool-pgsql \
-Dquarkus.container-image.tag=latest \
-Dquarkus.container-image.additional-tags=${{ steps.tags.outputs.tags }} \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.registry=${IMAGE_REGISTRY} \
-Dquarkus.container-image.builder=docker \
-Dquarkus.container-image.platforms=linux/amd64,linux/arm64 \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64
93 changes: 93 additions & 0 deletions .github/workflows/polaris-server-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build PolarisServer with PostgreSQL

on:
push:
branches:
- main
paths:
- "docker/**"
- ".github/workflows/polaris-server-image.yml"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Polaris
uses: actions/checkout@v4
with:
repository: apache/polaris
path: polaris

- name: Prepare repository name
id: repo
run: |
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "lowercase=$REPO_LOWER" >> $GITHUB_OUTPUT
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: gradle

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images:
ghcr.io/${{
steps.repo.outputs.lowercase}}/apache-polaris-server-pgsql
tags: |
type=raw,value=latest
type=sha
type=ref,event=branch
type=ref,event=tag
- name: Process tags for Quarkus
id: tags
run: |
# Convert metadata tags to comma-separated list
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ',' | sed 's/,$//')
# Remove the registry prefix from each tag
CLEAN_TAGS=$(echo $TAGS | sed "s|ghcr.io/${{ steps.repo.outputs.lowercase }}/apache-polaris-server-pgsql:||g")
echo "tags=$CLEAN_TAGS" >> $GITHUB_OUTPUT
- name: Build with Gradle and Create Docker Image
working-directory: ./polaris
env:
ECLIPSE_LINK_DEPS: "org.postgresql:postgresql:42.7.4" # Add if needed
IMAGE_REGISTRY: ghcr.io
run: |
./gradlew clean :polaris-quarkus-server:build \
-PeclipseLinkDeps=${ECLIPSE_LINK_DEPS} \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.group= \
-Dquarkus.container-image.name=${{ steps.repo.outputs.lowercase }}/apache-polaris-server-pgsql \
-Dquarkus.container-image.tag=latest \
-Dquarkus.container-image.additional-tags=${{ steps.tags.outputs.tags }} \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.registry=${IMAGE_REGISTRY} \
-Dquarkus.container-image.builder=docker \
-Dquarkus.container-image.platforms=linux/amd64,linux/arm64 \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dist
.direnv
.env*
!.env.example
cosign*
image-refs.txt
.registry-data
!.envrc
!bin/*.sh
**/.*.env
**/*.secret
**/rsa_*
**/*.key
**/*.pem
bin/**
!bin/*.py
!bin/*.sh
kubectl
.task
work/**
!work/.gitkeep
.vscode
.ansible
**/persistence.xml
**/postgresql.yaml
**/polaris.env
Loading

0 comments on commit faa491c

Please sign in to comment.