-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🎉 Containerize connector code generator #3763
Merged
TymoshokDmytro
merged 16 commits into
master
from
dtymoshok/#3558-containerize-connector-code-generator
Jun 8, 2021
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3cc3775
Wrap npm generate script with docker and create generate.sh script
TymoshokDmytro fa80b86
replace npm run generate -> ./generate.sh
TymoshokDmytro 55736f4
Merge branch 'master' of https://github.com/airbytehq/airbyte into dt…
TymoshokDmytro 9591835
Merge branch 'master' into dtymoshok/#3558-containerize-connector-cod…
subodh1810 d5d0e2a
Merge branch 'master' of github.com:airbytehq/airbyte into dtymoshok/…
TymoshokDmytro f582c85
Make generator works from both npm run generate or from generate.sh …
TymoshokDmytro 5afa02b
Merge branch 'dtymoshok/#3558-containerize-connector-code-generator' …
TymoshokDmytro f2809d1
Update generate.sh to check the connectors folder before coping the o…
TymoshokDmytro 0739681
Add some comments to generate.sh script
TymoshokDmytro 18cbedc
Move generate.sh script to the airbyte root and update READMEs
TymoshokDmytro 0ef00c5
Add newlines to the end of the dockerfile and script
TymoshokDmytro 8479592
Fix path outputs in generator for better user experience
TymoshokDmytro cae9c49
Minor adding
TymoshokDmytro 1787680
Merge branch 'master' of github.com:airbytehq/airbyte into dtymoshok/…
TymoshokDmytro dbfc657
Updates to have possibility to generate and modify files all over air…
TymoshokDmytro 7228708
Move generator.sh script to airbyte-integrations/connector-templates/…
TymoshokDmytro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
airbyte-integrations/connector-templates/generator/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:14-alpine | ||
|
||
ARG UID | ||
ARG GID | ||
ENV ENV_UID $UID | ||
ENV ENV_GID $GID | ||
|
||
RUN mkdir -p /airbyte | ||
WORKDIR /airbyte/airbyte-integrations/connector-templates/generator | ||
|
||
RUN npm install npm@7 --silent --no-update-notifier | ||
CMD npm run generate && chown -R $ENV_UID:$ENV_GID /airbyte/* |
17 changes: 17 additions & 0 deletions
17
airbyte-integrations/connector-templates/generator/generate.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Remove container if already exist | ||
docker container rm -f airbyte-connector-bootstrap >/dev/null 2>&1 | ||
|
||
# Build image for container from Dockerfile | ||
# Specify the host system user UID and GID to chown the generated files to host system user. | ||
# This is done because all generated files in container with mounted folders has root owner | ||
docker build --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" . -t airbyte/connector-bootstrap | ||
|
||
# Run the container and mount the airbyte folder | ||
docker run -it --name airbyte-connector-bootstrap -v "$(pwd)/../../../.":/airbyte airbyte/connector-bootstrap | ||
|
||
# Remove container after coping files | ||
docker container rm -f airbyte-connector-bootstrap >/dev/null 2>&1 | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we make it run from the project root instead?
We've had this convention for almost all our scripts.
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.
I move the generate.sh to the root of the project, update the script paths, and READMEs. So now it can be started from the airbyte root.