From bc976de90b8259cdf28881f29c61704e3884cfff Mon Sep 17 00:00:00 2001 From: Anton SHEPILOV Date: Wed, 6 Sep 2023 18:35:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=9FSynchronization=20of=20the=20user?= =?UTF-8?q?=20with=20LDAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ldap-sync.yml | 26 ++++------------- .github/workflows/publish-ldap-sync.yml | 31 +++++++++++++++++++++ tdrive/backend/utils/ldap-sync/src/index.ts | 2 +- 3 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/publish-ldap-sync.yml diff --git a/.github/workflows/ldap-sync.yml b/.github/workflows/ldap-sync.yml index 41ff37a48..1a1872378 100644 --- a/.github/workflows/ldap-sync.yml +++ b/.github/workflows/ldap-sync.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/publish-ldap-sync.yml b/.github/workflows/publish-ldap-sync.yml new file mode 100644 index 000000000..bfa4ad74e --- /dev/null +++ b/.github/workflows/publish-ldap-sync.yml @@ -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 }}" \ No newline at end of file diff --git a/tdrive/backend/utils/ldap-sync/src/index.ts b/tdrive/backend/utils/ldap-sync/src/index.ts index 75930ae1f..58850a2ee 100644 --- a/tdrive/backend/utils/ldap-sync/src/index.ts +++ b/tdrive/backend/utils/ldap-sync/src/index.ts @@ -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