Should i include /public in Vue.js gitignore? - laravel

I have a laravel/Vue.js project, and whenever i commit there are 3 files that get committed too:
-public/main.js
-public/manifest.js
-public/vendor.js
so, Should i include /public in Vue.js gitignore?

It depends on your workflow and project setup:
if you are working alone you can build assets locally and upload on
production. It will save you space from node_modules on your server
if you are working with someone else it is good to be ignored to skip
the conflicts on merging (not big deal, but annoying)
there is some
setups for zero-downtime deploy where each release is in new
directory. In this case you don't want node_modules in each release
and wait to be build. Then you shouldn't ignore them.
the same case
will be if you are using some continues integration tool to test
frontend

Related

How to develop vendored libraries?

I recently jumped back into an old Go project and migrated it to the vendor approach, using dep
It completed sucessfully and I now have a bunch of libs in the local projects vendor/ directory. Great!
However, I now want to work on one of those vendored libs, and see the changes in my main app live. The lib exists in its own project of course, doesn't live its life in this other apps vendor folder - and other local projects should be able to see the live changes too if necessary.
I'm thinking something like npm link, to compare across ecosystems.
How is this typically managed in Go?

How do you deploy build artifacts to Heroku from Codeship?

In starting a new project, I put together the skeleton for a Node app that has tests and generates some build artifacts, like asset compilation and compression. I have the tests running in Codeship so successful builds initiate a deploy to Heroku. They've made it all super easy, except I can't find any way to deploy built files, just a copy of what's in the repo.
Has anyone done this successfully? I feel like writing a custom deploy script to rebuild the assets after the tests and manually deploy them would be working against the existing toolset, and I know can't possibly be the first person to want to do this...
Turns out that Codeship doesn't keep anything, in fact, different servers do the deployment than the testing. It seems that the best-practice here is to recreate the assets on the Heroku side with a custom buildpack, which, directly after the git pull, does the dependency installation and compiles the app slug.

Laravel, Composer, Git workflow

I am new to Laravel, Laravel Homestead, Composer, and the development workflow associated with commiting changes to a Git repository and then pulling those changes to a development/production server. So far after much trial and error, I have managed to:
Set up my local Homestead environment with vagrant.
Create a new Laravel application
Run Composer to fetch dependencies
Access the application locally.
Create a Git repository for my application, commit changes, and push to an origin master branch.
Clone the repository on my remote server (shared hosting on 1and1) and pull the changes in.
For a long time, I couldn't understand why when I pulled the changes to the remote site, I would get PHP errors, but the local site ran just fine. It came down to the fact that the Laravel .gitignore file was ignoring the /vendor directory, which Laravel requires to function. Some Google-fu searches indicate that some people simply run composer update / (composer install ?) on their production servers. (I don't have access to Composer on my shared hosting server, so I am unable to do this)
My question to the community - what do you feel is the best workflow for my given situation? remove the /vendor directory from the .gitignore file? Something else?
Replies are much appreciated.
It looks like you are using GIT as a deployment tool which I dont think is a good idea.
Composer update/install is just for managing dependecies. Some servers dont allow you to run scripts from console or running them is complicated. In this situation you can run composer locally before deployment and send your code to server with all dependencies.
Here are some things that you should keep in mind when designing your workflow:
Use GIT to keep source code and configurations
Use composer to manage dependecies (downloaded dependencies should't be under version control in your GIT repository. Vendor directory and its contetnt is a dependency too)
For deployment use one of deployment tools eg. https://github.com/rocketeers/rocketeer
use the -f flag to forcefully include the vendor directory while using git add.
You are on the right track here, and many will do what you are doing.
The real trouble comes when you are doing multiple server deployments (load balanced, auto-scaling).
Typically what I've seen is a shell script that you would include and run whenever something happens that would require these commands to be run.
Inside of this shell script would be the commands that you want completed every time a new server instance is booted up.
You can do this with a number of tools for a single server environment as well.
I might look into continuous integration tools like Travis CI, Jenkins, etc. If this is a major headache of yours.
Otherwise, it might be overkill.... then just keep doing what you are doing.
adding the vendor directory to your git repo is against best practices.
This is also a decent option involving webhooks:
http://losstopschade.de/post/96967373358
Look at Deploy Laravel Webapp to 1and1

Spring Tool Suite: How do i clean Spring Tool Suite cache (if there is one)?

Few days back I created a maven project and i'm using angularJS for view, but whenever i make changes in the html file it doesn't show up after running the project, i clean the project countless number of times but the changes still don't show up.
But what i don't understand is that sometimes the changes show up the next day I run the project.
So is there some kind of cache that i need to delete after making new changes to my project??
I'm using STS Version: 3.3.0.RELEASE.
Thanks,
-Elysium
It sounds like your JavaScript files are not being copied over to the target directory properly. Make sure that after you do a build in the workspace that the proper version of the JS files are in the target folder on the filesystem (i.e., look outside of Eclipse). If the files are not correct, then your maven commands are not being completely invoked inside the workspace.
It's hard to say exactly what is going on without more information, but this sounds possible.

appharbor not deploying static content

I just started hosting a web application on AppHarbor, and i configured it to listen to my github repository commits.
After each commit, I see on AppHarbor the build running the tests, and deploying, but when i go to my app page, hosted on AppHarbor I don't see any images, and the js scripts are missing.
I can actually see them in the github source, but when I download the package from AppHarbor, they seem to be missing from my 'static' folder...
Anyone else run into this problem ?... Any possible causes for this ?...
I solved the problem -
The reason this was happening because the content wasn't being copied to the output directory. I don't know exactly how AppHarbor build there Deployment scripts, but I changed the Copy To Output Directory option value to Copy Always and this solved the problem.
(The Build Action was already set to Content)
Make sure that the files are included in the C# project, and that their Build Action is set to Content.

Resources