Skip to content

Commit 3343266

Browse files
committed
Merge branch 'main' into improvement/bulk-edit-member-attributes
2 parents d1b4f97 + 1b082e2 commit 3343266

File tree

218 files changed

+19943
-1823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+19943
-1823
lines changed

.github/workflows/production-deploy-new.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: Deploy search-sync-worker service?
88
required: true
99
type: boolean
10+
deploy_integration_sync_worker:
11+
description: Deploy integration-sync-worker service?
12+
required: true
13+
type: boolean
1014

1115
env:
1216
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -41,6 +45,27 @@ jobs:
4145
id: image
4246
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
4347

48+
build-and-push-integration-sync-worker:
49+
runs-on: ubuntu-latest
50+
if: ${{ inputs.deploy_integration_sync_worker }}
51+
outputs:
52+
image: ${{ steps.image.outputs.IMAGE }}
53+
defaults:
54+
run:
55+
shell: bash
56+
steps:
57+
- name: Check out repository code
58+
uses: actions/checkout@v2
59+
60+
- uses: ./.github/actions/build-docker-image
61+
id: image-builder
62+
with:
63+
image: integration-sync-worker
64+
65+
- name: Set docker image output
66+
id: image
67+
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
68+
4469
deploy-search-sync-worker:
4570
needs: build-and-push-search-sync-worker
4671
runs-on: ubuntu-latest
@@ -58,3 +83,21 @@ jobs:
5883
service: search-sync-worker
5984
image: ${{ needs.build-and-push-search-sync-worker.outputs.image }}
6085
cluster: ${{ env.CROWD_CLUSTER }}
86+
87+
deploy-integration-sync-worker:
88+
needs: build-and-push-integration-sync-worker
89+
runs-on: ubuntu-latest
90+
if: ${{ inputs.deploy_integration_sync_worker }}
91+
defaults:
92+
run:
93+
shell: bash
94+
95+
steps:
96+
- name: Check out repository code
97+
uses: actions/checkout@v2
98+
99+
- uses: ./.github/actions/deploy-service
100+
with:
101+
service: integration-sync-worker
102+
image: ${{ needs.build-and-push-integration-sync-worker.outputs.image }}
103+
cluster: ${{ env.CROWD_CLUSTER }}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Staging Deploy Integration Sync Worker
2+
3+
on:
4+
push:
5+
branches:
6+
- 'staging/**'
7+
- 'staging-**'
8+
paths:
9+
- 'services/libs/**'
10+
- 'services/apps/integration_sync_worker/**'
11+
12+
env:
13+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
14+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
15+
CROWD_CLUSTER: ${{ secrets.STAGING_CLUSTER_NAME }}
16+
CROWD_ROLE_ARN: ${{ secrets.STAGING_CLUSTER_ROLE_ARN }}
17+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
18+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
19+
AWS_REGION: ${{ secrets.AWS_REGION }}
20+
SLACK_CHANNEL: deploys-staging
21+
SLACK_WEBHOOK: ${{ secrets.STAGING_SLACK_CHANNEL_HOOK }}
22+
23+
jobs:
24+
build-and-push:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
image: ${{ steps.image.outputs.IMAGE }}
28+
defaults:
29+
run:
30+
shell: bash
31+
32+
steps:
33+
- name: Check out repository code
34+
uses: actions/checkout@v2
35+
36+
- uses: ./.github/actions/build-docker-image
37+
id: image-builder
38+
with:
39+
image: integration-sync-worker
40+
41+
- name: Set docker image output
42+
id: image
43+
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
44+
45+
deploy-integration-sync-worker:
46+
needs: build-and-push
47+
runs-on: ubuntu-latest
48+
defaults:
49+
run:
50+
shell: bash
51+
52+
steps:
53+
- name: Check out repository code
54+
uses: actions/checkout@v2
55+
56+
- uses: ./.github/actions/deploy-service
57+
with:
58+
service: integration-sync-worker
59+
image: ${{ needs.build-and-push.outputs.image }}
60+
cluster: ${{ env.CROWD_CLUSTER }}

backend/.env.dist.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ CROWD_STACKEXCHANGE_KEY=
128128
# Nango settings
129129
CROWD_NANGO_URL=http://localhost:3003
130130
CROWD_NANGO_SECRET_KEY=424242
131-
CROWD_NANGO_INTEGRATIONS=reddit,linkedin,stackexchange
131+
CROWD_NANGO_INTEGRATIONS=reddit,linkedin,stackexchange,hubspot
132132

133133
# Cohere settings
134134
CROWD_COHERE_API_KEY=

backend/config/custom-environment-variables.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@
137137
"stackexchange": {
138138
"key": "CROWD_STACKEXCHANGE_KEY"
139139
},
140+
"hubspot": {
141+
"appId": "CROWD_HUBSPOT_APP_ID",
142+
"clientId": "CROWD_HUBSPOT_CLIENT_ID",
143+
"clientSecret": "CROWD_HUBSPOT_CLIENT_SECRET"
144+
},
140145
"nango": {
141146
"url": "CROWD_NANGO_URL",
142147
"secretKey": "CROWD_NANGO_SECRET_KEY"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.tenantEdit)
7+
const payload = await new IntegrationService(req).hubspotConnect()
8+
await req.responseHandler.success(req, res, payload)
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.tenantEdit)
7+
const payload = await new IntegrationService(req).hubspotGetMappableFields()
8+
await req.responseHandler.success(req, res, payload)
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.tenantEdit)
7+
const payload = await new IntegrationService(req).hubspotOnboard(req.body)
8+
await req.responseHandler.success(req, res, payload)
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.integrationEdit)
7+
const payload = await new IntegrationService(req).hubspotStopSyncMember(req.body)
8+
await req.responseHandler.success(req, res, payload)
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.integrationEdit)
7+
const payload = await new IntegrationService(req).hubspotStopSyncOrganization(req.body)
8+
await req.responseHandler.success(req, res, payload)
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Permissions from '../../../security/permissions'
2+
import IntegrationService from '../../../services/integrationService'
3+
import PermissionChecker from '../../../services/user/permissionChecker'
4+
5+
export default async (req, res) => {
6+
new PermissionChecker(req).validateHas(Permissions.values.integrationEdit)
7+
const payload = await new IntegrationService(req).hubspotSyncMember(req.body)
8+
await req.responseHandler.success(req, res, payload)
9+
}

0 commit comments

Comments
 (0)