Skip to content
Snippets Groups Projects
Commit 24016050 authored by František Dvořák's avatar František Dvořák
Browse files

Inject information about deployment into REST API JWT wrapper

parent a88125f2
No related branches found
No related tags found
No related merge requests found
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
......@@ -22,6 +22,19 @@
debug:
msg: "{{ item.key }} = {{ item.value }}"
loop: "{{ secrets | dict2items }}"
- name: Get Deployment Version From Git
command:
cmd: "git describe --tags"
delegate_to: 127.0.0.1
ignore_errors: true
register: git_describe
when: true
- name: Set Deployment Version as Fact
set_fact:
deployment_version: "{{ git_describe.stdout | default('0.0.0', true) }}"
- name: Debug Deployment Version
debug:
msg: "Deployment version: {{ deployment_version }}"
- name: Copy config file to master
vars:
name: "{{ item | basename | splitext | first }}"
......@@ -102,8 +115,13 @@
- "../deployments/*.yaml"
- name: Copy JWT wrapper for JupyterHub API
copy:
src: files/jupyterhub-jwt.yaml
vars:
versions:
deployment:
version: "{{ deployment_version }}"
instance: "{{ site_name | upper }}"
template:
src: jupyterhub-jwt.yaml
dest: /tmp/jupyterhub-jwt.yaml
mode: 0644
- name: Configure JWT wrapper for JupyterHub API
......
---
apiVersion: v1
kind: ConfigMap
metadata:
name: deployment-versions
labels:
app: jwt
data:
versions.json: |
{{ versions | to_nice_json | indent(width=4) }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
......@@ -34,6 +44,13 @@ spec:
- name: http
containerPort: 8000
protocol: TCP
volumeMounts:
- name: deployment-versions
mountPath: /VERSIONS
volumes:
- name: deployment-versions
configMap:
name: deployment-versions
---
apiVersion: v1
kind: Service
......
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
../../../common/playbooks/templates/jupyterhub-jwt.yaml
\ No newline at end of file
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
../../../common/playbooks/templates/jupyterhub-jwt.yaml
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment