Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 vlad-version.gemspec
README.md

Vlad Version

Vlad tasks for creating a version file and version tag upon deploy so it’s seamless and easy to keep track of what is deployed where.

Installation

Add this line to your application's Gemfile:

gem 'vlad-version', :require => false

And then execute:

$ bundle

Or install it yourself as:

$ gem install vlad-version

Usage

Then add to your config/deploy.rb:

require 'vlad/version'

Two tasks are provided that you can add into your existing deploy task(s):

  • vlad:version:file which creates a file in #{shared_path}/#{version_file_path} with the date of the deploy and the Git revision deployed.
  • vlad:version:tag which creates a Git tag with the name #{environment}_#{release_time} containing the environment deployed to, time of deploy, and who deployed.

The following variables are available:

Variable Default value
release_time Time.now.utc
sign_version_tag false
version_file_path "/system/version.txt"

In order to ensure release_time is consistent with Vlad’s release_name, release_name is set to release_time.strftime('%Y%m%d%H%M%S'), which maintains the same format as Vlad’s default. If you override release_name to another time-based format, you should use release_time as your source time to maintain consistency.

If the environment variable is set in your deploy configuration, it will be prefixed onto the Git tag name.

Contributing

Contributions are welcome. Please be sure that your pull requests are atomic so they can be considered and accepted separately.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits & License

Copyright © 2012 J. Andrew Marshall. All rights reserved. License is available in the LICENSE file.

Something went wrong with that request. Please try again.