Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 573e4a0cb4 | |||
| ba4aac2d8b | |||
| 3ea5df52fe |
@@ -1,148 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- release/*
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- "tdrive/backend/node/**"
|
|
||||||
- "tdrive/frontend/**"
|
|
||||||
- "tdrive/connectors/onlyoffice-connector/**"
|
|
||||||
- "tdrive/backend/utils/ldap-sync/**"
|
|
||||||
- "tdrive/backend/utils/nextcloud-migration/**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
name: Setup jobs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
changes: ${{ steps.filter.outputs.changes }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: dorny/paths-filter@v3
|
|
||||||
id: filter
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
backend:
|
|
||||||
- "tdrive/backend/node/**"
|
|
||||||
frontend:
|
|
||||||
- "tdrive/frontend/**"
|
|
||||||
onlyoffice-connector:
|
|
||||||
- "tdrive/connectors/onlyoffice-connector/**"
|
|
||||||
ldap-sync:
|
|
||||||
- "tdrive/backend/utils/ldap-sync/**"
|
|
||||||
nextcloud-migration:
|
|
||||||
- "tdrive/backend/utils/nextcloud-migration/**"
|
|
||||||
|
|
||||||
lint-backend:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: contains(needs.setup.outputs.changes, 'backend')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Prettier code style check
|
|
||||||
run: |
|
|
||||||
cd tdrive
|
|
||||||
docker compose -f docker-compose.tests.yml run -e NODE_OPTIONS=--unhandled-rejections=warn node npm run lint:prettier
|
|
||||||
- name: Lint
|
|
||||||
run: |
|
|
||||||
cd tdrive
|
|
||||||
docker compose -f docker-compose.tests.yml run -e NODE_OPTIONS=--unhandled-rejections=warn node npm run lint
|
|
||||||
|
|
||||||
test-backend:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: contains(needs.setup.outputs.changes, 'backend')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: e2e-mongo-s3-test
|
|
||||||
run: |
|
|
||||||
cd tdrive
|
|
||||||
docker compose -f docker-compose.tests.yml run --rm -e NODE_OPTIONS=--unhandled-rejections=warn node npm run test:all
|
|
||||||
docker compose -f docker-compose.tests.yml down
|
|
||||||
- name: e2e-opensearch-test
|
|
||||||
run: |
|
|
||||||
cd tdrive
|
|
||||||
docker compose -f docker-compose.dev.tests.opensearch.yml up -d --force-recreate opensearch-node1 postgres node av
|
|
||||||
sleep 60
|
|
||||||
docker compose -f docker-compose.dev.tests.opensearch.yml logs
|
|
||||||
docker compose -f docker-compose.dev.tests.opensearch.yml run -e NODE_OPTIONS=--unhandled-rejections=warn -e SEARCH_DRIVER=opensearch -e DB_DRIVER=postgres -e PUBSUB_TYPE=local node npm run test:all
|
|
||||||
docker compose -f docker-compose.dev.tests.opensearch.yml down
|
|
||||||
|
|
||||||
build-frontend:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: contains(needs.setup.outputs.changes, 'frontend')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
env:
|
|
||||||
FRONTEND_ENV: ${{ secrets.FRONTEND_ENV }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
- run: cd tdrive/frontend/ && yarn install
|
|
||||||
- run: cp tdrive/frontend/src/app/environment/environment.ts.dist tdrive/frontend/src/app/environment/environment.ts
|
|
||||||
- if: ${{ env.FRONTEND_ENV }}
|
|
||||||
run: echo ${{ secrets.FRONTEND_ENV }} > tdrive/frontend/src/app/environment/environment.ts
|
|
||||||
- run: cd tdrive/frontend/ && yarn test
|
|
||||||
- run: cd tdrive/frontend/ && yarn build
|
|
||||||
- name: Upload frontend build artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: frontend-build
|
|
||||||
path: tdrive/frontend/build/
|
|
||||||
|
|
||||||
build-onlyoffice-connector:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: contains(needs.setup.outputs.changes, 'onlyoffice-connector')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
|
|
||||||
- name: Install dependencies and build
|
|
||||||
run: |
|
|
||||||
cd tdrive/connectors/onlyoffice-connector
|
|
||||||
npm i
|
|
||||||
npm run build --if-present
|
|
||||||
npm run lint
|
|
||||||
|
|
||||||
build-ldap-sync:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
if: contains(needs.setup.outputs.changes, 'ldap-sync')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build ldap sync
|
|
||||||
run: cd tdrive/backend/utils/ldap-sync && npm i && npm run build
|
|
||||||
|
|
||||||
build-nextcloud-migration:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
if: contains(needs.setup.outputs.changes, 'nextcloud-migration')
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Build Nextcloud migration
|
|
||||||
run: cd tdrive/backend/utils/nextcloud-migration && npm i && npm run build
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
name: docker-build
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- "tdrive/docker/**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-frontend:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: cd tdrive && docker build -t tdrive/tdrive-frontend -f docker/tdrive-frontend/Dockerfile .
|
|
||||||
|
|
||||||
build-node:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: cd tdrive && docker build --target production -t docker-registry.linagora.com/tdrive/tdrive-node -f docker/tdrive-node/Dockerfile .
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
name: Documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Use Node.js 16
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
- run: npm install -g yarn
|
|
||||||
- run: cd Documentation && yarn install --frozen-lockfile
|
|
||||||
- name: Build
|
|
||||||
run: cd Documentation && yarn docs:build
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: Documentation/docs/.vitepress/dist
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
name: Publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "*.*.*"
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
targets:
|
|
||||||
- backend
|
|
||||||
- frontend
|
|
||||||
- onlyoffice-connector
|
|
||||||
- ldap-sync
|
|
||||||
- nextcloud-migration
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
version: v0.19.0
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Login to Linagora Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: docker-registry.linagora.com
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/bake-action@v6
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
./docker-bake.hcl
|
|
||||||
cwd://${{ steps.meta.outputs.bake-file-annotations }}
|
|
||||||
cwd://${{ steps.meta.outputs.bake-file }}
|
|
||||||
push: true
|
|
||||||
targets: ${{ matrix.targets }}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
name: Publish Feature Branch
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- feature-**
|
|
||||||
- release/*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-feature:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
targets:
|
|
||||||
- backend
|
|
||||||
- frontend
|
|
||||||
- onlyoffice-connector
|
|
||||||
- ldap-sync
|
|
||||||
- nextcloud-migration
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
version: v0.19.0
|
|
||||||
|
|
||||||
- name: Echo
|
|
||||||
run: echo Publish images with tag ${{ github.head_ref || github.ref_name }}
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
tags: |
|
|
||||||
${{ github.head_ref || github.ref_name }}
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Login to Linagora Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: docker-registry.linagora.com
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/bake-action@v6
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
./docker-bake.hcl
|
|
||||||
cwd://${{ steps.meta.outputs.bake-file-annotations }}
|
|
||||||
cwd://${{ steps.meta.outputs.bake-file }}
|
|
||||||
push: true
|
|
||||||
targets: ${{ matrix.targets }}
|
|
||||||
@@ -214,8 +214,16 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
|
|||||||
|
|
||||||
await gr.services.companies.setUserRole(company.id, user.id, userRole);
|
await gr.services.companies.setUserRole(company.id, user.id, userRole);
|
||||||
|
|
||||||
await gr.services.users.save(user, { user: { id: user.id, server_request: true } });
|
// [Workavia] Removed an upstream `users.save(user, ...)` here that
|
||||||
|
// overwrote the user record after setUserRole (line above) had
|
||||||
|
// already fetched a fresh user, pushed the new companyId into
|
||||||
|
// user.cache.companies, and saved. Saving the stale local `user`
|
||||||
|
// object on top wiped cache.companies → the OpenSearch `user` index
|
||||||
|
// ended up with an empty `companies` field → frontend share-picker
|
||||||
|
// search returned zero results for same-Company users. Without this
|
||||||
|
// double-save, setUserRole's save is the last write and the index
|
||||||
|
// is correct. Surfacing this comment so it doesn't get reintroduced
|
||||||
|
// on rebase.
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Common node machine
|
# Common node machine
|
||||||
FROM node:lts-alpine AS node-base
|
# [Workavia] Pinned to Node 22 (was `node:lts-alpine`). Node 24 broke
|
||||||
|
# the `config` package (Utils.isRegExp removed) — until tdrive bumps
|
||||||
|
# their `config` dep, we stay on 22 LTS.
|
||||||
|
FROM node:22-alpine AS node-base
|
||||||
|
|
||||||
### Install dependencies
|
### Install dependencies
|
||||||
RUN apk add --update-cache \
|
RUN apk add --update-cache \
|
||||||
|
|||||||
Reference in New Issue
Block a user