Skip to content

Commit

Permalink
added requirements.txt and config renovate.json for req.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
janf committed Nov 14, 2023
1 parent 5b69e86 commit c2369cc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,27 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Titiler version
- uses: actions/setup-python@v4
with:
python-version: '3.10'
run: python -m pip install titiler && echo "TITILER_VERSION=$(python -c 'from titiler.application import __version__;print(__version__)')" >> $GITHUB_ENV
#echo "GITHUB_SHA_SHORT=$(python -c 'from src/cogserver')" >> $GITHUB_ENV
#run: python my_script.py
- name: Echo Titiler version
run: echo "za tit versions is {{ env.TITILER_VERSION }}"

# - name: Extract Titiler version
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# run: python -m pip install titiler && echo "TITILER_VERSION=$(python -c 'from titiler.application import __version__;print(__version__)')" >> $GITHUB_ENV
# #echo "GITHUB_SHA_SHORT=$(python -c 'from src/cogserver')" >> $GITHUB_ENV
# #run: python my_script.py
# - name: Echo Titiler version
# run: echo "za tit versions is {{ env.TITILER_VERSION }}"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TITILER_VERSION }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: ${{ github.ref == 'refs/heads/main'}}
tags: ${{ steps.meta.outputs.tags }}
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RUN python3 -m pip install pipenv
WORKDIR /opt/server
RUN export PYTHON_VERSION="$(python3 --version | cut -d ' ' -f 2)" && pipenv --python ${PYTHON_VERSION}
RUN pipenv run pip install -U pip
RUN pipenv run pip install uvicorn titiler asyncpg postgis --no-cache-dir --upgrade
#RUN pipenv run pip install uvicorn titiler asyncpg postgis --no-cache-dir --upgrade
COPY requirements.txt requirements.txt
RUN pipenv run pip install -r requirements.txt
COPY src/cogserver cogserver
ENV HOST=0.0.0.0
ENV PORT=80
Expand Down
7 changes: 6 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
],
"pip_requirements": {
"fileMatch": [
"requirements.txt"
]
}
}
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
titiler==0.15.5
asyncpg==0.29.0
postgis==1.0.4
uvicorn==0.23.2

3 changes: 1 addition & 2 deletions src/cogserver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from cogserver.server import app
from cogserver.server import titiler_version as __version__
from cogserver.server import app

0 comments on commit c2369cc

Please sign in to comment.