Skip to content

Commit

Permalink
fix: file.p12 needs to be inside k8s env
Browse files Browse the repository at this point in the history
  • Loading branch information
igobranco committed Jan 7, 2025
1 parent 387815f commit e151abc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if PRINT_COURSE_CERTIFICATES_CERTIFICATE_P12_PATH %}
- name: print-course-certificates-digital-signature-file-p12
files:
- {{ PRINT_COURSE_CERTIFICATES_CERTIFICATE_P12_PATH }}
- plugins/print-course-certificates/apps/file.p12
options:
labels:
app.kubernetes.io/name: print-course-certificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ restart: unless-stopped
volumes:
- ../../env/plugins/print-course-certificates/apps/config.yml:/app/config.yml:ro
{% if PRINT_COURSE_CERTIFICATES_CERTIFICATE_P12_PATH %}
- {{ PRINT_COURSE_CERTIFICATES_CERTIFICATE_P12_PATH }}:/app/digital_signature/file.p12:ro
- ../../env/plugins/print-course-certificates/apps/file.p12:/app/digital_signature/file.p12:ro
{% endif %}
healthcheck:
test: ["CMD", "echo", "''", ">", "/dev/tcp/127.0.0.1/5000", "||", "exit", "1"]
Expand Down
10 changes: 8 additions & 2 deletions tutorprint_course_certificates/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import os
from glob import glob

import click
import shutil
import importlib_resources
from tutor import hooks
from tutor import hooks, config as tutor_config

from .__about__ import __version__

Expand Down Expand Up @@ -262,3 +262,9 @@

# This would allow you to run:
# $ tutor print-course-certificates example-command

@hooks.Actions.PLUGINS_LOADED.add()
def _copy_file_p12() -> None:
config = tutor_config.get_user(os.environ["TUTOR_ROOT"])
p12_path = config.get("PRINT_COURSE_CERTIFICATES_CERTIFICATE_P12_PATH")
shutil.copyfile(p12_path, "env/plugins/print-course-certificates/apps/file.p12")

0 comments on commit e151abc

Please sign in to comment.