-
-
Notifications
You must be signed in to change notification settings - Fork 298
test: test-project switch from mounting to building image with docker #1482
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
Merged
asyncapi-bot
merged 13 commits into
asyncapi:master
from
nightknighto:docker-test-project-2
Apr 23, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2e7f46f
chore: add .gitattributes to enforce LF line endings for script files
nightknighto b825dd0
feat: add Docker support for test project with Dockerfile and docker-…
nightknighto a544823
refactor: remove unnecessary privileged flag from test project servic…
nightknighto fb6bc4a
Merge branch 'master' into docker-test-project-2
nightknighto 96a9bc6
Merge branch 'master' into docker-test-project-2
derberg a18c5da
Merge branch 'master' into docker-test-project-2
derberg 1cc972f
Merge branch 'master' into docker-test-project-2
nightknighto 21a26de
chore: add Dockerfile and docker-compose patterns to .dockerignore
nightknighto a95be33
refactor: remove the new Dockerfile and re-use root Dockerfile
nightknighto 71010ad
chore: remove redundant network configuration from docker-compose.yml
nightknighto c694ed6
fix: standardize environment variable name from NODE_IMAGE_TAG to NOD…
nightknighto 3d47885
Merge branch 'master' into docker-test-project-2
derberg dc9f852
Merge branch 'master' into docker-test-project-2
derberg 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 hidden or 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 |
---|---|---|
|
@@ -35,3 +35,7 @@ Thumbs.db | |
**/coverage | ||
.nyc_output | ||
test-results | ||
|
||
**/Dockerfile | ||
**/docker-compose*.yml | ||
**/docker-compose*.yaml |
This file contains hidden or 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,3 @@ | ||
# Ensure script files have LF line endings | ||
*.sh text eol=lf | ||
*.bash text eol=lf |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM node:18-alpine AS base | ||
ARG NODE_VERSION=18 | ||
FROM node:${NODE_VERSION}-alpine AS base | ||
|
||
WORKDIR /app | ||
|
||
|
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,24 +1,16 @@ | ||
version: '3' | ||
|
||
services: | ||
verdaccio: | ||
image: verdaccio/verdaccio:5 | ||
ports: | ||
- '4873:4873' | ||
volumes: | ||
- './verdaccio:/verdaccio/conf' | ||
networks: | ||
- mynetwork | ||
|
||
test-project: | ||
privileged: true | ||
image: "node:${NODE_IMAGE_TAG}" | ||
volumes: | ||
- ../../../../:/apptemp | ||
command: bash /apptemp/apps/generator/test/test-project/test-entrypoint.sh | ||
networks: | ||
- mynetwork | ||
|
||
networks: | ||
mynetwork: | ||
driver: bridge | ||
pull_policy: build | ||
build: | ||
context: ../../../../ # Root of the project | ||
args: | ||
NODE_VERSION: ${NODE_VERSION} | ||
user: root # Use root user to avoid permission issues when creating directories | ||
command: ["sh", "/app/apps/generator/test/test-project/test.sh", "test-project"] |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🛠️ Refactor suggestion
Handle potential
cd /app
failureThe new absolute path change is correct, but without error handling a failed
cd
could let subsequent commands run in the wrong directory.Apply this diff to exit on failure:
This aligns with ShellCheck SC2164.
📝 Committable suggestion
🧰 Tools
🪛 Shellcheck (0.10.0)
[warning] 54-54: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)
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.
@nightknighto you don't like rabbit? 😄
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
It's good in many things, but this suggestion definitely isn't 😂