-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@@ -19,13 +19,13 @@ | |||
"./types/*": "./dist/types/*.js" | |||
}, | |||
"scripts": { | |||
"dev": "ts-node --esm src/main.ts serve", | |||
"dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c61a206
to
07408dd
Compare
src/package/docker.ts
Outdated
await runDockerCommand( | ||
logger, | ||
[ | ||
'buildx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need buildx
to cross platform images work inside GitHub Actions, we do the same in our current publishing pipeline https://github.com/cloudquery/cloudquery/blob/d91bda9afbd2e322beabc8a9bf34a2f0cd7407f5/.github/workflows/release_plugin.yml#L79
await runDockerCommand(logger, dockerSaveArguments, pluginDirectory); | ||
const checksum = await computeHash(imagePath); | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
return { os, arch, path: imageTar, checksum, docker_image_tag: imageTag }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added docker_image_tag
as that is needed for the push
command in the CLI.
We can also reconstruct the tag based on information we have in the CLI, but in case we ever change the tag structure I think this way is better
@@ -66,12 +84,26 @@ export const newUnimplementedDestination = (): DestinationClient => { | |||
}; | |||
}; | |||
|
|||
export const newPlugin = (name: string, version: string, newClient: NewClientFunction): Plugin => { | |||
const defaultBuildTargets: BuildTarget[] = [ | |||
{ os: 'linux', arch: 'amd64' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches our current supported platforms https://github.com/cloudquery/cloudquery/blob/d76f083b5027efd579d1432f59c1d8955182d0a1/.github/workflows/release_plugin.yml#L93
So I was able to push the images generated by this PR on the MemDB plugin to GitHub via the CLI code: |
#### Summary Example (images generated with cloudquery/plugin-sdk-javascript#106) ![image](https://github.com/cloudquery/cloudquery/assets/26760571/e51f90a2-2af3-4d09-8039-92343eebe16a) The images were generated by cloudquery/plugin-sdk-javascript#106 (replacing `registry.cloudquery.io` with `ghcr.io`) ### TODO - [ ] Merge the different platforms into a single image with `docker manifest`. The is done by `docker buildx --push` automatically at the moment in https://github.com/cloudquery/cloudquery/blob/67c10c38a04dcdd1512bf6dc739f89bc11baa888/.github/workflows/release_plugin.yml#L94 <!--
Adds a package to Docker command to the JavaScript SDK.
This is a breaking change as it also updates the minimum required version to latest Node.js LTS (20) and updates relevant dependencies.
There's a test to build the MemDB plugins that comes with the SDK, but I'll test with the Airtable plugin too
BEGIN_COMMIT_OVERRIDE
feat: Add package command
chore: Require Node.js 20
BREAKING-CHANGE: Require Node.js 20
END_COMMIT_OVERRIDE