Compare commits
No commits in common. "786c9c1671667a47df8c59bcce9b8e64496a5e01" and "52d7f2b3b9b12d7cfdd320fb978cac5a48cde4a8" have entirely different histories.
786c9c1671
...
52d7f2b3b9
23 changed files with 98 additions and 258 deletions
25
.github/dependabot.yml
vendored
25
.github/dependabot.yml
vendored
|
|
@ -16,10 +16,6 @@ updates:
|
||||||
symfony:
|
symfony:
|
||||||
patterns:
|
patterns:
|
||||||
- "symfony/*"
|
- "symfony/*"
|
||||||
ignore:
|
|
||||||
- dependency-name: "*"
|
|
||||||
update-types:
|
|
||||||
- "version-update:semver-major"
|
|
||||||
|
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
|
|
@ -29,10 +25,6 @@ updates:
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
ignore:
|
|
||||||
- dependency-name: "*"
|
|
||||||
update-types:
|
|
||||||
- "version-update:semver-major"
|
|
||||||
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
|
|
@ -42,20 +34,3 @@ updates:
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
open-pull-requests-limit: 5
|
open-pull-requests-limit: 5
|
||||||
ignore:
|
|
||||||
- dependency-name: "*"
|
|
||||||
update-types:
|
|
||||||
- "version-update:semver-major"
|
|
||||||
|
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
|
||||||
directory: "/"
|
|
||||||
commit-message:
|
|
||||||
prefix: "chore"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
open-pull-requests-limit: 10
|
|
||||||
ignore:
|
|
||||||
- dependency-name: "*"
|
|
||||||
update-types:
|
|
||||||
- "version-update:semver-major"
|
|
||||||
|
|
|
||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-push-php:
|
build-push-php:
|
||||||
|
environment: PROD
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -18,6 +19,7 @@ jobs:
|
||||||
IMAGE_REPOSITORY: ${{ vars.IMAGE_REPO }}
|
IMAGE_REPOSITORY: ${{ vars.IMAGE_REPO }}
|
||||||
|
|
||||||
build-push-caddy:
|
build-push-caddy:
|
||||||
|
environment: PROD
|
||||||
# Same Dockerfile as php, with a build target which is after
|
# Same Dockerfile as php, with a build target which is after
|
||||||
needs: [build-push-php]
|
needs: [build-push-php]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
31
.github/workflows/cd.yml
vendored
31
.github/workflows/cd.yml
vendored
|
|
@ -5,7 +5,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- staging
|
tags:
|
||||||
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, reopened, synchronize, labeled ]
|
types: [ opened, reopened, synchronize, labeled ]
|
||||||
workflow_dispatch: ~
|
workflow_dispatch: ~
|
||||||
|
|
@ -17,23 +18,25 @@ permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
remove-deploy-label:
|
# remove-deploy-label:
|
||||||
name: Remove deploy label
|
# name: Remove deploy label
|
||||||
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')
|
# if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
- uses: mondeja/remove-labels-gh-action@v1
|
# - uses: mondeja/remove-labels-gh-action@v1
|
||||||
with:
|
# with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
labels: |
|
# labels: |
|
||||||
deploy
|
# deploy
|
||||||
|
|
||||||
build:
|
build:
|
||||||
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy'))
|
# we run the CD only on pull requests from the same repo
|
||||||
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
||||||
name: Build
|
name: Build
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy'))
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
||||||
name: Deploy
|
name: Deploy
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
uses: ./.github/workflows/deploy.yml
|
uses: ./.github/workflows/deploy.yml
|
||||||
|
|
@ -45,6 +48,6 @@ jobs:
|
||||||
storage-secret-key: ${{ secrets.STORAGE_SECRET_KEY}}
|
storage-secret-key: ${{ secrets.STORAGE_SECRET_KEY}}
|
||||||
project-id: ${{ secrets.PROJECT_ID }}
|
project-id: ${{ secrets.PROJECT_ID }}
|
||||||
workload-identity-provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
|
workload-identity-provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
|
||||||
pg-password: ${{ secrets.PG_PASSWORD }}
|
database-url: ${{ secrets.DATABASE_URL }}
|
||||||
mailer-dsn: ${{ secrets.MAILER_DSN }}
|
mailer-dsn: ${{ secrets.MAILER_DSN }}
|
||||||
sms-dsn: ${{ secrets.SMS_DSN }}
|
sms-dsn: ${{ secrets.SMS_DSN }}
|
||||||
|
|
|
||||||
75
.github/workflows/cleanup.yml
vendored
75
.github/workflows/cleanup.yml
vendored
|
|
@ -1,75 +0,0 @@
|
||||||
name: Cleanup
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [ closed ]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
meta:
|
|
||||||
name: Meta
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
context: ${{ steps.meta.outputs.context }}
|
|
||||||
environment: ${{ steps.meta.outputs.environment }}
|
|
||||||
namespace: ${{ steps.meta.outputs.namespace }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Generate metadata
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
set -xo pipefail
|
|
||||||
PROJECT=plateforme-ebs
|
|
||||||
CONTEXT=nonprod
|
|
||||||
ENVIRONMENT=nonprod
|
|
||||||
|
|
||||||
echo "context=${CONTEXT}" >> $GITHUB_OUTPUT
|
|
||||||
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
|
||||||
echo "namespace=${CONTEXT}-${PROJECT}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
name: Cleanup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: ${{ needs.meta.outputs.environment }}
|
|
||||||
needs: ["meta"]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: GKE Auth
|
|
||||||
uses: 'google-github-actions/auth@v2'
|
|
||||||
with:
|
|
||||||
project_id: '${{ secrets.PROJECT_ID }}'
|
|
||||||
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
|
|
||||||
|
|
||||||
- name: Setup gcloud
|
|
||||||
uses: google-github-actions/setup-gcloud@v1
|
|
||||||
with:
|
|
||||||
project_id: ${{ secrets.PROJECT_ID }}
|
|
||||||
|
|
||||||
- name: Connect cluster
|
|
||||||
run: |
|
|
||||||
gcloud components install gke-gcloud-auth-plugin
|
|
||||||
gcloud auth login --cred-file=$CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE
|
|
||||||
gcloud container clusters get-credentials ${{ vars.CLUSTER_NAME }} --region europe-west1 --project ${{ secrets.PROJECT_ID }}
|
|
||||||
kubectl config view
|
|
||||||
|
|
||||||
- name: Uninstall helm release
|
|
||||||
id: uninstall_helm_release
|
|
||||||
run: |
|
|
||||||
export RELEASE_NAME=pr-$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)
|
|
||||||
echo "Uninstalling release $RELEASE_NAME in namespace ${{ needs.meta.outputs.namespace }}..."
|
|
||||||
if ! helm uninstall $RELEASE_NAME --namespace ${{ needs.meta.outputs.namespace }} --wait ; then
|
|
||||||
echo "HELM Uninstall has failed !"
|
|
||||||
echo "Please ask the SRE team to manually clean remaining objects"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "HELM uninstall successfull"
|
|
||||||
echo "Cleaning remaining PVC..."
|
|
||||||
kubectl delete pvc -l app.kubernetes.io/instance=$RELEASE_NAME --namespace ${{ needs.meta.outputs.namespace }}
|
|
||||||
38
.github/workflows/deploy.yml
vendored
38
.github/workflows/deploy.yml
vendored
|
|
@ -23,9 +23,6 @@ on:
|
||||||
required: true
|
required: true
|
||||||
database-url:
|
database-url:
|
||||||
description: Database URL
|
description: Database URL
|
||||||
required: false
|
|
||||||
pg-password:
|
|
||||||
description: PostgreSQL password for CNPG cluster
|
|
||||||
required: true
|
required: true
|
||||||
mailer-dsn:
|
mailer-dsn:
|
||||||
description: Mailer DSN
|
description: Mailer DSN
|
||||||
|
|
@ -58,32 +55,15 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -xo pipefail
|
set -xo pipefail
|
||||||
PROJECT=${{ vars.PROJECT_NAME }}
|
PROJECT=${{ vars.PROJECT_NAME }}
|
||||||
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
|
||||||
# Tags are deployed in prod
|
# Tags are deployed in prod
|
||||||
CONTEXT=prod
|
CONTEXT=prod
|
||||||
ENVIRONMENT=prod
|
ENVIRONMENT=prod
|
||||||
IMAGE_TAG=${{ github.ref_name }}
|
|
||||||
RELEASE_NAME=prod
|
|
||||||
TRUSTED_HOST=$(echo ${{ vars.DOMAIN }} | sed 's/\./\\\\\\\\./g')
|
|
||||||
URL=${{ vars.DOMAIN }}
|
|
||||||
STORAGE_NAME=${{ vars.PROD_STORAGE_BUCKET }}
|
|
||||||
else
|
|
||||||
CONTEXT=nonprod
|
|
||||||
ENVIRONMENT=nonprod
|
|
||||||
IMAGE_TAG=sha-${GITHUB_SHA::7}
|
|
||||||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
|
||||||
RELEASE_NAME=pr-$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
|
|
||||||
STORAGE_NAME=${{ vars.STORAGE_BUCKET }}-pr
|
|
||||||
else
|
|
||||||
RELEASE_NAME=${{ github.ref_name }}
|
|
||||||
STORAGE_NAME=${{ vars.NONPROD_STORAGE_BUCKET }}-main
|
|
||||||
fi
|
|
||||||
URL=${RELEASE_NAME}.${{ vars.NONPROD_DOMAIN }}
|
|
||||||
TRUSTED_HOST=$(echo ${URL} | sed 's/\./\\\\\\\\./g')
|
|
||||||
fi
|
|
||||||
PHP_IMAGE_REPO=${{ vars.IMAGE_REPO }}/${{ vars.IMAGE_NAME_PHP }}
|
PHP_IMAGE_REPO=${{ vars.IMAGE_REPO }}/${{ vars.IMAGE_NAME_PHP }}
|
||||||
CADDY_IMAGE_REPO=${{ vars.IMAGE_REPO }}/${{ vars.IMAGE_NAME_CADDY }}
|
CADDY_IMAGE_REPO=${{ vars.IMAGE_REPO }}/${{ vars.IMAGE_NAME_CADDY }}
|
||||||
echo "url=${URL}" >> $GITHUB_OUTPUT
|
IMAGE_TAG=sha-${GITHUB_SHA::7}
|
||||||
|
RELEASE_NAME=prod
|
||||||
|
TRUSTED_HOST=$(echo ${{ vars.DOMAIN }} | sed 's/\./\\\\\\\\./g')
|
||||||
|
|
||||||
echo "trusted_host=${TRUSTED_HOST}" >> $GITHUB_OUTPUT
|
echo "trusted_host=${TRUSTED_HOST}" >> $GITHUB_OUTPUT
|
||||||
echo "context=${CONTEXT}" >> $GITHUB_OUTPUT
|
echo "context=${CONTEXT}" >> $GITHUB_OUTPUT
|
||||||
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
||||||
|
|
@ -92,7 +72,6 @@ jobs:
|
||||||
echo "caddy_image_repo=${CADDY_IMAGE_REPO}" >> $GITHUB_OUTPUT
|
echo "caddy_image_repo=${CADDY_IMAGE_REPO}" >> $GITHUB_OUTPUT
|
||||||
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
||||||
echo "namespace=${CONTEXT}-${PROJECT}" >> $GITHUB_OUTPUT
|
echo "namespace=${CONTEXT}-${PROJECT}" >> $GITHUB_OUTPUT
|
||||||
echo "storage_name=${STORAGE_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy
|
name: Deploy
|
||||||
|
|
@ -150,14 +129,15 @@ jobs:
|
||||||
--set=php.image.tag=${{ needs.meta.outputs.image_tag }} \
|
--set=php.image.tag=${{ needs.meta.outputs.image_tag }} \
|
||||||
--set=caddy.image.repository=${{ needs.meta.outputs.caddy_image_repo }} \
|
--set=caddy.image.repository=${{ needs.meta.outputs.caddy_image_repo }} \
|
||||||
--set=caddy.image.tag=${{ needs.meta.outputs.image_tag }} \
|
--set=caddy.image.tag=${{ needs.meta.outputs.image_tag }} \
|
||||||
--set=ingress.hosts[0].host=${{ needs.meta.outputs.url }} \
|
--set=ingress.hosts[0].host=${{ vars.DOMAIN }} \
|
||||||
--set=ingress.tls[0].secretName=${{ needs.meta.outputs.release_name }}-tls \
|
--set=ingress.tls[0].secretName=${{ needs.meta.outputs.release_name }}-tls \
|
||||||
--set=ingress.tls[0].hosts[0]=${{ needs.meta.outputs.url }} \
|
--set=ingress.tls[0].hosts[0]=${{ vars.DOMAIN }} \
|
||||||
|
--set=postgresql.url="${{ secrets.database-url }}" \
|
||||||
|
--set=postgresql.enabled='${{ github.event_name == 'pull_request' }}' \
|
||||||
--set=payum.apikey="${{ secrets.payum-apikey }}" \
|
--set=payum.apikey="${{ secrets.payum-apikey }}" \
|
||||||
--set=cnpg.credentials.password="${{ secrets.pg-password }}" \
|
|
||||||
--set=mailer.dsn="${{ secrets.mailer-dsn }}" \
|
--set=mailer.dsn="${{ secrets.mailer-dsn }}" \
|
||||||
--set=sms.dsn="${{ secrets.sms-dsn }}" \
|
--set=sms.dsn="${{ secrets.sms-dsn }}" \
|
||||||
--set=php.storage.bucket="${{ needs.meta.outputs.storage_name }}" \
|
--set=php.storage.bucket="${{ vars.STORAGE_BUCKET }}" \
|
||||||
--set=php.storage.endpoint="https://storage.googleapis.com" \
|
--set=php.storage.endpoint="https://storage.googleapis.com" \
|
||||||
--set=php.storage.region="eu-west-1" \
|
--set=php.storage.region="eu-west-1" \
|
||||||
--set=php.storage.usePathStyleEndpoint=true \
|
--set=php.storage.usePathStyleEndpoint=true \
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ ARG CADDY_VERSION=2.11.2
|
||||||
FROM node AS yarn_build
|
FROM node AS yarn_build
|
||||||
WORKDIR /usr/app
|
WORKDIR /usr/app
|
||||||
RUN apt-get update && apt-get install tar
|
RUN apt-get update && apt-get install tar
|
||||||
RUN npm install -g yarn
|
|
||||||
RUN mkdir -p /usr/app/vendor/symfony
|
RUN mkdir -p /usr/app/vendor/symfony
|
||||||
RUN curl -L https://github.com/symfony/ux-autocomplete/archive/v2.7.1.tar.gz -o ux-autocomplete.tar.gz
|
RUN curl -L https://github.com/symfony/ux-autocomplete/archive/v2.7.1.tar.gz -o ux-autocomplete.tar.gz
|
||||||
RUN tar -xzvf ux-autocomplete.tar.gz --directory /usr/app/vendor/symfony
|
RUN tar -xzvf ux-autocomplete.tar.gz --directory /usr/app/vendor/symfony
|
||||||
|
|
@ -25,7 +24,7 @@ RUN yarn build
|
||||||
FROM php:${PHP_VERSION}-fpm-alpine AS app_php
|
FROM php:${PHP_VERSION}-fpm-alpine AS app_php
|
||||||
|
|
||||||
# needed for security update until base image is updated
|
# needed for security update until base image is updated
|
||||||
RUN apk upgrade --no-cache libcurl curl openssl openssl-dev libressl libcrypto3 libssl3 nghttp2-libs
|
#RUN apk upgrade libcurl curl openssl openssl-dev libressl libcrypto3 libssl3
|
||||||
|
|
||||||
# Allow to use development versions of Symfony
|
# Allow to use development versions of Symfony
|
||||||
ARG STABILITY="stable"
|
ARG STABILITY="stable"
|
||||||
|
|
@ -197,6 +196,6 @@ COPY --from=app_php /srv/app/public public/
|
||||||
COPY docker/caddy/Caddyfile /etc/caddy/Caddyfile
|
COPY docker/caddy/Caddyfile /etc/caddy/Caddyfile
|
||||||
|
|
||||||
# needed for security update until base image is updated
|
# needed for security update until base image is updated
|
||||||
RUN apk upgrade --no-cache libcurl curl openssl openssl-dev libcrypto3 libssl3 nghttp2-libs
|
#RUN apk upgrade libcurl curl openssl openssl-dev libressl libcrypto1.1 libssl1.1 libcrypto3 libssl3
|
||||||
|
|
||||||
WORKDIR /srv/app
|
WORKDIR /srv/app
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ version: 0.0.1
|
||||||
appVersion: 0.0.1
|
appVersion: 0.0.1
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
# bitnami chart are using the workaround from https://github.com/bitnami/charts/issues/10539
|
||||||
|
- name: postgresql
|
||||||
|
version: ~11.9.13
|
||||||
|
repository: https://charts.bitnami.com/bitnami/
|
||||||
|
condition: postgresql.enabled
|
||||||
- name: external-dns
|
- name: external-dns
|
||||||
version: ~5.4.15
|
version: ~5.4.15
|
||||||
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
{{- if .Values.cnpg.enabled }}
|
|
||||||
IMPORTANT: This chart requires the CloudNativePG operator to be installed in your cluster.
|
|
||||||
helm upgrade --install cnpg --namespace cnpg-system --create-namespace cloudnative-pg/cloudnative-pg
|
|
||||||
See: https://cloudnative-pg.io/documentation/current/installation_upgrade/
|
|
||||||
{{ end }}
|
|
||||||
1. Get the application URL by running these commands:
|
1. Get the application URL by running these commands:
|
||||||
{{- if .Values.ingress.enabled }}
|
{{- if .Values.ingress.enabled }}
|
||||||
{{- range $host := .Values.ingress.hosts }}
|
{{- range $host := .Values.ingress.hosts }}
|
||||||
|
|
|
||||||
|
|
@ -80,13 +80,6 @@ app.kubernetes.io/name: {{ include "plateforme-ebs.name" . }}-pwa
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
|
||||||
CNPG cluster name
|
|
||||||
*/}}
|
|
||||||
{{- define "plateforme-ebs.cnpgClusterName" -}}
|
|
||||||
{{- printf "%s-postgresql" (include "plateforme-ebs" .) }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{{- if .Values.cnpg.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: {{ include "plateforme-ebs.cnpgClusterName" . }}-credentials
|
|
||||||
labels:
|
|
||||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
|
||||||
type: kubernetes.io/basic-auth
|
|
||||||
stringData:
|
|
||||||
username: {{ .Values.cnpg.owner | quote }}
|
|
||||||
password: {{ .Values.cnpg.credentials.password | quote }}
|
|
||||||
---
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: Cluster
|
|
||||||
metadata:
|
|
||||||
name: {{ include "plateforme-ebs.cnpgClusterName" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
instances: {{ .Values.cnpg.instances }}
|
|
||||||
bootstrap:
|
|
||||||
initdb:
|
|
||||||
database: {{ .Values.cnpg.database | quote }}
|
|
||||||
owner: {{ .Values.cnpg.owner | quote }}
|
|
||||||
secret:
|
|
||||||
name: {{ include "plateforme-ebs.cnpgClusterName" . }}-credentials
|
|
||||||
postInitApplicationSQL:
|
|
||||||
- ALTER ROLE {{ .Values.cnpg.owner }} CREATEDB;
|
|
||||||
storage:
|
|
||||||
size: {{ .Values.cnpg.storage.size | quote }}
|
|
||||||
{{- if .Values.cnpg.storage.storageClass }}
|
|
||||||
storageClass: {{ .Values.cnpg.storage.storageClass | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.cnpg.resources }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
@ -6,9 +6,8 @@ metadata:
|
||||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
{{- if .Values.cnpg.enabled }}
|
{{- if .Values.postgresql.enabled }}
|
||||||
database-url: {{ printf "postgresql://%s:%s@%s-rw/%s?serverVersion=%s&charset=utf8" .Values.cnpg.owner .Values.cnpg.credentials.password (include "plateforme-ebs.cnpgClusterName" .) .Values.cnpg.database .Values.cnpg.postgresql.version | b64enc | quote }}
|
database-url: {{ printf "pgsql://%s:%s@%s-postgresql/%s?serverVersion=14&charset=utf8" .Values.postgresql.global.postgresql.auth.username .Values.postgresql.global.postgresql.auth.password .Release.Name .Values.postgresql.global.postgresql.auth.database | b64enc | quote }}
|
||||||
cnpg-password: {{ .Values.cnpg.credentials.password | b64enc | quote }}
|
|
||||||
{{- else }}
|
{{- else }}
|
||||||
database-url: {{ .Values.postgresql.url | b64enc | quote }}
|
database-url: {{ .Values.postgresql.url | b64enc | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
@ -24,5 +23,5 @@ data:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
sms-dsn: {{ .Values.sms.dsn | b64enc | quote }}
|
sms-dsn: {{ .Values.sms.dsn | b64enc | quote }}
|
||||||
payum-apikey: {{ .Values.payum.apikey | b64enc | quote }}
|
payum-apikey: {{ .Values.payum.apikey | b64enc | quote }}
|
||||||
php-storage-key: {{ .Values.php.storage.key | default "" | b64enc | quote }}
|
php-storage-key: {{ .Values.php.storage.key | b64enc | quote }}
|
||||||
php-storage-secret: {{ .Values.php.storage.secret | default "" | b64enc | quote }}
|
php-storage-secret: {{ .Values.php.storage.secret | b64enc | quote }}
|
||||||
|
|
@ -14,9 +14,10 @@ payum:
|
||||||
gateway: 'mollie'
|
gateway: 'mollie'
|
||||||
apikey: 'test'
|
apikey: 'test'
|
||||||
|
|
||||||
cnpg:
|
postgresql:
|
||||||
credentials:
|
auth:
|
||||||
password: change_me
|
# PostgreSQL password is set only the first time chart in installed
|
||||||
|
postgresPassword: change_me
|
||||||
|
|
||||||
maildev:
|
maildev:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,8 @@ redis:
|
||||||
storageClass: "standard"
|
storageClass: "standard"
|
||||||
size: "1Gi"
|
size: "1Gi"
|
||||||
|
|
||||||
cnpg:
|
postgresql:
|
||||||
credentials:
|
url: change_me
|
||||||
password: change_me
|
|
||||||
|
|
||||||
php:
|
php:
|
||||||
fixtureJob:
|
fixtureJob:
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,8 @@ redis:
|
||||||
storageClass: "standard"
|
storageClass: "standard"
|
||||||
size: "1Gi"
|
size: "1Gi"
|
||||||
|
|
||||||
cnpg:
|
postgresql:
|
||||||
credentials:
|
url: change_me
|
||||||
password: change_me
|
|
||||||
|
|
||||||
php:
|
php:
|
||||||
fixtureJob:
|
fixtureJob:
|
||||||
|
|
|
||||||
|
|
@ -69,33 +69,34 @@ mercure:
|
||||||
jwtSecret: "!ChangeThisMercureHubJWTSecretKey!"
|
jwtSecret: "!ChangeThisMercureHubJWTSecretKey!"
|
||||||
extraDirectives: cors_origins http://ghcr.io https://ghcr.io
|
extraDirectives: cors_origins http://ghcr.io https://ghcr.io
|
||||||
|
|
||||||
# CloudNativePG cluster configuration.
|
# Full configuration: https://github.com/bitnami/charts/tree/master/bitnami/postgresql
|
||||||
# The CNPG operator must be pre-installed in the cluster.
|
|
||||||
# See: https://cloudnative-pg.io/documentation/current/installation_upgrade/
|
|
||||||
cnpg:
|
|
||||||
enabled: true
|
|
||||||
instances: 1
|
|
||||||
postgresql:
|
postgresql:
|
||||||
version: "16"
|
enabled: true
|
||||||
database: app
|
# If bringing your own PostgreSQL, the full uri to use
|
||||||
owner: app
|
# url: postgresql://plateforme-ebs:!ChangeMe!@database:5432/api?serverVersion=13&charset=utf8
|
||||||
credentials:
|
global:
|
||||||
# IMPORTANT: use only alphanumeric characters. Special characters (@, #, %, :)
|
postgresql:
|
||||||
# will break the DATABASE_URL parsing by PHP's parse_url().
|
auth:
|
||||||
password: "ChangeMe"
|
username: "example"
|
||||||
storage:
|
password: "!ChangeMe!"
|
||||||
size: 1Gi
|
database: "api"
|
||||||
|
postgresPassword: "!ChangeMe!"
|
||||||
|
# Persistent Volume Storage configuration.
|
||||||
|
# ref: https://kubernetes.io/docs/user-guide/persistent-volumes
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
image:
|
||||||
|
repository: bitnami/postgresql
|
||||||
|
tag: 14
|
||||||
|
primary:
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
storageClass: standard
|
storageClass: standard
|
||||||
|
size: 1Gi
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: 50Mi
|
memory: 50Mi
|
||||||
cpu: 1m
|
cpu: 1m
|
||||||
|
|
||||||
# External PostgreSQL URL, used when cnpg.enabled is false.
|
|
||||||
# url: postgresql://app:!ChangeMe!@database:5432/app?serverVersion=16&charset=utf8
|
|
||||||
postgresql:
|
|
||||||
url: ""
|
|
||||||
|
|
||||||
payum:
|
payum:
|
||||||
# @see https://my.mollie.com/dashboard/org_XXXXXXXX/developers/api-keys
|
# @see https://my.mollie.com/dashboard/org_XXXXXXXX/developers/api-keys
|
||||||
# even it's a fake key it must start with 'test_' or 'live_' and must be at least 30 characters long
|
# even it's a fake key it must start with 'test_' or 'live_' and must be at least 30 characters long
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,8 @@ final class ProductController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('pages/product/show.html.twig', compact('slug', 'id', 'product'));
|
return $this->render('pages/product/show.html.twig', compact('slug', 'id', 'product'));
|
||||||
}
|
} else {
|
||||||
throw new GoneHttpException();
|
throw new GoneHttpException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,10 @@ final class ServiceController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('pages/product/new_service.html.twig', compact('form', 'product'));
|
return $this->render('pages/product/new_service.html.twig', compact('form', 'product'));
|
||||||
}
|
} else {
|
||||||
throw new GoneHttpException();
|
throw new GoneHttpException();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[Route([
|
#[Route([
|
||||||
'en' => MyAccountAction::BASE_URL_EN.'/services/{id}/edit',
|
'en' => MyAccountAction::BASE_URL_EN.'/services/{id}/edit',
|
||||||
|
|
@ -95,7 +96,8 @@ final class ServiceController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('pages/product/edit_service.html.twig', compact('form', 'product'));
|
return $this->render('pages/product/edit_service.html.twig', compact('form', 'product'));
|
||||||
}
|
} else {
|
||||||
throw new GoneHttpException();
|
throw new GoneHttpException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@ final class UserProductsController extends AbstractController
|
||||||
|
|
||||||
if ($this->configurationRepository->getServicesParameter()) {
|
if ($this->configurationRepository->getServicesParameter()) {
|
||||||
return $this->render('pages/account/product/list.html.twig', compact('pagination', 'form'));
|
return $this->render('pages/account/product/list.html.twig', compact('pagination', 'form'));
|
||||||
}
|
} else {
|
||||||
throw new GoneHttpException('there is no services');
|
throw new GoneHttpException('there is no services');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,7 @@ final class PayumManager
|
||||||
'groupOfferId' => (string) $offer->getId(),
|
'groupOfferId' => (string) $offer->getId(),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return [
|
return [
|
||||||
// method must be set as the default value is not retrieved from the gateway configuration
|
// method must be set as the default value is not retrieved from the gateway configuration
|
||||||
'method' => PaymentMethod::CREDITCARD->value,
|
'method' => PaymentMethod::CREDITCARD->value,
|
||||||
|
|
@ -91,6 +90,7 @@ final class PayumManager
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, string> $afterParameters
|
* @param array<string, string> $afterParameters
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ use Doctrine\ORM\QueryBuilder;
|
||||||
use Gedmo\Sortable\Entity\Repository\SortableRepository;
|
use Gedmo\Sortable\Entity\Repository\SortableRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends SortableRepository<MenuItem>
|
|
||||||
*
|
|
||||||
* @method MenuItem|null find($id, $lockMode = null, $lockVersion = null)
|
* @method MenuItem|null find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method MenuItem|null findOneBy(array $criteria, array $orderBy = null)
|
* @method MenuItem|null findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method MenuItem[] findAll()
|
* @method MenuItem[] findAll()
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use App\Repository\GroupRepository;
|
||||||
final class GroupGetStatsProvider implements ProviderInterface
|
final class GroupGetStatsProvider implements ProviderInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly GroupRepository $groupRepository,
|
readonly private GroupRepository $groupRepository,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ use App\Repository\UserRepository;
|
||||||
class GroupsProvider implements ProviderInterface
|
class GroupsProvider implements ProviderInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly GroupRepository $groupRepository,
|
readonly private GroupRepository $groupRepository,
|
||||||
private readonly UserRepository $userRepository,
|
readonly private UserRepository $userRepository,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@ namespace App\Tests\Unit\Notifier;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Notifier\SmsNotifier;
|
use App\Notifier\SmsNotifier;
|
||||||
use Monolog\Test\MonologTestCase;
|
use Monolog\Test\TestCase;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\HttpClient\Response\MockResponse;
|
use Symfony\Component\HttpClient\Response\MockResponse;
|
||||||
use Symfony\Component\Notifier\Exception\TransportException;
|
use Symfony\Component\Notifier\Exception\TransportException;
|
||||||
use Symfony\Component\Notifier\TexterInterface;
|
use Symfony\Component\Notifier\TexterInterface;
|
||||||
|
|
||||||
final class SmsNotifierTest extends MonologTestCase
|
final class SmsNotifierTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testNotify(): void
|
public function testNotify(): void
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue