hammerstonedev / airdrop Goto Github PK
View Code? Open in Web Editor NEWA Laravel package to speed up deployment by skipping asset compilation whenever possible.
Home Page: https://hammerstone.dev/airdrop/docs/main
License: MIT License
A Laravel package to speed up deployment by skipping asset compilation whenever possible.
Home Page: https://hammerstone.dev/airdrop/docs/main
License: MIT License
Hey @aarondfrancis,
First of all thanks for this excellent package. Appreciate your efforts.
So, I have installed this packages and updated my deployment bash script as mentioned on the docs page
After making this changes, I ran the deployment script to check if npm run prod
takes lesser time but it wasn't the case (previously it was taking ~8000ms too).
Am I missing some point here?
Secondly as of now, I am using FilesystemDriver
so the built files are stored on the same disk inside the storage
folder. I want to move to GH actions and wanted some help/understanding, if possible. So, I saw the GH workflow file changes mentioned on the doc here but can you help me when should this workflow be executed? should it be after every merge? ... And how does deployment script change when using GH actions?
Thanks,
Milan
Hi, when i try to use deploy with Github Actions and make new deploy.yml file in workflow folder
the github action when push file on my repo fail because not found artisan
PHP Warning: require(/home/runner/work/xxxx/yyyyy/vendor/autoload.php): Failed to open stream: No such file or directory in /home/runner/work/xxxx/yyyyy/artisan on line 18
name: Laravel ASSETS
on:
push:
branches: [staging]
jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate Airdrop Hash
run: echo "AIRDROP_HASH=$(php artisan airdrop:hash)" >> $GITHUB_ENV
- name: Cache Airdrop Assets
uses: actions/cache@v2
with:
key: ${{ runner.os }}-airdrop-${{ env.AIRDROP_HASH }}
path: /tmp/airdrop-*
PHP: 8.2
Laravel: 10.15
Airdrop: 0.2.4
When running the airdrop:download
or airdrop:upload
commands, the following errors comes up:
TypeError
Hammerstone\Airdrop\FileSelection::shouldExclude(): Argument #1 ($path) must be of type string, Symfony\Component\Finder\SplFileInfo given, called in /var/www/html/vendor/hammerstone/airdrop/src/FileSelection.php on line 116
at vendor/hammerstone/airdrop/src/FileSelection.php:152
148▕ })
149▕ ->toArray();
150▕ }
151▕
➜ 152▕ protected function shouldExclude(string $path): bool
153▕ {
154▕ foreach ($this->excludeFilesAndDirectories as $excludedPath) {
155▕ if (Str::startsWith(realpath($path), $excludedPath)) {
156▕ return true;
+1 vendor frames
2 [internal]:0
Hammerstone\Airdrop\FileSelection::yieldSelectedFiles()
+22 vendor frames
25 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
This is caused by this line. The iterator is an iterator of Symfony\Component\Finder\SplFileInfo
, not string.
The fix seems to be to pass the realpath from the Symfony object and remove the realpath
function call in the shouldExclude
function.
Doing this locally causes Airdrop to function as expected.
I spotted a .DS_Store
in my Airdrop debug output. Files like that are ignored by git, so the CI ended up with a different hash.
I was wondering if ignorable files or patterns could be supported for the triggers?
Hello,
it seems zip files are never deleted in the storage/app/airdrop folder, i have 34 zip currently,
Should i delete the zips, between airdrop:download and airdrop:upload to ensure only one zip remains ?
thanks
Hey,
First of all really like this package.
So I had a little Problem with using it in our deployments because we are using ziggy in the project and it creates a file in resources.
The problem was finding this different file.
So I thought I could add a option to the download and upload command so they make a diff of the HashGenerator::make()->asArray()
so it could be easier to find the differences.
Would you be open to a PR with this functionality? Then I would try to add it in the next days.
Hi!
Once Gitlab has a built in cache mechanism for builded assets, this package will be useful in anyway for gitlab projects?
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.