diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 32dc0a8..c9cc28d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -26,10 +26,8 @@ RUN groupadd --gid $USER_GID $USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME \ && sudo chsh -s /bin/bash vscode -COPY --chown=vscode:vscode ../. /app -RUN chown vscode:vscode -R /app /var/log/apache2 +RUN chown vscode:vscode -R /var/log/apache2 RUN echo "xdebug.mode=off" | tee '/usr/local/etc/php/conf.d/xdebug.ini' WORKDIR /app -USER root diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4731ab8..0d14213 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -37,7 +37,7 @@ ] } }, - "forwardPorts": [80, 3306], + "forwardPorts": [ 80, 8000 ], "remoteUser": "vscode", "secrets": { @@ -46,5 +46,6 @@ "documentationUrl": "https://packagist.com/orgs/linkorb" } }, - "postCreateCommand": ".devcontainer/postCreate.sh" + "postCreateCommand": ".devcontainer/postCreate.sh", + "postStartCommand": ".devcontainer/postStart.sh" } diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index ae59bf3..689bcba 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash # Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. +# Workaround for recent Python versions which prevent global pip package installation without an explicit flag +# or removal of a certain file. +sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED || true + git config commit.template .devcontainer/git/linkorb_commit.template cp .devcontainer/git/hooks/pre-push .git/hooks/pre-push @@ -10,3 +14,4 @@ composer config --global --auth http-basic.repo.packagist.com "$GITHUB_USER" "$P composer install + diff --git a/.devcontainer/postStart.sh b/.devcontainer/postStart.sh new file mode 100755 index 0000000..8fa1418 --- /dev/null +++ b/.devcontainer/postStart.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. + diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml deleted file mode 100644 index 278934e..0000000 --- a/helm-chart/Chart.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -apiVersion: v2 -name: blazon -description: blazon -type: application -# This is the chart version. This version number should be incremented each time you make changes -version: 'chartversionplaceholder' -appVersion: "latest" diff --git a/helm-chart/templates/NOTES.txt b/helm-chart/templates/NOTES.txt deleted file mode 100644 index 565ab82..0000000 --- a/helm-chart/templates/NOTES.txt +++ /dev/null @@ -1,23 +0,0 @@ -Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -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 }}{{ .path }} - {{- 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 "blazon.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 "blazon.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "blazon.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 "blazon.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/helm-chart/templates/_helpers.tpl b/helm-chart/templates/_helpers.tpl deleted file mode 100644 index 51e7ba4..0000000 --- a/helm-chart/templates/_helpers.tpl +++ /dev/null @@ -1,65 +0,0 @@ -{{/* -Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -*/}} -{{/* -Expand the name of the chart. -*/}} -{{- define "blazon.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 "blazon.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 "blazon.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "blazon.labels" -}} -helm.sh/chart: {{ include "blazon.chart" . }} -{{ include "blazon.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "blazon.selectorLabels" -}} -app.kubernetes.io/name: {{ include "blazon.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "blazon.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "blazon.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/helm-chart/templates/deployment.yaml b/helm-chart/templates/deployment.yaml deleted file mode 100644 index 28df2d1..0000000 --- a/helm-chart/templates/deployment.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "blazon.fullname" . }} - labels: - {{- include "blazon.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - strategy: - rollingUpdate: - maxSurge: 100% - maxUnavailable: 75% - selector: - matchLabels: - {{- include "blazon.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "blazon.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "blazon.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - volumeMounts: - - name: envvars - readOnly: false - mountPath: /app/.env.local - subPath: ".env.local" - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumes: - - name: envvars - configMap: - name: envvars - items: - - key: .env.local - path: .env.local - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/helm-chart/templates/hpa.yaml b/helm-chart/templates/hpa.yaml deleted file mode 100644 index c7793fe..0000000 --- a/helm-chart/templates/hpa.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "blazon.fullname" . }} - labels: - {{- include "blazon.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "blazon.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml deleted file mode 100644 index 48604a0..0000000 --- a/helm-chart/templates/ingress.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "blazon.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "blazon.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/helm-chart/templates/service.yaml b/helm-chart/templates/service.yaml deleted file mode 100644 index 5b6b79f..0000000 --- a/helm-chart/templates/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -apiVersion: v1 -kind: Service -metadata: - name: {{ include "blazon.fullname" . }} - labels: - {{- include "blazon.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "blazon.selectorLabels" . | nindent 4 }} diff --git a/helm-chart/templates/serviceaccount.yaml b/helm-chart/templates/serviceaccount.yaml deleted file mode 100644 index c6c9285..0000000 --- a/helm-chart/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "blazon.serviceAccountName" . }} - labels: - {{- include "blazon.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/repo.yaml b/repo.yaml index 4b0fdd0..7977a32 100644 --- a/repo.yaml +++ b/repo.yaml @@ -6,7 +6,7 @@ description: "Publish fast and beautiful websites, campaign sites, documentation license: mit license_year: 2021 name: blazon -type: application +type: php-cli visibility: public github: default_branch: master