Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PostgreSQL Configuration
POSTGRES_PASSWORD=changeme
POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PORT=5432

# Oracle Configuration (if using Oracle container)
# ORACLE_PASSWORD=OraclePassword123
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

## Bug Description
<!-- A clear and concise description of what the bug is -->

## Environment
- PostgreSQL Version: <!-- e.g., 17.1.5, 18.4 -->
- Oracle Version: <!-- e.g., 19c, 21c -->
- Oracle Instant Client Version: <!-- e.g., 19.25.0.0.0 -->
- Container Platform: <!-- e.g., Docker, Kubernetes, Podman -->
- Architecture: <!-- e.g., amd64, arm64 -->

## Steps to Reproduce
1.
2.
3.

## Expected Behavior
<!-- A clear and concise description of what you expected to happen -->

## Actual Behavior
<!-- A clear and concise description of what actually happened -->

## Error Messages/Logs
```
<!-- Paste relevant error messages or logs here -->
```

## Configuration
<!-- If relevant, share your configuration (docker-compose.yml, Kubernetes manifests, etc.) -->
```yaml
# Paste configuration here
```

## Additional Context
<!-- Add any other context about the problem here -->

## Possible Solution
<!-- If you have ideas on how to fix this, please share them -->
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Feature Description
<!-- A clear and concise description of the feature you'd like to see -->

## Problem Statement
<!-- Describe the problem this feature would solve -->
Is your feature request related to a problem? Please describe.

## Proposed Solution
<!-- Describe the solution you'd like -->

## Alternative Solutions
<!-- Describe any alternative solutions or features you've considered -->

## Use Case
<!-- Provide a detailed use case for this feature -->

## PostgreSQL Versions
<!-- Which PostgreSQL versions should this feature support? -->
- [ ] PostgreSQL 16
- [ ] PostgreSQL 17
- [ ] PostgreSQL 18
- [ ] All versions

## Additional Context
<!-- Add any other context, screenshots, or examples about the feature request here -->

## Impact
<!-- How would this feature benefit the project and its users? -->

## Implementation Ideas
<!-- If you have ideas on how to implement this, please share them -->
44 changes: 44 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Description
<!-- Provide a clear and concise description of your changes -->

## Type of Change
<!-- Mark the relevant option with an 'x' -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring
- [ ] CI/CD changes

## PostgreSQL Versions Affected
<!-- Mark all versions that are affected by this change -->
- [ ] PostgreSQL 16
- [ ] PostgreSQL 17
- [ ] PostgreSQL 18
- [ ] All versions

## Testing
<!-- Describe the tests you ran and/or added -->
- [ ] Built Docker image successfully
- [ ] Tested with docker-compose
- [ ] Verified extensions load correctly (oracle_fdw, pg_cron, anon)
- [ ] Tested Oracle FDW connectivity
- [ ] Added/updated automated tests
- [ ] Tested on multiple architectures (amd64/arm64)

## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings or errors
- [ ] I have tested my changes locally
- [ ] Any dependent changes have been merged and published

## Related Issues
<!-- Link any related issues using #issue_number -->
Closes #

## Additional Notes
<!-- Add any other context about the pull request here -->
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "chore(deps)"
include: "scope"

