Web deploy from multiple computers - visual-studio

I work on a website on multiple computers, my work and my home pc. The source is maintained under a git repository. I use Web Deploy to publish the website to IIS on the public server. Everything works OK, I can publish from both computers and it works.
The issue is that when I deploy from one PC, then go to the other, get the latest changes from git, make more changes, then deploy again, it re-deploys the entire website instead of only the files that have changed - as is what happens if I were to take out the "then go to the other, get the latest changes from git" steps from the first sentence of this paragraph.
What can I do, what files can I include in my git repository (I exclude all packages, bin and obj directories), or what extra configuration can I perform, to resolve this?

Add a repo on your public server, push to that, then deploy from there. The push will be minimal, git can be startlingly good with deltas.

Related

Using GIT in Plesk for a laravel project

I currently have a web application installed on my 'domain.com'. My server makes use of Plesk. What I then did was copy my app on a subdomain called 'test.domain.com' The second one is what I use for development work and once I have coded and tested, I manually copy the files across to the folders in the 'domain.com' project.
It is a very tedious process and I sometimes loose track of changes. My background is electronics engineering where I did some embedded programming in C. I am familiar with SVN version control and I am aware how version control can make my life easier.
Does anyone know what I can do to implement GIT or other alternatives to simplify my development process?
You can link a git repo on Plesk, and also you can choose the branch you want to pull too.
Link the master to branch to your domain.com root directory and another one like "develop" on you test.domain.com.
Plesk will give you a webhook link you can add on your git repo to auto-pull when you pushed.
You can add some after pull command on plesk, like a schema update for your laravel project too.

Netezza CI/CD tool

Is there any CI/CD tool for Netezza that can manage versions and can be used for migrating code across environments? We have used flywaydb for other databases and are happy with it, but that does not support Netezza. I have already googled and did not find a single tool, so any responses are good for me to begin analyzing further
To my knowledge, there's nothing specifically geared for Netezza. That said, with a bit of understanding of your target environment, it's certainly possible.
We use git and GitHub Enterprise (GHE). The reason for GHE is not particular to this solution, but rather because I work at a hospital. Here's what we do.
Setup
Build a repository at /home/nz on your production server. Depending on how you work nzlogs, nzbads, and other temporary files, you may need to fiddle quite a bit with the .gitignore file. We have dedicated log directories where temporary files should reside.
Push that repo into GHE.
If you have a development server, clone the repo in the /home/nz directory on that server. Clearly you'll lose all development work up until that point and will want to make sure that things like .bashrc are not versioned. Alternatively, you could set up a different branch and repo and try merging the prod and dev versions. We did this, but I'd recommend just wiping your development box with production code one slow day.
Assign your production box a dedicated branch in git. For this discussion, I'll call them prod and dev. Do the same for development, if you have it. This is mainly a mental thing, not a tech thing, but it's crucial, like setting up a remote for Heroku or Azure.
Find or develop a tiny web server that can listen for GitHub webhooks. I built a Sinatra server with a simple configuration file. Anything will do. Deploy the web server to each of the environments and tune them to perform the following activities on an update to the prod or dev branches, respective to the server.
git reset --hard
git clean -f
git pull
Set up webhooks in your GHE repository to send the push event to the web servers.
Of course, you can always have the web server do other things on a branch update if you want to get fancy (maybe update cron from a versioned file or update schemas from all new files).
Process
Fairly simply, follow the GitHub Flow workflow. You can pretty much follow whatever process you want with the understanding that your prod and dev branches should be protected and only removed or futzed with as an admin task. Create a feature branch, test it by pushing to dev, and then make a pull request for the prod branch.
Why GHE? Mainly because it keeps an open area where our code is available. You could absolutely do this by pushing directly to Netezza's git repo, but your workflow will suffer--it just isn't as clean as having all code in one clear place with discussion around pull requests.

How do you set up github version control for a team of two?

We're trying to set up github version control for a Jsp-project in NetBeans 7.0.1. The problem is we don't have a clue what to do. I Have set up a public account on github and done all the steps in the install guide on github, ssh keys and everything. So if I wanted to work on my own in this project I wouldn't have a problem.
The problem is how to get my collaborator started. He has an account on github. he set it up with ssh keys and such. In the admin view on github I added him as a collaborator, but we don't know the next step.
So the question is how to connect the collaborator to the project? something like this I suppose?
git remote add origin git#github.com:username/Hello-World.git
git pull
(another question: Do I git only the source files or the whole project folder?)
Regarding your second question... That's a tough one.
A few months ago I was working with a colleague on a JavaEE project and we initially decided to share the whole Eclipse project. Since I was working on Windows and he was working on Linux, we had much trouble maintaining everything. Also we had to make sure that we don't accidentally push up our .project dir, because that would overwrite the settings on the other persons machine, messing up the whole project. So we ended up removing all the project files from the repository and just keeping the source folders (src and WebContent).
Both of us set up an empty project, made our settings and than imported the source code from the repository. Was some trouble setting it up until everybody had the same project settings, but afterwards it worked like a charm.
For just two developers that is fine, I guess for a bigger team, there might be better solutions.
So, I guess Netbeans handles the project settings in a similar way. So in my opinion you should just share the code.
For the first access, what your collaborator should be able to do is a git clone of your repository.
That will set for him the remote address.
If he is declared as a collaborator, he then should be able to push/pull to that remote repo.
Note that your collaborator should have received a push notification access.

