Compare commits

..

7 Commits
demo ... main

Author SHA1 Message Date
Sosthene
d7907420fe Force build for prd
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 3m4s
Prod - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Prod - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 23:06:57 +02:00
Sosthene
b8935b32ab Merge branch 'preprod'
All checks were successful
Prod - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 17s
Prod - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Prod - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:19:08 +02:00
Sosthene
000ed8b4b6 Merge branch 'staging' into preprod
All checks were successful
Preprod - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 17s
Preprod - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Preprod - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:17:38 +02:00
Sosthene
f4645fc14a Merge branch 'legacy_dev' into staging
All checks were successful
Staging - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 23s
Staging - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Staging - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:16:42 +02:00
Sosthene
7f52b2c5af [fix] Don't overwrite existing rules if admin is not subscribed
All checks were successful
Test - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 1m55s
Test - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 4s
Test - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:14:27 +02:00
Sosthene
473d055777 Merge branch 'staging' into preprod
All checks were successful
Preprod - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 18s
Preprod - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Preprod - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 7s
2025-07-30 16:16:33 +02:00
Sosthene
30e05b353d Merge branch 'legacy_dev' into staging
All checks were successful
Staging - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 18s
Staging - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 4s
Staging - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-07-30 15:41:32 +02:00
4 changed files with 16 additions and 130 deletions

View File

@ -1,114 +0,0 @@
name: Demo - Build & Deploy to Scaleway
on:
push:
branches: [demo]
env:
PROJECT_ID_LECOFFRE: 72d08499-37c2-412b-877e-f8af0471654a
NAMESPACE_ID_LECOFFRE: c992c042-bdb6-4974-becf-aa5039b9ec58
CONTAINER_REGISTRY_ENDPOINT_LECOFFRE: rg.fr-par.scw.cloud/funcscwlecoffredemovts5gdxg
IMAGE_NAME: back
CONTAINER_NAME: back
jobs:
build-and-push-images-lecoffre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Copy SSH
run: cp ~/.ssh/id_rsa id_rsa
- name: Login to Scaleway Container Registry
uses: docker/login-action@v3
with:
username: nologin
password: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
registry: ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}
- name: Build the Back Image
run: docker build . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Push the Back Image to Scaleway Container Registry
run: docker push ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Build the Cron Image
run: docker build -f Dockerfile-Cron . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/cron
- name: Push the Cron Image to Scaleway Container Registry
run: docker push ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/cron
deploy-back-lecoffre:
needs: build-and-push-images-lecoffre
runs-on: ubuntu-latest
environment: demo
steps:
- name: Install CLI
uses: scaleway/action-scw@v0
- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container container list namespace-id=${{ env.NAMESPACE_ID_LECOFFRE }} -o json | jq -r '.[] | select(.name == "${{ env.CONTAINER_NAME }}") | .id')" >> $GITHUB_ENV
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}
- name: Deploy the container based on the new image
run: |
env_string=""
while IFS= read -r line; do
if [[ "$line" == *"="* ]]; then
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2-)
if [[ -n "$key" ]]; then
env_string+="environment-variables.$key=$value "
fi
fi
done <<< "$ENV_VARS"
env_string=$(echo $env_string | sed 's/ $//')
scw container container update ${{ env.CONTAINER_ID }} $env_string
env:
ENV_VARS: ${{ secrets.ENV }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}
deploy-cron-lecoffre:
needs: build-and-push-images-lecoffre
runs-on: ubuntu-latest
environment: demo
steps:
- name: Install CLI
uses: scaleway/action-scw@v0
- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container container list namespace-id=${{env.NAMESPACE_ID_LECOFFRE}} -o json | jq -r '.[] | select(.name == "cron") | .id')" >> $GITHUB_ENV
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}
- name: Deploy the container based on the new image
run: |
env_string=""
while IFS= read -r line; do
if [[ "$line" == *"="* ]]; then
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2-)
if [[ -n "$key" ]]; then
env_string+="environment-variables.$key=$value "
fi
fi
done <<< "$ENV_VARS"
env_string=$(echo $env_string | sed 's/ $//')
scw container container update ${{ env.CONTAINER_ID }} $env_string
env:
ENV_VARS: ${{ secrets.ENV }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_LECOFFRE }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
SCW_DEFAULT_PROJECT_ID: ${{ env.PROJECT_ID_LECOFFRE }}
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID_LECOFFRE }}

View File

@ -35,7 +35,7 @@ jobs:
password: ${{ secrets.SCW_SECRET_KEY_LECOFFRE }}
registry: ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}
- name: Build the Back Image
run: docker build . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
run: docker build --no-cache . -t ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Push the Back Image to Scaleway Container Registry
run: docker push ${{ env.CONTAINER_REGISTRY_ENDPOINT_LECOFFRE }}/${{ env.IMAGE_NAME }}
- name: Build the Cron Image

View File

@ -112,7 +112,9 @@ export default class UserController extends ApiController {
});
if (!manageSubscriptionRules[0]) return;
payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
// Merge subscription rules with existing rules instead of replacing them
const subscriptionRules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
payload.rules = [...new Set([...payload.rules, ...subscriptionRules])];
isSubscribed = true;
}
@ -173,7 +175,9 @@ export default class UserController extends ApiController {
});
if (!manageSubscriptionRules[0]) return;
newUserPayload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
// Merge subscription rules with existing rules instead of replacing them
const subscriptionRules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
newUserPayload.rules = [...new Set([...newUserPayload.rules, ...subscriptionRules])];
isSubscribed = true;
}

View File

@ -163,14 +163,11 @@ export default class OfficeFoldersController extends ApiController {
const officeFolderFound: any = await this.officeFoldersService.getByUid(uid, query);
console.log(officeFolderFound);
if (!officeFolderFound) {
this.httpNotFoundRequest(response, "Office folder not found");
return;
}
if (officeFolderFound.folder_anchor) {
const officeFolderAnchorFound = OfficeFolderAnchor.hydrate<OfficeFolderAnchor>(officeFolderFound.folder_anchor, {
strategy: "excludeAll",
});
@ -182,7 +179,6 @@ export default class OfficeFoldersController extends ApiController {
});
return;
}
}
const officeFolder = OfficeFolder.hydrate<OfficeFolder>(officeFolderFound, { strategy: "excludeAll" });