Skip to content

Commit

Permalink
🌟Synchronization of the user with LDAP
Browse files Browse the repository at this point in the history
  • Loading branch information
shepilov committed Sep 6, 2023
1 parent f97d62c commit bc976de
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 22 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/ldap-sync.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
name: backend-build
name: ldap-sync-build

on:
pull_request:
branches: [main]
paths:
- "tdrive/utils/ldap-sync/**"
- "tdrive/backend/utils/**"

jobs:
publish-node:
lint:
runs-on: ubuntu-20.04
steps:
- name: Set env to production
if: endsWith(github.ref, '/main')
run: 'echo "DOCKERTAG=latest" >> $GITHUB_ENV'
- name: "Push to the registry following labels:"
run: |
echo "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: tdrive/tdrive-ldap-sync
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
workdir: tdrive
registry: docker-registry.linagora.com
context: .
target: production
buildoptions: "-t docker-registry.linagora.com/tdrive/tdrive-ldap-sync -f docker/tdrive-ldap-sync/Dockerfile"
tags: "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
- name: Build ldap sync
run: cd tdrive/backend/utils/ldap-sync && npm run build
31 changes: 31 additions & 0 deletions .github/workflows/publish-ldap-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: publish-ldap-sync

on:
pull_request:
branches: [main]
paths:
- "tdrive/utils/ldap-sync/**"

jobs:
publish-node:
runs-on: ubuntu-20.04
steps:
- name: Set env to production
if: endsWith(github.ref, '/main')
run: 'echo "DOCKERTAG=latest" >> $GITHUB_ENV'
- name: "Push to the registry following labels:"
run: |
echo "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
- uses: actions/checkout@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: tdrive/tdrive-ldap-sync
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
workdir: tdrive
registry: docker-registry.linagora.com
context: .
target: production
buildoptions: "-t docker-registry.linagora.com/tdrive/tdrive-ldap-sync -f docker/tdrive-ldap-sync/Dockerfile"
tags: "${{ env.DOCKERTAG }},${{ env.DOCKERTAGVERSION }}"
2 changes: 1 addition & 1 deletion tdrive/backend/utils/ldap-sync/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface UserAttributes {

dotenv.config();

console.log("Run script with the following env: ");
console.log("Run script with the following env:");
console.log(process.env);

// LDAP server configuration
Expand Down

0 comments on commit bc976de

Please sign in to comment.