# Docker base images
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "docker"
commit-message:
prefix: "chore(deps)"
include: "scope"
187 changes: 163 additions & 24 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,39 @@ name: Build and Push Docker Image
on:
push:
branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest
Comment on lines 15 to 16
strategy:
matrix:
pg_version:
- major: "16"
version: "16.6"
latest: false
oracle_fdw_version: "ORACLE_FDW_2_7_0"
- major: "17"
version: "17.1.5"
latest: false
oracle_fdw_version: "ORACLE_FDW_2_7_0"
- major: "18"
version: "18.4"
latest: true
oracle_fdw_version: "ORACLE_FDW_2_8_0"
oracle_version: ["19.25.0.0.0"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -25,20 +47,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push to Docker
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:17.1.5
build-args: |
PG_MAJOR=17
ORACLE_VERSION=19.25.0.0.0
# tags: |
# ${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:latest
# ${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:v1.0.0-rc.1

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -51,18 +61,147 @@ jobs:
GITHUB_REPOSITORY=${{github.repository_owner}} &&
echo "repository=${GITHUB_REPOSITORY@L}/postgres-container" >> $GITHUB_OUTPUT

# - name: Push image to GHCR
# run: |
# docker buildx imagetools create \
# --tag ghcr.io/${{ steps.lower-repo.outputs.repository }}:v0.0.1 \
# ${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:v0.0.1
- name: Generate Docker tags
id: docker-tags
run: |
TAGS="${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:${{ matrix.pg_version.version }}"
TAGS="${TAGS},${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:${{ matrix.pg_version.major }}"
if [ "${{ matrix.pg_version.latest }}" == "true" ]; then
TAGS="${TAGS},${{ secrets.DOCKERHUB_USERNAME }}/postgres-container:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT

- name: Generate GHCR tags
id: ghcr-tags
run: |
TAGS="ghcr.io/${{ steps.lower-repo.outputs.repository }}:${{ matrix.pg_version.version }}"
TAGS="${TAGS},ghcr.io/${{ steps.lower-repo.outputs.repository }}:${{ matrix.pg_version.major }}"
if [ "${{ matrix.pg_version.latest }}" == "true" ]; then
TAGS="${TAGS},ghcr.io/${{ steps.lower-repo.outputs.repository }}:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT

- name: Build and push to Docker Hub
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-tags.outputs.tags }}
Comment on lines +86 to +90
build-args: |
PG_MAJOR=${{ matrix.pg_version.major }}
PG_VERSION=${{ matrix.pg_version.version }}
ORACLE_VERSION=${{ matrix.oracle_version }}
ORACLE_FDW_VERSION=${{ matrix.pg_version.oracle_fdw_version }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push to GHCR
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}:17.1.5
tags: ${{ steps.ghcr-tags.outputs.tags }}
build-args: |
PG_MAJOR=17
ORACLE_VERSION=19.25.0.0.0
PG_MAJOR=${{ matrix.pg_version.major }}
PG_VERSION=${{ matrix.pg_version.version }}
ORACLE_VERSION=${{ matrix.oracle_version }}
ORACLE_FDW_VERSION=${{ matrix.pg_version.oracle_fdw_version }}
cache-from: type=gha
cache-to: type=gha,mode=max

test:
runs-on: ubuntu-latest
needs: docker
if: github.event_name == 'pull_request'
strategy:
matrix:
pg_version:
- major: "16"
version: "16.6"
oracle_fdw_version: "ORACLE_FDW_2_7_0"
- major: "17"
version: "17.1.5"
oracle_fdw_version: "ORACLE_FDW_2_7_0"
- major: "18"
version: "18.4"
oracle_fdw_version: "ORACLE_FDW_2_8_0"
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Build test image
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: postgres-oracle-fdw:test
build-args: |
PG_MAJOR=${{ matrix.pg_version.major }}
PG_VERSION=${{ matrix.pg_version.version }}
ORACLE_VERSION=19.25.0.0.0
ORACLE_FDW_VERSION=${{ matrix.pg_version.oracle_fdw_version }}

- name: Test PostgreSQL starts
run: |
docker run -d --name postgres-test \
-e POSTGRES_PASSWORD=testpass \
postgres-oracle-fdw:test

# Wait for PostgreSQL to be ready
timeout=60
while [ $timeout -gt 0 ]; do
if docker exec postgres-test pg_isready -U postgres; then
echo "PostgreSQL is ready!"
break
fi
sleep 2
timeout=$((timeout - 2))
done

if [ $timeout -le 0 ]; then
echo "PostgreSQL failed to start"
docker logs postgres-test
exit 1
fi

- name: Test extensions
run: |
# Test oracle_fdw extension
docker exec postgres-test psql -U postgres -c "CREATE EXTENSION oracle_fdw;" || {
echo "Failed to create oracle_fdw extension"
exit 1
}

# Test pg_cron extension
docker exec postgres-test psql -U postgres -c "CREATE EXTENSION pg_cron;" || {
echo "Failed to create pg_cron extension"
exit 1
}

# Test anon extension
docker exec postgres-test psql -U postgres -c "CREATE EXTENSION anon;" || {
echo "Failed to create anon extension"
exit 1
}

echo "All extensions loaded successfully!"

- name: Verify extension versions
run: |
docker exec postgres-test psql -U postgres -c "
SELECT name, default_version, installed_version
FROM pg_available_extensions
WHERE name IN ('oracle_fdw', 'pg_cron', 'anon')
ORDER BY name;
"

- name: Cleanup
if: always()
run: |
docker stop postgres-test || true
docker rm postgres-test || true
Loading
Loading