-
Notifications
You must be signed in to change notification settings - Fork 0
Publish docker image #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f4c136a
fix: move python-dotenv to main dependencies
tillywoodfield 77c9c39
build: add Dockerfile
tillywoodfield 1b25484
ci: add docker image build check to CI
tillywoodfield c30ac65
ci: build and push image to ghcr
tillywoodfield 9b5957b
fix: make json_url nullable
tillywoodfield d6b8d4f
feat: add log line to signal end of pipeline
tillywoodfield 72c6e0d
ci: push image for tags only
tillywoodfield ce8b631
ci: create tag on push to live
tillywoodfield c952ac8
docs: include docs about releases in readme
tillywoodfield 706b01f
ci: create github release on merge to live
tillywoodfield 40f98e7
ci: remove automatic release creation
tillywoodfield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build and push image | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_NAME: "oc4ids-datastore-pipeline" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract version | ||
run: | | ||
TAG=${GITHUB_REF#refs/*/} | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo $VERSION | ||
- name: Build and push image | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
echo $IMAGE_ID | ||
docker build . -t ${IMAGE_ID}:${VERSION} -t ${IMAGE_ID}:latest | ||
docker push --all-tags ${IMAGE_ID} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Create tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- live | ||
|
||
jobs: | ||
create-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install local package | ||
run: pip install . | ||
- name: Extract version | ||
run: | | ||
VERSION=$(python -c "import importlib.metadata; print(importlib.metadata.version('oc4ids-datastore-pipeline'))") | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo $VERSION | ||
- name: Create tag | ||
run: | | ||
git tag "v${VERSION}" | ||
git push origin "v${VERSION}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM python:3.12-slim | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y libpq-dev gcc | ||
|
||
WORKDIR /oc4ids_datastore_pipeline | ||
|
||
COPY requirements.txt . | ||
jarofgreen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY . . | ||
|
||
RUN pip install . | ||
|
||
ENTRYPOINT ["sh", "-c", "alembic upgrade head && oc4ids-datastore-pipeline"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
migrations/versions/3499656b84e7_allow_nullable_json_url.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""allow nullable json_url | ||
|
||
Revision ID: 3499656b84e7 | ||
Revises: 084c39bf418e | ||
Create Date: 2025-02-11 16:44:30.550413 | ||
|
||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "3499656b84e7" | ||
down_revision: Union[str, None] = "084c39bf418e" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column("dataset", "json_url", existing_type=sa.VARCHAR(), nullable=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column("dataset", "json_url", existing_type=sa.VARCHAR(), nullable=False) | ||
# ### end Alembic commands ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.12 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=requirements.txt pyproject.toml | ||
# | ||
alembic==1.14.1 | ||
# via oc4ids-datastore-pipeline (pyproject.toml) | ||
attrs==25.1.0 | ||
# via | ||
# cattrs | ||
# jsonschema | ||
# referencing | ||
# requests-cache | ||
backports-datetime-fromisoformat==2.0.3 | ||
# via flattentool | ||
boto3==1.36.17 | ||
# via oc4ids-datastore-pipeline (pyproject.toml) | ||
botocore==1.36.17 | ||
# via | ||
# boto3 | ||
# s3transfer | ||
btrees==6.1 | ||
# via zodb | ||
cattrs==24.1.2 | ||
# via requests-cache | ||
certifi==2025.1.31 | ||
# via requests | ||
cffi==1.17.1 | ||
# via persistent | ||
charset-normalizer==3.4.1 | ||
# via requests | ||
click==8.1.8 | ||
# via | ||
# libcoveoc4ids | ||
# libcoveocds | ||
defusedxml==0.7.1 | ||
# via odfpy | ||
et-xmlfile==2.0.0 | ||
# via openpyxl | ||
flattentool==0.27.0 | ||
# via | ||
# libcove | ||
# oc4ids-datastore-pipeline (pyproject.toml) | ||
idna==3.10 | ||
# via requests | ||
ijson==3.3.0 | ||
# via flattentool | ||
jmespath==1.0.1 | ||
# via | ||
# boto3 | ||
# botocore | ||
json-merge-patch==0.2 | ||
# via ocdsextensionregistry | ||
jsonref==1.1.0 | ||
# via | ||
# flattentool | ||
# libcove | ||
# libcoveocds | ||
# ocdsextensionregistry | ||
jsonschema==4.23.0 | ||
# via | ||
# libcove | ||
# libcoveocds | ||
jsonschema-specifications==2024.10.1 | ||
# via jsonschema | ||
libcove==0.32.1 | ||
# via | ||
# libcoveoc4ids | ||
# libcoveocds | ||
libcoveoc4ids==0.9.0 | ||
# via oc4ids-datastore-pipeline (pyproject.toml) | ||
libcoveocds==0.16.4 | ||
# via libcoveoc4ids | ||
lxml==5.3.1 | ||
# via flattentool | ||
mako==1.3.9 | ||
# via alembic | ||
markupsafe==3.0.2 | ||
# via mako | ||
ocdsextensionregistry==0.6.9 | ||
# via libcoveocds | ||
odfpy==1.4.1 | ||
# via flattentool | ||
openpyxl==3.1.5 | ||
# via flattentool | ||
persistent==6.1 | ||
# via | ||
# btrees | ||
# zodb | ||
platformdirs==4.3.6 | ||
# via requests-cache | ||
psycopg2==2.9.10 | ||
# via oc4ids-datastore-pipeline (pyproject.toml) | ||
pycparser==2.22 | ||
# via cffi | ||
python-dateutil==2.9.0.post0 | ||
# via botocore | ||
python-dotenv==1.0.1 | ||
# via oc4ids-datastore-pipeline (pyproject.toml) | ||
pytz==2025.1 | ||
# via flattentool | ||
referencing==0.36.2 | ||
# via | ||
# jsonschema | ||
# jsonschema-specifications | ||
# libcove | ||
# libcoveocds | ||
requests==2.32.3 | ||
# via | ||
# libcove | ||
# libcoveocds | ||
# oc4ids-datastore-pipeline (pyproject.toml) | ||
# ocdsextensionregistry | ||
# requests-cache | ||
requests-cache==1.2.1 | ||
# via ocdsextensionregistry | ||
rfc3339-validator==0.1.4 | ||
# via libcove | ||
rfc3987==1.3.8 | ||
# via libcove | ||
rpds-py==0.22.3 | ||
# via | ||
# jsonschema | ||
# referencing | ||
s3transfer==0.11.2 | ||
# via boto3 | ||
schema==0.7.7 | ||
# via flattentool | ||
six==1.17.0 | ||
# via | ||
# python-dateutil | ||
# rfc3339-validator | ||
# url-normalize | ||
sqlalchemy==2.0.38 | ||
# via | ||
# alembic | ||
# oc4ids-datastore-pipeline (pyproject.toml) | ||
transaction==5.0 | ||
# via zodb | ||
typing-extensions==4.12.2 | ||
# via | ||
# alembic | ||
# referencing | ||
# sqlalchemy | ||
url-normalize==1.4.3 | ||
# via requests-cache | ||
urllib3==2.3.0 | ||
# via | ||
# botocore | ||
# requests | ||
# requests-cache | ||
xmltodict==0.14.2 | ||
# via flattentool | ||
zc-lockfile==3.0.post1 | ||
# via zodb | ||
zc-zlibstorage==1.2.0 | ||
# via flattentool | ||
zconfig==4.2 | ||
# via zodb | ||
zodb==6.0 | ||
# via | ||
# flattentool | ||
# zc-zlibstorage | ||
zodbpickle==4.1.1 | ||
# via zodb | ||
zope-deferredimport==5.0 | ||
# via persistent | ||
zope-interface==7.2 | ||
# via | ||
# btrees | ||
# persistent | ||
# transaction | ||
# zc-zlibstorage | ||
# zodb | ||
# zope-proxy | ||
zope-proxy==6.1 | ||
# via zope-deferredimport | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# setuptools |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.