-
Notifications
You must be signed in to change notification settings - Fork 223
[frontend] feat: add quick dev frontend #521
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
Merged
Changes from all commits
Commits
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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| set -eu | ||
|
|
||
| export WORKSPACE=$(cd "$(dirname "$(readlink -f "$0")")" && pwd) | ||
| BUILD_DIR="${WORKSPACE}/../frontend/build/" | ||
|
|
||
| cd ${WORKSPACE} | ||
| source .env | ||
|
|
||
| # Generate development version tag | ||
| BASE_VERSION=${VERSION} | ||
| TIMESTAMP=$(date +%Y%m%d-%H%M%S) | ||
| GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") | ||
| DEV_VERSION="${BASE_VERSION}-dev-${TIMESTAMP}-${GIT_COMMIT}" | ||
|
|
||
| echo "=== Version Information ===" | ||
| echo "Base Version: ${BASE_VERSION}" | ||
| echo "Development Version: ${DEV_VERSION}" | ||
| echo "Git Commit: ${GIT_COMMIT}" | ||
|
|
||
| # Check local build artifacts | ||
| if [ ! -d "$BUILD_DIR" ] || [ -z "$(ls -A "$BUILD_DIR" 2>/dev/null)" ]; then | ||
| echo "Error: plugins directory is empty or does not exist: $BUILD_DIR" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "=== Stopping web service ===" | ||
| docker-compose stop web | ||
|
|
||
| echo "=== Creating development version image ===" | ||
| # Use stable version as base | ||
| docker run -d --name web-tmp --entrypoint sleep ${REPO}/jade-web:${BASE_VERSION} infinity | ||
|
|
||
| # Copy files | ||
| echo "Copying frontend files..." | ||
| docker exec web-tmp rm -rf //usr//share//nginx//html | ||
| docker exec web-tmp mkdir -p //usr//share//nginx//html | ||
| docker cp "$BUILD_DIR"/. web-tmp:/usr/share/nginx/html/ | ||
|
|
||
| # Commit as development version | ||
| echo "Committing development version image: ${DEV_VERSION}" | ||
| docker commit --change='ENTRYPOINT ["/init.sh"]' web-tmp ${REPO}/jade-web:${DEV_VERSION} | ||
|
|
||
| # Create development tag (for docker-compose convenience) | ||
| docker tag ${REPO}/jade-web:${DEV_VERSION} ${REPO}/jade-web:dev-latest | ||
|
|
||
| echo "=== Cleaning up temporary container ===" | ||
| docker stop web-tmp | ||
| docker rm web-tmp | ||
|
|
||
| echo "=== Restarting services ===" | ||
| docker-compose -f docker-compose.dev.yml -p app-platform up -d web | ||
|
|
||
| echo "" | ||
| echo "=== Completed! ===" | ||
| echo "Development version deployed: ${DEV_VERSION}" | ||
| echo "Current tag in use: dev-latest" | ||
| echo "Service URL: http://localhost:8001" | ||
| echo "" | ||
| echo "=== Version Management Commands ===" | ||
| echo "View all versions: docker images ${REPO}/jade-web" |
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.