julientant / laravel-env-sync Goto Github PK
View Code? Open in Web Editor NEWA package that makes sure that your .env file is in sync with your .env.example
A package that makes sure that your .env file is in sync with your .env.example
When the package ask me if I want to keep the default value from .env to .env.example, it not allows empty value.
Hi! Great package!
We would like to use this as part of a CI/CD deployment pipeline but wonder whether it would work in that instance?
For example, Azure will set environment variables on the "machine" instead of creating a .env file. Would this support that scenario? A quick glance didn't make it seem as though it would
Happy to put the work in to make it do so if not ๐
Tried to set this repo with Lumen (5.7.6) and it was messing everything up. From composer file
$ composer require jtant/laravel-env-sync
Using version ^1.3 for jtant/laravel-env-sync
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 11 installs, 1 update, 22 removals
- Removing illuminate/broadcasting (v5.7.11)
- Removing illuminate/bus (v5.7.11)
- Removing illuminate/cache (v5.7.11)
- Removing illuminate/config (v5.7.11)
- Removing illuminate/console (v5.7.11)
- Removing illuminate/container (v5.7.11)
- Removing illuminate/contracts (v5.7.11)
- Removing illuminate/database (v5.7.11)
- Removing illuminate/encryption (v5.7.11)
- Removing illuminate/events (v5.7.11)
- Removing illuminate/filesystem (v5.7.11)
- Removing illuminate/hashing (v5.7.11)
- Removing illuminate/http (v5.7.11)
- Removing illuminate/log (v5.7.11)
- Removing illuminate/pagination (v5.7.11)
- Removing illuminate/pipeline (v5.7.11)
- Removing illuminate/queue (v5.7.11)
- Removing illuminate/session (v5.7.11)
- Removing illuminate/support (v5.7.11)
- Removing illuminate/translation (v5.7.11)
- Removing illuminate/validation (v5.7.11)
- Removing illuminate/view (v5.7.11)
- Installing symfony/css-selector (v4.1.7): Loading from cache
- Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache
- Installing symfony/routing (v4.1.7): Loading from cache
- Installing doctrine/lexer (v1.0.1): Loading from cache
- Installing egulias/email-validator (2.1.6): Loading from cache
- Installing swiftmailer/swiftmailer (v6.1.3): Loading from cache
- Installing paragonie/random_compat (v9.99.99): Loading from cache
- Installing ramsey/uuid (3.8.0): Loading from cache
- Installing league/flysystem (1.0.49): Loading from cache
- Installing erusev/parsedown (1.7.1): Loading from cache
- Updating laravel/framework (v5.7.11 => v5.7.11): Downloading (100%)
- Installing jtant/laravel-env-sync (1.3.5): Loading from cache
And php artisan
was giving
$ php artisan
PHP Fatal error: Uncaught ReflectionException: Class path.storage does not exist in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
Stack trace:
#0 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct('path.storage')
#1 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\Container\Container->build('path.storage')
#2 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\Container\Container->resolve('path.storage', Array)
#3 ~/vendor/laravel/lumen-framework/src/Application.php(260): Illuminate\Container\Container->make('path.storage', Array)
#4 ~/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Laravel\Lumen\Application->make('path.storage', Array)
#5 ~/vendor/laravel/framework/src/Illumi in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
In Container.php line 779:
Uncaught ReflectionException: Class path.storage does not exist in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
Stack trace:
#0 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct('path.storage')
#1 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\Container\Container->build('path.storage')
#2 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\Container\Container->resolve('path.storage', Array)
#3 ~/vendor/laravel/lumen-framework/src/Application.php(260): Illuminate\Container\Container->make('path.storage', Array)
#4 ~/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Laravel\Lumen\Application->make('path.storage', Array)
#5 ~/vendor/laravel/framework/src/Illumi
Have you intended to add lumen compatibility ?
Add compatibility with Laravel 7.x
I added "php artisan env:sync" to the post-install-cmd in my composer.json and it not working. It asks to set some variable then shows [ERROR] Aborted then asks again and again [ERROR] Aborted.
` [ERROR] Aborted
'SOME_TEST' is not present into your .env file. Its default value is 'test'. Would you like to add it ? [y=yes/n=no/c=change default value] [Copy the default value]:
[y] Copy the default value
[c] Change the default value
[n] Skip
[ERROR] Aborted
'SOME_TEST' is not present into your .env file. Its default value is 'test'. Would you like to add it ? [y=yes/n=no/c=change default value] [Copy the default value]:
[y] Copy the default value
[c] Change the default value
[n] Skip
[ERROR] Aborted
'SOME_TEST' is not present into your .env file. Its default value is 'test'. Would you like to add it ? [y=yes/n=no/c=change default value] [Copy the default value]:
[y] Copy the default value
[c] Change the default value
[n] Skip
[ERROR] Aborted
'SOME_TEST' is not present into your .env file. Its default value is 'test'. Would you like to add it ? [y=yes/n=no/c=change default value] [Copy the default value]:
[y] Copy the default value
[c] Change the default value
[n] Skip
[ERROR] Aborted
'SOME_TEST' is not present into your .env file. Its default value is 'test'. Would you like to add it ? [y=yes/n=no/c=change default value] [Copy the default value]:
[y] Copy the default value
[c] Change the default value
[n] Skip
[ERROR] Aborted`
Hi @JulienTant,
This issue just to let you now that your version of DotEnv is old and not maintained and Laravel 5.8 is not compatible with it anymore.
See you.
Matt'
Does this still support versions of Laravel prior to 7? It appears to require illuminate/events ^7.0 when I try to install.
Thanks in advance, please let me know if I can provide any other details.
Here is the shell output when trying to install on Laravel 6.18.18
$ composer require jtant/laravel-env-sync
Using version ^4.0 for jtant/laravel-env-sync
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for jtant/laravel-env-sync ^4.0 -> satisfiable by jtant/laravel-env-sync[4.0.0].
- Conclusion: remove laravel/framework v6.18.18
- Conclusion: don't install laravel/framework v6.18.18
- jtant/laravel-env-sync 4.0.0 requires illuminate/events ^7.0 -> satisfiable by illuminate/events[7.x-dev, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17.1, v7.17.2, v7.2.0, v7.2.1, v7.2.2, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v7.8.1, v7.9.0, v7.9.1, v7.9.2].
- don't install illuminate/events 7.x-dev|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.3|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.4|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.5|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.6|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.7|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.0.8|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.1.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.1.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.1.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.1.3|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.10.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.10.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.10.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.10.3|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.11.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.12.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.13.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.14.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.14.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.15.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.16.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.16.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.17.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.17.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.17.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.2.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.2.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.2.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.3.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.4.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.5.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.5.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.5.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.6.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.6.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.6.2|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.7.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.7.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.8.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.8.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.9.0|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.9.1|don't install laravel/framework v6.18.18
- don't install illuminate/events v7.9.2|don't install laravel/framework v6.18.18
- Installation request for laravel/framework (locked at v6.18.18, required as ^6.2) -> satisfiable by laravel/framework[v6.18.18].
Installation failed, reverting ./composer.json to its original content.
</details>
Some variables such as database passwords we don't want to commit in a repository.
Does it make sense to add a possibility to exclude these from the sync?
Would it be possible to allow the specification of different .env file to be used when syncing rather than just .env.example?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.