Skip to content

make sail script publishable #201

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

Conversation

mhmdomer
Copy link
Contributor

@mhmdomer mhmdomer commented Jul 23, 2021

This PR will allow developers to modify or add commands to the sail script.
If you decided to add a new custom service to the docker-compose.yml file and expose a command for this service via sail, you may add the command to the published sail script at the root of your app. For example, if you added a mongo service to your app you can make the mongo shell available by adding:

.
.
elif [ "$1" == "mongo" ]; then

    if [ "$EXEC" == "yes" ]; then
        docker-compose exec mongo mongo
    else
        sail_is_not_running
    fi
elif
.
.

Currently, the script will be published by executing sail artisan sail:publish command, I was wondering if it should be published via its own command like sail artisan sail:publish-script so that developers can publish it on demand.

Also, The user doesn't have to register any alias command, the script will check if there is a file called sail at the root of the app, then it will execute it, otherwise, it will execute the original script in ./vendor/bin/sail.

@mhmdomer mhmdomer force-pushed the feature/make-sail-script-publishable branch from 42d43e0 to 0707584 Compare July 24, 2021 13:19
@finagin
Copy link
Contributor

finagin commented Jul 26, 2021

@mhmdomer, I propose PR in your fork with append separate groups for publish like sail-docker and sail-bin

# publish only docker files
artisan vendor:publish --tag=sail-docker

# publish only bash-script
artisan vendor:publish --tag=sail-bin

# publish both
artisan vendor:publish --tag=sail

```shell
# publish only docker files
artisan vendor:publish --tag=sail-docker

# publish only bash-script
artisan vendor:publish --tag=sail-bin

# publish both
artisan vendor:publish --tag=sail
```
@mhmdomer
Copy link
Contributor Author

@mhmdomer, I propose PR in your fork with append separate groups for publish like sail-docker and sail-bin

# publish only docker files
artisan vendor:publish --tag=sail-docker

# publish only bash-script
artisan vendor:publish --tag=sail-bin

# publish both
artisan vendor:publish --tag=sail

Thanks @finagin, I think it will add more options to selectively publish desired files while keeping the old behavior.

@taylorotwell taylorotwell merged commit d865e08 into laravel:1.x Jul 26, 2021
Copy link
Contributor

@finagin finagin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this lines if you use alias sail='bash vendor/bin/sail' run not published script

@mhmdomer
Copy link
Contributor Author

mhmdomer commented Jul 26, 2021

Without this lines if you use alias sail='bash vendor/bin/sail' run not published script

Yes, now you have to run './sail' to execute the published script.

@mhmdomer mhmdomer deleted the feature/make-sail-script-publishable branch July 26, 2021 13:41
@mhmdomer mhmdomer restored the feature/make-sail-script-publishable branch July 26, 2021 13:41
taylorotwell pushed a commit that referenced this pull request Jul 27, 2021
In #201 to tag `sail` added bash script and added separate tag `sail-docker` to publish only docker directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants