Skip to content

Commit 7a7e255

Browse files
committed
setup for release
1 parent 036bef5 commit 7a7e255

4 files changed

Lines changed: 32 additions & 5 deletions

File tree

‎.travis.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ rvm:
55
branches:
66
only:
77
- master
8-
script: bundle exec rspec spec
8+
before_script: bundle exec rspec spec
9+
script: bundle exec rake generate
10+
after_success: bundle exec rake release
911
env:
1012
global:
1113
secure: KLuKTR30DpaXXh3Vr0LoSYhXn7OsPL/yR5yoRUKB7C6MKxPFt+5gHzdPbXcx/hrcheXkQad4elxkco8qQiKWe4hNeorQFssbsvVSe2P5s2GMaYJma+WdEwDlYwsjpP98xIQ4v5vRamXehfpB8jy/n+mlvdGAIiXA/d1ka9BpkJI=

‎Gemfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22
ruby '2.2.0' unless ENV['DEV']
33

4-
gem 'rake', '~> 10.0'
4+
gem 'rake'
55
gem 'github-pages'
66
gem 'kramdown'
77
gem 'travis'

‎Gemfile.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ GEM
155155
rspec-support (~> 3.1.0)
156156
rspec-support (3.1.2)
157157
safe_yaml (1.0.4)
158-
sass (3.4.9)
158+
sass (3.4.10)
159159
slop (3.6.0)
160160
spidr (0.4.1)
161161
nokogiri (~> 1.3)
@@ -165,7 +165,7 @@ GEM
165165
hitimes
166166
toml (0.1.2)
167167
parslet (~> 1.5.0)
168-
travis (1.7.4)
168+
travis (1.7.5)
169169
addressable (~> 2.3)
170170
backports
171171
faraday (~> 0.9)
@@ -193,7 +193,7 @@ PLATFORMS
193193
DEPENDENCIES
194194
github-pages
195195
kramdown
196-
rake (~> 10.0)
196+
rake
197197
rspec
198198
spidr (~> 0.4)
199199
travis

‎Rakefile‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ task :preview do
2222
sh 'jekyll serve --watch'
2323
end
2424

25+
desc "Release the current commit to ruby-korea/ruby-korea.github.io@master"
26+
task :release do
27+
commit = `git rev-parse HEAD`.chomp
28+
system "mkdir -p vendor/ruby-korea.github.io"
29+
system "git clone https://github.com/ruby-korea/ruby-korea.github.io.git vendor/ruby-korea.github.io"
30+
31+
Dir.chdir "vendor/ruby-korea.github.io" do
32+
sh "git config user.name '#{ENV['GIT_NAME']}'"
33+
sh "git config user.email '#{ENV['GIT_EMAIL']}'"
34+
sh 'git config credential.helper "store --file=.git/credentials"'
35+
File.open('.git/credentials', 'w') do |f|
36+
f.write("https://#{ENV['GH_TOKEN']}:@github.com")
37+
end
38+
sh "git reset --hard HEAD"
39+
sh "git checkout master"
40+
sh "git pull origin master"
41+
42+
rm_rf FileList["*"]
43+
cp_r FileList["../../_site/*"], "./"
44+
sh "git add -A ."
45+
sh "git commit -m 'ruby-korea/ruby-korea.github.io@#{commit}'"
46+
sh "git push origin master"
47+
end
48+
end
49+
2550
namespace :check do
2651
desc 'validate _site markup with validate-website'
2752
task :markup => :generate do

0 commit comments

Comments
 (0)