-
Notifications
You must be signed in to change notification settings - Fork 375
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
1 parent
edd3d55
commit 2a83cc4
Showing
3 changed files
with
143 additions
and
108 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
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
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 'create a new indexed repository' | ||
task :'release:gem' do | ||
raise 'Missing environment variable S3_DIR' if !S3_DIR || S3_DIR.empty? | ||
# load existing deployed gems | ||
sh "aws s3 cp --exclude 'docs/*' --recursive s3://#{S3_BUCKET}/#{S3_DIR}/ ./rubygems/" | ||
|
||
# create folders | ||
sh 'mkdir -p ./gems' | ||
sh 'mkdir -p ./rubygems/gems' | ||
|
||
# build the gem | ||
Rake::Task['build'].execute | ||
|
||
# copy the output in the indexed folder | ||
sh 'cp pkg/*.gem ./rubygems/gems/' | ||
|
||
# generate the gems index | ||
sh 'gem generate_index -v --no-modern -d ./rubygems' | ||
|
||
# remove all local repository gems to limit files needed to be uploaded | ||
sh 'rm -f ./rubygems/gems/*' | ||
|
||
# re-add new gems | ||
sh 'cp pkg/*.gem ./rubygems/gems/' | ||
|
||
# deploy a static gem registry | ||
sh "aws s3 cp --recursive ./rubygems/ s3://#{S3_BUCKET}/#{S3_DIR}/" | ||
end |