Skip to content

Commit

Permalink
Add user import container
Browse files Browse the repository at this point in the history
  • Loading branch information
berrydenhartog committed Jan 17, 2025
1 parent 7b42c76 commit 39794ad
Show file tree
Hide file tree
Showing 6 changed files with 520 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ trim_trailing_whitespace = true
insert_final_newline = false

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false

[*.yaml, *.yml]
indent_size = 2
60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish Docker image

on:
push:
branches:
- main

env:
IMAGE_NAME: 'opendesk-user-import'

jobs:
push_to_registries:
name: Push Docker image to github registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4

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

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

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ env.IMAGE_NAME }}
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Build and push Docker images
id: push
uses: docker/build-push-action@v6
with:
context: container/user-import
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: linux/amd64

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
10 changes: 10 additions & 0 deletions container/user-import/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.13

WORKDIR /app

COPY ./src/ /app/
COPY ./requirements.txt /app/

RUN pip install --no-cache-dir -r /app/requirements.txt

CMD [ "/app/userimport.py"]
3 changes: 3 additions & 0 deletions container/user-import/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requests
pandas
python-keycloak
Loading

0 comments on commit 39794ad

Please sign in to comment.