Using 2 SVN repositories for website - publishing question

I am a complete noob to this so if there is a completely obvious answer by all means make fun and point and laugh then give the answer.
We use Visual Studio 2010 to compile our published website. I have a repository that I use for my source code and one which I publish the compiled code to. I then check out the publish repository on the testing server and once it tests good I check out the repository on my main server. This is fine and all but I am using Tortoise SVN and automating the commit. Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit. I just can't get that to happen and have it still recognize it as a SVN repository. Suggestions?
First of all, don't put compiled code into your source repository. It's bad form.
Look at Jenkins as a build server. Jenkins can use the msbuild.exe command to build .NET projects using the .sln file your project creates.
When you do a commit in Subversion, Jenkins will automatically fire off the build. If you have NUnit tests, Jenkins will run those and give you the results. You can have Jenkins store the compiled files for you in its archive. If someone wants to install a particular build, they can directly download it from Jenkins without having to do a checkout in Subversion first.
Jenkins offer all of these advantages:
It shows you all the changes in your repository and what changed in each commit.
It can run all sorts of tests automatically for you.
You can mark builds that are released using the "Simple Promotion" plugin.
You can tag builds in Subversion directly in Jenkins without needing a command line or working directory.
It can alert the developers if a build fails due to bad code, or if testing fails. These alerts can be done via Email, instant messaging, phone text messages, Twitter, and many other ways. All it takes is the right plugin which Jenkins makes easy to install.
Jenkins can act as a release repository which makes it easy to find the release, what's in the release and why.
Jenkins integrates with Bamboo, ViewVC, and Sventon. These are web-based repository browsers. This way Jenkins not only shows you the file changed, but what changed in the file.
Jenkins is easy to use and install. Download it and give it a try.
Unless you have a hard and fast requirement which forces you to use two separate repositories, i'd suggest taking a look at SVN tagging and branching functionality.
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html
Having a repository for the published code really doesn't buy you anything. IMO, you would be better off with a bunch of zip files (one per release) with the date and SVN branch reflected in the name. DO have a changelog .txt file in the zip, and also check that into the repo.
Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit.
You don't need wiping in repo. Just make commit to production repo with exported HEAD from dev-repo (post-commit hook for commit message)
And tags, yes, are more natural and bulletproof way.

Magento - Automated deployments

Are there any automated depoloyment tools out there for Magento sites?
If not does anyone have any best practices so to speak for maintaining and deploying Magento builds across local, staging and products?
This is how I've been working for the past few months and it works pretty well for me.
Install SVN on your server. Or get your host to do it. Or choose a host with SVN in place. Or git.
or
Use Springloops.
The 'trunk' is your live site.
Branches are for staging. Set up the webserver to treat these folders as subdomains.
The live database is regularly copied to branches. This refreshes the data for testing. (Consider anonymizing sales & customer data)
Each repository has it's own "app/etc/local.xml" file. Mark these with SVN:ignore so that one will not upset another.
Also SVN:ignore the "media" and "var" directories.
Each dev has a local webserver for working on. When they finish a change it is deployed to a branch ready for QA.
Nobody except the lead dev is allowed to merge branches to trunk on pain of death!
This means changes in code bubble up to the live site. Copies of the database bubble down to devs. Sometimes copies of the "media" dir are copied downwards as well. Extensions and upgrades are tested on branches too, I dislike using the Connect Manager on a live site.
Been using Git lately, so far liking it much more than SVN, this same flow could be applied to SVN as well I believe:
More details: http://nvie.com/posts/a-successful-git-branching-model/
Currently having, a local VM with a base install of Magento to setup for projects to roll out to new developers is the best approach I think. Most of us just use NetBeans inside the VM and use git pull/pushes as well as some custom build modules for deployment to all of our usual environments: local, integration, UAT, and production. Production or Integration is usually our system of record database wise.
Here is a base .gitignore file to start off with:
https://github.com/github/gitignore/blob/master/Magento.gitignore
A simple Git Deployment:
http://ryanflorence.com/simple-git-deployment/
You can try the packaged Magento that is automatically deployed with a help of Jelastic PaaS https://github.com/jelastic-jps/magento/tree/master/magento
You can get it pre-configured and installed with NGINX or LiteSpeed server and MariaDB.
After customization, you can clone the whole environment in order to get similar replicas for dev, test, stage and production. And when all needed changes are done on the cloned environment, you can just swap domains with current production and thus make the updated version available.
Or you can set up automated update process from Git/SVN.
I'm in the early stages of my first magento site. Its a big project, and my team and I have been discussing this very issue. We've seriously considered using a Git repository to maintain versioning across local, staging and live servers. Here is a good article on the subject. Its obviously focused on Wordpress, but I think the workflow would be almost identical.
And to answer your first question, I know of nothing automated.
We use SVN for very large scale projects. Almost any hosting service for your staging and product environments will be able to provide you with an SVN client to maintain sync with your repository.
Never heard of any automated deployment tools for Magento.

Resources