-
Notifications
You must be signed in to change notification settings - Fork 13
Install script #1326
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
Draft
royduin
wants to merge
1
commit into
master
Choose a base branch
from
installer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Install script #1326
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
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,105 @@ | ||||||
| #!/usr/bin/env bash | ||||||
| set -e | ||||||
|
|
||||||
| echo '=====================================' | ||||||
| echo ' ____ _ _ ' | ||||||
| echo ' | _ \ __ _ _ __ (_) __| | ___ ____' | ||||||
| echo ' | |_) / _` | '\''_ \| |/ _` |/ _ \_ /' | ||||||
| echo ' | _ < (_| | |_) | | (_| | __// / ' | ||||||
| echo ' |_| \_\__,_| .__/|_|\__,_|\___/___|' | ||||||
| echo ' |_| ' | ||||||
| echo ' Welcome to the Rapidez installer!' | ||||||
| echo '=====================================' | ||||||
|
|
||||||
| # Vars | ||||||
| DEFAULT_TRAEFIK_PORT=80 | ||||||
| DEFAULT_DB_PORT=3306 | ||||||
| INSTALL_DIR="${RAPIDEZ_HOME:-rapidez}" | ||||||
|
|
||||||
| # Helpers | ||||||
| command_exists() { | ||||||
| command -v "$1" >/dev/null 2>&1 | ||||||
| } | ||||||
|
|
||||||
| find_free_port() { | ||||||
| local port=$1 | ||||||
|
|
||||||
| while nc -z localhost "$port" >/dev/null 2>&1; do | ||||||
| port=$((port + 1)) | ||||||
| done | ||||||
|
|
||||||
| echo "$port" | ||||||
| } | ||||||
|
|
||||||
| # Start! | ||||||
| if ! command_exists docker; then | ||||||
| echo "❌ Docker is not installed!" | ||||||
| echo "Please install Docker and try again" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| if ! docker compose version >/dev/null 2>&1; then | ||||||
| echo "❌ Docker Compose is not available!" | ||||||
| echo "Please update Docker and try again" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| echo "✓ Docker found" | ||||||
|
|
||||||
| mkdir -p "$INSTALL_DIR" | ||||||
| cd "$INSTALL_DIR" | ||||||
|
|
||||||
| composer create-project rapidez/rapidez:^5.0 . | ||||||
| composer require rapidez/reviews | ||||||
|
|
||||||
| if [ ! -f docker-compose.yml ]; then | ||||||
| echo "⚠️ No docker-compose.yml found" | ||||||
| echo "Check the errors and try again" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| TRAEFIK_PORT=$(find_free_port "$DEFAULT_TRAEFIK_PORT") | ||||||
| DB_PORT=$(find_free_port "$DEFAULT_DB_PORT") | ||||||
|
|
||||||
| echo "✓ Free ports found:" | ||||||
| echo " HTTP: $TRAEFIK_PORT" | ||||||
| echo " MySQL: $DB_PORT" | ||||||
|
|
||||||
| cp .env.example.traefik .env | ||||||
| sed -i.bak "s/^TRAEFIK_PORT=.*/TRAEFIK_PORT=$TRAEFIK_PORT/" .env && rm -f .env.bak | ||||||
| sed -i.bak "s/^DB_PORT=.*/DB_PORT=$DB_PORT/" .env && rm -f .env.bak | ||||||
| echo "✓ .env configured" | ||||||
|
|
||||||
| docker exec rapidez php artisan key:generate | ||||||
| echo "✓ key generated" | ||||||
| docker exec rapidez php artisan rapidez:install --frontendonly | ||||||
| echo "✓ frontend dependencies copied" | ||||||
| docker exec rapidez yarn | ||||||
| echo "✓ frontend dependencies installed" | ||||||
| docker exec rapidez yarn run prod | ||||||
| echo "✓ frontend dependencies build" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Past tense 😉 |
||||||
| docker exec rapidez php artisan storage:link | ||||||
| echo "✓ storage linked" | ||||||
| docker exec rapidez php artisan rapidez:index | ||||||
| echo "✓ products indexed" | ||||||
| docker exec rapidez php artisan vendor:publish --provider "Rapidez\Core\RapidezServiceProvider" | ||||||
| echo "✓ configs published" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also publishes the views, right?
Suggested change
|
||||||
|
|
||||||
| docker compose up -d | ||||||
|
|
||||||
| echo "" | ||||||
| echo "🎉 Rapidez is ready!" | ||||||
| echo "" | ||||||
| echo "Rapidez frontend:" | ||||||
| echo "http://rapidez.localhost:$TRAEFIK_PORT" | ||||||
| echo "" | ||||||
| echo "Magento admin:" | ||||||
| echo "http://magento.localhost:$TRAEFIK_PORT/admin" | ||||||
| echo "" | ||||||
| echo "To stop everything:" | ||||||
| echo "docker compose down" | ||||||
| echo "" | ||||||
| echo "From here:" | ||||||
| echo "- Have a look, and make some changes in the templates: /resources/views/vendor/rapidez/" | ||||||
| echo "- Check the docs @ https://docs.rapidez.io" | ||||||
| echo "- Questions? Join Slack @ https://rapidez.io/slack" | ||||||
Oops, something went wrong.
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.
What makes this package special enough that it needs to be included in a base install of Rapidez? If it's that special it may as well go into the core IMO 🤔