Skip to content
Permalink
Browse files

Automated builds and deploys

  • Loading branch information...
captn3m0 committed Aug 22, 2015
1 parent e681d95 commit deb9977110648742be3031f90669190af0d25d0a
Showing with 85 additions and 3 deletions.
  1. +3 −0 .gitignore
  2. +1 −0 .ruby-version
  3. +7 −2 .travis.yml
  4. +1 −0 Gemfile
  5. +6 −0 Gemfile.lock
  6. +1 −1 README.md
  7. +66 −0 config/deploy.rb
  8. BIN deploy-rsa
@@ -0,0 +1,3 @@
lightsaber-deploy
thin.pid
thin.log
@@ -0,0 +1 @@
2.2.2
@@ -1,4 +1,9 @@
language: ruby
rvm:
- 2.2.2
script: ruby test.rb
- 2.2.2
script: ruby test.rb
deploy:
provider: script
script: bundle exec mina deploy
on:
branch: master
@@ -5,6 +5,7 @@ gem 'sinatra'

group :test do
gem 'minitest'
gem 'mina'
end

group :production do
@@ -3,10 +3,15 @@ GEM
specs:
daemons (1.2.3)
eventmachine (1.0.8)
mina (0.3.7)
open4 (~> 1.3.4)
rake
minitest (5.7.0)
open4 (1.3.4)
rack (1.6.4)
rack-protection (1.5.3)
rack
rake (10.4.2)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
@@ -21,6 +26,7 @@ PLATFORMS
ruby

DEPENDENCIES
mina
minitest
sinatra
thin
@@ -10,7 +10,7 @@ To add a DNS record, point your domain via a CNAME entry to `lightsaber.captnemo
Next, you will need to do the following:

1. Fork this repo
2. Edit the config.yml file and add your redirect in the relevant section
2. Edit the redirects.yml file and add your redirect in the relevant section
3. File a Pull Request with your edit

Once the Pull Request is approved, the redirect will automatically be deployed
@@ -0,0 +1,66 @@
require 'mina/bundler'
require 'mina/git'
require 'mina/rvm'

set :user, 'lightsaber'
set :domain, 'lightsaber.captnemo.in'
set :deploy_to, '/home/lightsaber/lightsaber'
set :repository, 'https://github.com/captn3m0/lightsaber.git'
set :branch, 'master'
set :identity_file, 'lightsaber-deploy'
set :rvm_path, "$HOME/.rvm/scripts/rvm"

# For system-wide RVM install.
# set :rvm_path, '/usr/local/rvm/bin/rvm'

# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
# They will be linked in the 'deploy:link_shared_paths' step.
# set :shared_paths, ['config/database.yml', 'config/secrets.yml', 'log']

# Optional settings:
# set :user, 'foobar' # Username in the server to SSH to.
# set :port, '30000' # SSH port number.
# set :forward_agent, true # SSH forward_agent.

# This task is the environment that is loaded for most commands, such as
# `mina deploy` or `mina rake`.
task :environment do
# If you're using rbenv, use this to load the rbenv environment.
# Be sure to commit your .ruby-version or .rbenv-version to your repository.
queue! "whoami"
invoke :'rvm:use[default]'

# For those using RVM, use this to load an RVM version@gemset.
# invoke :'rvm:use[ruby-1.9.3-p125@default]'
end

# Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between
# all releases.
task :setup => :environment do

end

desc "Deploys the current version to the server."
task :deploy => :environment do
to :before_hook do
# Don't try to decrypt it locally
if ENV['CI'] === 'true'
queue "openssl aes-256-cbc -K $encrypted_82a37ece568a_key -iv $encrypted_82a37ece568a_iv -in deploy-rsa -out lightsaber-deploy -d"
end
end
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'git:clone'
invoke :'bundle:install'

to :launch do
if File.exists?('thin.pid')
queue "bundle exec thin -C config.yml restart"
else
queue "bundle exec thin -C config.yml start"
end
end
end
end
BIN +1.64 KB deploy-rsa
Binary file not shown.

0 comments on commit deb9977

Please sign in to comment.
You can’t perform that action at this time.