-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from chgl/add-ci
added fhir-server and GH actions
- Loading branch information
Showing
24 changed files
with
867 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,3 @@ | ||
helm-extra-args: --timeout 600 | ||
check-version-increment: true | ||
debug: true |
This file contains 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,29 @@ | ||
name: Lint and Test Charts | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "charts/**" | ||
|
||
jobs: | ||
lint-chart: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint |
This file contains 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,25 @@ | ||
name: Release Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- "charts/**" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains 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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains 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,20 @@ | ||
apiVersion: v2 | ||
name: fhir-server | ||
description: A Helm chart for deploying the Microsoft FHIR Server for Azure | ||
maintainers: | ||
- name: chgl | ||
url: https://github.com/chgl | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
version: 0.4.0 |
This file contains 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,21 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fhir-server.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "fhir-server.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "fhir-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fhir-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 | ||
{{- end }} |
This file contains 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,71 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "fhir-server.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "fhir-server.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "fhir-server.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "fhir-server.labels" -}} | ||
helm.sh/chart: {{ include "fhir-server.chart" . }} | ||
{{ include "fhir-server.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "fhir-server.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "fhir-server.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels for MSSQL | ||
*/}} | ||
{{- define "fhir-server-mssql.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "fhir-server.name" . }}-mssql | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "fhir-server.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "fhir-server.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains 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,12 @@ | ||
{{- if .Values.podIdentity.enabled -}} | ||
apiVersion: "aadpodidentity.k8s.io/v1" | ||
kind: AzureIdentity | ||
metadata: | ||
name: {{ include "fhir-server.fullname" . }} | ||
labels: | ||
{{- include "fhir-server.labels" . | nindent 4 }} | ||
spec: | ||
type: 0 | ||
resourceID: {{ .Values.podIdentity.identityResourceId }} | ||
clientID: {{ .Values.podIdentity.identityClientId }} | ||
{{- end }} |
This file contains 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,9 @@ | ||
{{- if .Values.podIdentity.enabled -}} | ||
apiVersion: "aadpodidentity.k8s.io/v1" | ||
kind: AzureIdentityBinding | ||
metadata: | ||
name: {{ include "fhir-server.fullname" . }}-binding | ||
spec: | ||
azureIdentity: {{ include "fhir-server.fullname" . }} | ||
selector: {{ include "fhir-server.fullname" . }} | ||
{{- end }} |
This file contains 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,14 @@ | ||
{{- if eq .Values.database.dataStore "SqlServer" }} | ||
{{- $fullName := include "fhir-server.fullname" . -}} | ||
apiVersion: azure.microsoft.com/v1beta1 | ||
kind: AzureSqlDatabase | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "fhir-server.labels" . | nindent 4 }} | ||
spec: | ||
location: {{ .Values.database.location }} | ||
resourceGroup: {{ .Values.database.resourceGroup }} | ||
edition: {{ .Values.database.sql.edition }} | ||
server: {{ $fullName }} | ||
{{- end }} |
This file contains 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 @@ | ||
{{- if eq .Values.database.dataStore "SqlServer" }} | ||
{{- $fullName := include "fhir-server.fullname" . -}} | ||
apiVersion: azure.microsoft.com/v1beta1 | ||
kind: AzureSqlFirewallRule | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "fhir-server.labels" . | nindent 4 }} | ||
spec: | ||
resourceGroup: {{ .Values.database.resourceGroup }} | ||
server: {{ $fullName }} | ||
|
||
# this IP range enables Azure Service access | ||
startIpAddress: 0.0.0.0 | ||
endIpAddress: 0.0.0.0 | ||
{{- end }} |
This file contains 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,12 @@ | ||
{{- if eq .Values.database.dataStore "SqlServer" }} | ||
{{- $fullName := include "fhir-server.fullname" . -}} | ||
apiVersion: azure.microsoft.com/v1beta1 | ||
kind: AzureSqlServer | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "fhir-server.labels" . | nindent 4 }} | ||
spec: | ||
location: {{ .Values.database.location }} | ||
resourceGroup: {{ .Values.database.resourceGroup }} | ||
{{- end }} |
This file contains 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,14 @@ | ||
{{- if eq .Values.database.dataStore "CosmosDb" }} | ||
{{- $fullName := include "fhir-server.fullname" . -}} | ||
apiVersion: azure.microsoft.com/v1alpha1 | ||
kind: CosmosDB | ||
metadata: | ||
name: {{ $fullName }} | ||
labels: | ||
{{- include "fhir-server.labels" . | nindent 4 }} | ||
spec: | ||
location: {{ .Values.database.location }} | ||
resourceGroup: {{ .Values.database.resourceGroup }} | ||
properties: | ||
databaseAccountOfferType: Standard | ||
{{- end }} |
Oops, something went wrong.