diff options
| author | Robert Günzler <r@gnzler.io> | 2020-06-29 00:09:20 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-06-29 00:09:20 +0200 |
| commit | 0a0af4488fc96e5ba9919aeba2c704e9bdb380d8 (patch) | |
| tree | d2b20d88335c6a6e3ca81cfaf50819d322c65d87 /.config | |
| parent | d1751acaaa8543d0d9cc48ab99ee893e5d87f042 (diff) | |
yamlfs: update balena, helm and meson templates
Diffstat (limited to '.config')
| -rw-r--r-- | .config/yamlfs/balena.yml | 18 | ||||
| -rw-r--r-- | .config/yamlfs/helm.yml | 27 | ||||
| -rw-r--r-- | .config/yamlfs/meson.yml | 65 |
3 files changed, 65 insertions, 45 deletions
diff --git a/.config/yamlfs/balena.yml b/.config/yamlfs/balena.yml index b31766f..73c39a8 100644 --- a/.config/yamlfs/balena.yml +++ b/.config/yamlfs/balena.yml @@ -2,17 +2,19 @@ docker-compose.yml: |- version: '2.1' services: - build: ./container + build: . volumes: ctr-data: -container: - Dockerfile.template: |- - # vim: ft=dockerfile - FROM balenalib/%%BALENA_MACHINE_NAME%%-alpine:run +Dockerfile.template: |- + # vim: ft=dockerfile + FROM balenalib/%%BALENA_MACHINE_NAME%%-alpine:run - # RUN apk add --no-cache + COPY ./start.sh /usr/local/bin/ + CMD [ "start.sh" ] - # COPY ./start.sh /usr/local/bin/ - # CMD [ "start.sh" ] +start.sh: |- + #!/bin/sh + set -e + while true; do echo "nothing" && sleep 20s; done diff --git a/.config/yamlfs/helm.yml b/.config/yamlfs/helm.yml index 67d9995..26a3ac9 100644 --- a/.config/yamlfs/helm.yml +++ b/.config/yamlfs/helm.yml @@ -81,10 +81,11 @@ values.yaml: |- additionalArgs: [] - # service: + service: + annotations: # port: 8080 -{%- if .configmap %} +{% if .configmap %} # configmap: # config: |- # # TODO @@ -98,7 +99,7 @@ values.yaml: |- prometheus: enabled: false -{%- if .ingress %} +{% if .ingress %} ingress: enabled: false # annotations: @@ -109,7 +110,7 @@ values.yaml: |- # tls: {%- end %} -{%- if .pvc %} +{% if .pvc %} ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## @@ -188,7 +189,7 @@ templates: apiVersion: apps/v1 kind: Deployment metadata: - name: {{ template "{% .name %}.name" }} + name: {{ template "{% .name %}.name" . }} labels: app.kubernetes.io/name: {{ template "{% .name %}.name" . }} app: {{ template "{% .name %}.name" . }} @@ -227,8 +228,8 @@ templates: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} args: - {{- if .Values.additionalArgs }} - {{- .Values.additionalArgs | toYaml | indent 10 }} + {{- range .Values.additionalArgs }} + - {{ . | quote }} {{- end }} ports: - name: http @@ -275,7 +276,7 @@ templates: apiVersion: v1 kind: Service metadata: - name: {{ template "{% .name %}.name" }} + name: {{ template "{% .name %}.name" . }} labels: app.kubernetes.io/name: {{ template "{% .name %}.name" . }} app: {{ template "{% .name %}.name" . }} @@ -310,7 +311,7 @@ templates: {{- end }} kind: Ingress metadata: - name: {{ template "{% .name %}.name" }} + name: {{ template "{% .name %}.name" . }} labels: app.kubernetes.io/name: {{ template "{% .name %}.name" . }} app: {{ template "{% .name %}.name" . }} @@ -349,7 +350,7 @@ templates: kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "{% .name %}.name" }} + name: {{ template "{% .name %}.name" . }} labels: app.kubernetes.io/name: {{ template "{% .name %}.name" . }} app: {{ template "{% .name %}.name" . }} @@ -358,7 +359,9 @@ templates: heritage: {{ .Release.Service }} spec: accessModes: - {{- toYaml .Values.persistence.accessModes | indent 4 }} + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} {{- if .Values.persistence.storageClass }} {{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" @@ -380,7 +383,7 @@ templates: apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "{% .name %}.name" }} + name: {{ template "{% .name %}.name" . }} labels: app.kubernetes.io/name: {{ template "{% .name %}.name" . }} app: {{ template "{% .name %}.name" . }} diff --git a/.config/yamlfs/meson.yml b/.config/yamlfs/meson.yml index 378afb1..a7bdc82 100644 --- a/.config/yamlfs/meson.yml +++ b/.config/yamlfs/meson.yml @@ -5,14 +5,19 @@ meson.build: |- version: '0.0.0+unknown', license: 'MIT', default_options: [ - 'c_std=c99' \ - 'warning_level=2' \ - 'werror=true' \ + 'c_std=c99', + 'warning_level=2', + 'werror=true', ], + {% if .docker %} + meson_version: '>= 0.37', + {% else %} + meson_version: '>= 0.46', + {% end %} ) cc = meson.get_compiler('c') - add_project_arguments(cc.get_supported_arguments([ + add_project_arguments({% if not .docker %}cc.get_supported_arguments({% end %}[ '-D_POSIX_C_SOURCE=200809L', '-Wundef', @@ -24,7 +29,9 @@ meson.build: |- '-Wfloat-equal', '-Wstrict-prototypes', '-Wredundant-decls', + {% if not .docker %} '-Wimplicit-fallthrough=2', + {% end %} '-Wendif-labels', '-Wstrict-aliasing=2', '-Woverflow', @@ -33,7 +40,26 @@ meson.build: |- '-Wno-missing-braces', '-Wno-missing-field-initializers', '-Wno-unused-parameter', - ]), language: 'c') + ]{% if not .docker %}){% end %}, language: 'c') + + version = '"@0@ (" __DATE__ ")"'.format(meson.project_version()) + # embed version sourced from git ref + git = find_program('git', native: true, required: false) + if git.found() + git_commit_hash = run_command([ + git, 'describe', '--always', '--tags' + ]) + git_branch = run_command([ + git, 'rev-parse', '--abbrev-ref', 'HEAD' + ]) + if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0 + version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format( + git_commit_hash.stdout().strip(), + git_branch.stdout().strip(), + ) + endif + endif + add_project_arguments('-DVERSION=@0@'.format(version), language: 'c') executable( meson.project_name(), @@ -78,25 +104,6 @@ meson.build: |- endif {%- end %} - version = '"@0@ (" __DATE__ ")"'.format(meson.project_version()) - # embed version sourced from git ref - git = find_program('git', native: true, required: false) - if git.found() - git_commit_hash = run_command([ - git, 'describe', '--always', '--tags' - ]) - git_branch = run_command([ - git, 'rev-parse', '--abbrev-ref', 'HEAD' - ]) - if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0 - version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format( - git_commit_hash.stdout().strip(), - git_branch.stdout().strip(), - ) - endif - endif - add_project_arguments('-DVERSION=@0@'.format(version), language: 'c') - src: main.c: |- #define _POSIX_C_SOURCE 200809L @@ -118,7 +125,7 @@ src: } include: - {% .name | lower %}: |- + {% .name | lower %}.h: |- #ifndef {% .name | upper %}_H #define {% .name | upper %}_H @@ -130,6 +137,9 @@ include: #endif +.gitignore: |- + build/ + .editorconfig: |- ; http://editorconfig.org/ @@ -157,3 +167,8 @@ README.md: |- # {% .name %} TODO + +{% if .docker %} +Dockerfile: |- + +{% end %} |