-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
153 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- 2.3.0 | ||
install: | ||
- bundle install --path vendor/bundle | ||
- eval "$(ssh-agent -s)" | ||
script: bundle exec rake travis:deploy | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,10 @@ | ||
directory "vendor" | ||
directory "vendor/bundler" => ["vendor"] do | ||
system "git clone https://github.com/bundler/bundler.git vendor/bundler" | ||
end | ||
|
||
task :update_vendor => ["vendor/bundler"] do | ||
Dir.chdir("vendor/bundler") { sh "git fetch" } | ||
end | ||
|
||
VERSIONS = Dir.chdir("source") { Dir.glob("v*").sort_by{|x| [x.size, x] } }.freeze | ||
desc "Print the Bundler versions the site documents" | ||
task :versions do | ||
puts VERSIONS.join(' ') | ||
end | ||
|
||
desc "Pull in the man pages for the specified gem versions." | ||
task :man => [:update_vendor] do | ||
VERSIONS.each do |version| | ||
next if version == "v0.9" | ||
branch = (version[1..-1].split('.') + %w(stable)).join('-') | ||
|
||
rm_rf "source/#{version}/man" | ||
mkdir_p "source/#{version}/man" | ||
|
||
Dir.chdir "vendor/bundler" do | ||
sh "git reset --hard HEAD" | ||
sh "git checkout origin/#{branch}" | ||
sh "ronn -5 man/*.ronn" | ||
cp(FileList["man/*.html"], "../../source/#{version}/man") | ||
sh "git clean -fd" | ||
end | ||
end | ||
|
||
# Make man pages for the latest version available at the top level, too. | ||
rm_rf "source/man" | ||
cp_r "source/#{VERSIONS.last}/man", "source" | ||
end | ||
|
||
desc "Pulls in pages maintained in the bundler repo." | ||
task :repo_pages => [:update_vendor] do | ||
Dir.chdir "vendor/bundler" do | ||
sh "git reset --hard HEAD" | ||
sh "git checkout origin/master" | ||
cp "ISSUES.md", "../../source/issues.md" | ||
cp "CODE_OF_CONDUCT.md", "../../source/conduct.md" | ||
end | ||
end | ||
|
||
directory "vendor/bundler.github.io" => ["vendor"] do | ||
system "git clone https://github.com/bundler/bundler.github.io.git vendor/bundler.github.io" | ||
end | ||
|
||
task :update_site => ["vendor/bundler.github.io"] do | ||
Dir.chdir "vendor/bundler.github.io" do | ||
sh "git checkout master" | ||
sh "git reset --hard HEAD" | ||
sh "git pull origin master" | ||
end | ||
end | ||
Dir.glob("lib/tasks/**/*.rake").each { |r| load r } | ||
|
||
desc "Build the static site" | ||
task :build => [:repo_pages, :man] do | ||
sh "middleman build --clean" | ||
end | ||
|
||
desc "Release the current commit to bundler/bundler.github.io" | ||
task :release => [:build, :update_site] do | ||
commit = `git rev-parse HEAD`.chomp | ||
|
||
Dir.chdir "vendor/bundler.github.io" do | ||
rm_rf FileList["*"] | ||
cp_r FileList["../../build/*"], "./" | ||
File.write("CNAME", "bundler.io") | ||
|
||
sh "git add -A ." | ||
sh "git commit -m 'bundler/bundler-site@#{commit}'" | ||
|
||
Bundler.with_clean_env do | ||
puts <<-TWO_FACTOR_WARNING | ||
==================================================================== | ||
Please note that if you have two-factor auth enabled for your Github | ||
account, you will need to use a github access token instead of your | ||
account password. | ||
==================================================================== | ||
TWO_FACTOR_WARNING | ||
sh "git push origin master" | ||
end | ||
end | ||
|
||
Bundler.with_clean_env do | ||
sh "git push origin master" | ||
end | ||
end | ||
|
||
# Heroku deploys need to build the non-Middleman pages | ||
namespace :assets do | ||
task :precompile => [:repo_pages, :man] | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
desc "Pull in the man pages for the specified gem versions." | ||
task :man => [:update_vendor] do | ||
VERSIONS.each do |version| | ||
next if version == "v0.9" | ||
branch = (version[1..-1].split('.') + %w(stable)).join('-') | ||
|
||
rm_rf "source/#{version}/man" | ||
mkdir_p "source/#{version}/man" | ||
|
||
Dir.chdir "vendor/bundler" do | ||
sh "git reset --hard HEAD" | ||
sh "git checkout origin/#{branch}" | ||
sh "ronn -5 man/*.ronn" | ||
cp(FileList["man/*.html"], "../../source/#{version}/man") | ||
sh "git clean -fd" | ||
end | ||
end | ||
|
||
# Make man pages for the latest version available at the top level, too. | ||
rm_rf "source/man" | ||
cp_r "source/#{VERSIONS.last}/man", "source" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
desc "Release the current commit to bundler/bundler.github.io" | ||
task :release => [:build, :update_site] do | ||
commit = `git rev-parse HEAD`.chomp | ||
|
||
Dir.chdir "vendor/bundler.github.io" do | ||
rm_rf FileList["*"] | ||
cp_r FileList["../../build/*"], "./" | ||
File.write("CNAME", "bundler.io") | ||
|
||
sh "git add -A ." | ||
sh "git commit -m 'bundler/bundler-site@#{commit}'" | ||
|
||
Bundler.with_clean_env do | ||
puts <<-TWO_FACTOR_WARNING | ||
==================================================================== | ||
Please note that if you have two-factor auth enabled for your Github | ||
account, you will need to use a github access token instead of your | ||
account password. | ||
==================================================================== | ||
TWO_FACTOR_WARNING | ||
sh "git push origin master" | ||
end | ||
end | ||
|
||
Bundler.with_clean_env do | ||
sh "git push origin master" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace :travis do | ||
def encrypted_key | ||
ENV["encrypted_#{ENV["ENCRYPTION_LABEL"]}_key"] | ||
end | ||
|
||
def encrypted_iv | ||
ENV["encrypted_#{ENV["ENCRYPTION_LABEL"]}_iv"] | ||
end | ||
|
||
def commit_author_email | ||
ENV["COMMIT_AUTHOR_EMAIL"] | ||
end | ||
|
||
def configure_ssh_deploy_key | ||
sh "openssl aes-256-cbc -K #{encrypted_key} -iv #{encrypted_iv} -in deploy_key.enc -out deploy_key -d" | ||
sh "chmod 600 deploy_key" | ||
sh "ssh-add deploy_key" | ||
sh "rm deploy_key" | ||
end | ||
|
||
task :deploy => [:build] do | ||
configure_ssh_deploy_key | ||
|
||
Rake::Task["travis:update_ssh_site"].invoke | ||
|
||
commit = `git rev-parse HEAD`.chomp | ||
|
||
Dir.chdir "vendor/ssh_bundler.github.io" do | ||
rm_rf FileList["*"] | ||
cp_r FileList["../../build/*"], "./" | ||
File.write("CNAME", "bundler.io") | ||
|
||
sh "git add -A ." | ||
|
||
sh "git config user.name 'Travis CI'" | ||
sh "git config user.email '#{commit_author_email}'" | ||
|
||
sh "git commit -m 'bundler/bundler-site@#{commit}'" | ||
sh "git push origin master" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
directory "vendor/ssh_bundler.github.io" => ["vendor"] do | ||
system "git clone git@github.com:bundler/bundler.github.io vendor/ssh_bundler.github.io" | ||
end | ||
|
||
namespace :travis do | ||
task :update_ssh_site => ["vendor/ssh_bundler.github.io"] do | ||
Dir.chdir "vendor/ssh_bundler.github.io" do | ||
sh "git checkout master" | ||
sh "git reset --hard HEAD" | ||
sh "git pull origin master" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
directory "vendor" | ||
directory "vendor/bundler" => ["vendor"] do | ||
system "git clone https://github.com/bundler/bundler.git vendor/bundler" | ||
end | ||
|
||
task :update_vendor => ["vendor/bundler"] do | ||
Dir.chdir("vendor/bundler") { sh "git fetch" } | ||
end | ||
|
||
desc "Pulls in pages maintained in the bundler repo." | ||
task :repo_pages => [:update_vendor] do | ||
Dir.chdir "vendor/bundler" do | ||
sh "git reset --hard HEAD" | ||
sh "git checkout origin/master" | ||
cp "ISSUES.md", "../../source/issues.md" | ||
cp "CODE_OF_CONDUCT.md", "../../source/conduct.md" | ||
end | ||
end | ||
|
||
directory "vendor/bundler.github.io" => ["vendor"] do | ||
system "git clone https://github.com/bundler/bundler.github.io vendor/bundler.github.io" | ||
end | ||
|
||
task :update_site => ["vendor/bundler.github.io"] do | ||
Dir.chdir "vendor/bundler.github.io" do | ||
sh "git checkout master" | ||
sh "git reset --hard HEAD" | ||
sh "git pull origin master" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
VERSIONS = Dir.chdir("source") { Dir.glob("v*").sort_by{|x| [x.size, x] } }.freeze | ||
|
||
desc "Print the Bundler versions the site documents" | ||
task :versions do | ||
puts VERSIONS.join(' ') | ||
end |