Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add package command #106

Merged
merged 12 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist-dir
node_modules
npm-debug.log
.env
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand All @@ -31,12 +31,17 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

-
# Required for the package command tests to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Test
run: |
npm test
Expand All @@ -47,7 +52,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand All @@ -63,7 +68,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ dist
# Editor settings
.idea
.vscode

dist-dir
.DS_Store
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:20-slim as builder

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . .

RUN npm run build

FROM node:20-slim AS final

WORKDIR /app

COPY --from=builder ./app/dist ./dist

COPY package*.json ./

RUN npm ci --omit=dev

EXPOSE 7777

ENTRYPOINT ["node", "dist/main.js"]

CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is the high-level package to use for developing CloudQuery plugins in JavaS

## Prerequisites

Node.js 16 or higher. Install Node.js from [here](https://nodejs.org/en/download/).
Node.js 20 or higher. Install Node.js from [here](https://nodejs.org/en/download/).

## Setup

Expand All @@ -29,7 +29,13 @@ npm test
### Start a local memory based plugin server

```bash
npm run dev
npm run dev -- serve
```

### Package as a Docker image

```bash
npm run dev -- package -m test "v1.0.0" . --dist-dir dist-dir
```

### Formatting and Linting
Expand Down
3 changes: 3 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MemDB Plugin

Test docs for the MemDB plugin.
Loading