background preloader

Automation

Facebook Twitter

Using Git to manage a web site. The HTML source for my (i.e., this) web site lives in a Git repository on my local workstation. This page describes how I set things up so that I can make changes live by running just "git push web". The one-line summary: push into a remote repository that has a detached work tree, and a post-receive hook that runs "git checkout -f".

The local repository It doesn't really matter how the local repository is set up, but for the sake of argument, let's suppose you're starting one from scratch. $ mkdir website && cd website $ git init Initialized empty Git repository in /home/ams/website/.git/ $ echo 'Hello, world!

' > index.html $ git add index.html $ git commit -q -m "The humble beginnings of my web site. " Anyway, however you got there, you have a repository whose contents you want to turn into a web site. The remote repository On the server, we create a new repository to mirror the local one. $ mkdir /var/www/www.example.org $ cat > hooks/post-receive #! The update process $ git push web Notes.

Introduction to Puppet: Streamlined System Configuration. If you have one Linux system to administer, you need a good working knowledge of scripting, command line utilities, and a trusty text editor. If you have two or more, it may be time to add Puppet to that list. Every good system administrator strives to automate repetitive tasks so that they can free up their time to focus on more important matters. It's the difference between spending a work day running the same set of commands on 20 different systems, or spending a work day improving a piece of infrastructure or testing a new open source tool that might be useful for your organization.

Also, it's just plain fun to know you can run a single command and accomplish what it would have taken half a day to finish. In this piece, we'll take a look at what Puppet is and some basics of installing and using Puppet on a single machine. In the next tutorial, we'll get into the nitty gritty and focus on configuring Puppet and some more concrete examples. What is Puppet? Basic Puppetry ralsh user norm. Setting up a new remote git repository. (a gist based on the old toolmantim article on setting up remote repos) To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories. This is somewhat of a follow-up to the previous article setting up a new rails app with git. For the impatient Set up the new bare repo on the server: $ ssh myserver.com Welcome to myserver.com! $ mkdir /var/git/myapp.git && cd /var/git/myapp.git $ git --bare init Initialized empty Git repository in /var/git/myapp.git $ exit Bye!

Add the remote repository to your existing local git repo and push: $ cd ~/Sites/myapp $ git remote add origin user@myserver.com:/var/git/myapp.git $ git push origin master Set the local master branch to track the remote branch. Read further for a step-by-step explanation of what’s going on. Pre-flight sanity check Setting up a remote repository is fairly simple but somewhat confusing at first. . $ cd ~/Sites/myapp $ git remote None. . $ git branch -a * master A pretty bare-minimum config file. Chef - Opscode. Vagrant - Welcome. Heroku | Ruby Cloud Platform as a Service.