Skip to content

Commit 9bbf34a

Browse files
authored
Initial http reaction (#253)
* http reaction
1 parent 8f2df26 commit 9bbf34a

File tree

12 files changed

+1713
-22
lines changed

12 files changed

+1713
-22
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ jobs:
311311
label: 'PostDaprPubSub',
312312
path: './reactions/dapr/post-pubsub',
313313
name: 'reaction-post-dapr-pubsub'
314+
},
315+
{
316+
label: 'Http',
317+
path: './reactions/http',
318+
name: 'reaction-http'
314319
}
315320
]
316321
steps:

.github/workflows/draft-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ env:
7070
{"label": "StorageQueue", "path": "reactions/azure/storagequeue-reaction", "name": "reaction-storage-queue", "platforms": "linux/amd64,linux/arm64"},
7171
{"label": "SyncDaprStateStore", "path": "reactions/dapr/sync-statestore", "name": "reaction-sync-dapr-statestore", "platforms": "linux/amd64,linux/arm64"},
7272
{"label": "PostDaprPubSub", "path": "reactions/dapr/post-pubsub", "name": "reaction-post-dapr-pubsub", "platforms": "linux/amd64,linux/arm64"},
73+
{"label": "Http", "path": "reactions/http", "name": "reaction-http", "platforms": "linux/amd64,linux/arm64"},
7374
{"label": "StoredProc", "path": "reactions/sql/storedproc-reaction", "name": "reaction-storedproc", "platforms": "linux/amd64,linux/arm64"}]'
7475

7576
jobs:

cli/installers/resources/default-reaction-providers.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,23 @@ spec:
256256
services:
257257
reaction:
258258
image: reaction-post-dapr-pubsub
259+
---
260+
apiVersion: v1
261+
kind: ReactionProvider
262+
name: Http
263+
spec:
264+
services:
265+
reaction:
266+
image: reaction-http
267+
config_schema:
268+
type: object
269+
properties:
270+
baseUrl:
271+
type: string
272+
token:
273+
type: string
274+
timeout:
275+
type: number
276+
required:
277+
- baseUrl
259278

query-container/Cargo.lock

Lines changed: 35 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactions/http/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

reactions/http/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

reactions/http/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:20-alpine
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY . .
6+
7+
RUN npm install -g typescript
8+
RUN npm install
9+
RUN npm run build
10+
11+
CMD ["npm", "start"]

reactions/http/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: default docker-build kind-load
2+
3+
CLUSTER_NAME ?= kind
4+
IMAGE_PREFIX ?= drasi-project
5+
DOCKER_TAG_VERSION ?= latest
6+
DOCKERX_OPTS ?= --load --cache-to type=inline,mode=max
7+
8+
default: docker-build
9+
10+
docker-build:
11+
docker buildx build . -t $(IMAGE_PREFIX)/reaction-http:$(DOCKER_TAG_VERSION) $(DOCKERX_OPTS)
12+
13+
docker-build-debug:
14+
docker buildx build . -f Dockerfile.debug -t $(IMAGE_PREFIX)/reaction-http:$(DOCKER_TAG_VERSION) $(DOCKERX_OPTS)
15+
16+
kind-load:
17+
kind load docker-image $(IMAGE_PREFIX)/reaction-http:$(DOCKER_TAG_VERSION) --name $(CLUSTER_NAME)
18+
19+
k3d-load: CLUSTER_NAME=k3s-default
20+
k3d-load:
21+
k3d image import $(IMAGE_PREFIX)/reaction-http:$(DOCKER_TAG_VERSION) -c $(CLUSTER_NAME)
22+
23+
test:
24+
@echo "No tests to run yet"
25+
26+
lint-check:
27+
@echo "No lint checks to run yet"

0 commit comments

Comments
 (0)