forked from docker-library/ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue/83-make-rake-tasks-accept-variables-and-upgrade-j…
…ekyll' into 'master' upgrades jekyll, adds more dynamic rake tasks Closes docker-library#83 See merge request static-websites/techrangers-website!75
- Loading branch information
Showing
7 changed files
with
127 additions
and
60 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
--- | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_PATH: vendor/bundle | ||
BUNDLE_DISABLE_SHARED_GEMS: '1' |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.DS_Store | ||
*/.DS_Store | ||
_site/ | ||
vendor |
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 |
---|---|---|
@@ -1,29 +1,59 @@ | ||
cloudfront_distribution_id = 'E1XOBY74UMJI29' | ||
desc 'build and watch for dev' | ||
task :dev do | ||
sh "bundle exec jekyll serve --livereload" | ||
end | ||
|
||
desc 'build and watch for dev inside docker' | ||
task :dev_docker do | ||
# docker requires you bind to 0.0.0.0 | ||
sh "bundle exec jekyll serve --livereload --host=0.0.0.0 --port=4000 --livereload-port=35729" | ||
end | ||
|
||
desc 'Build for deploy' | ||
task :build_for_deploy do | ||
# right now this just runs build | ||
# but we could put some more post-processing scripts in here | ||
sh "JEKYLL_ENV=production bundle exec jekyll build" | ||
end | ||
|
||
|
||
# sync files from _site up to s3 | ||
# deletes files that exist on the target and dont exist locally | ||
# sets acl to public read for all files | ||
# sets cache control max age to 24 hours | ||
# requires | ||
desc 'Publish website to S3' | ||
task :deploy_production do | ||
# sync files from _site up to s3 | ||
# deletes files that exist on the target and dont exist locally | ||
# sets acl to public read for all files | ||
# sets cache control max age to 24 hours | ||
sh "aws s3 sync ./_site/ s3://ucfcdl-website-techrangers/ --acl public-read --delete --cache-control max-age=86400" | ||
task :deploy_production, [:bucket] do |task, args| | ||
if args[:bucket].nil? | ||
raise "bucket argument required" | ||
end | ||
|
||
sh "aws s3 sync ./_site/ s3://#{args[:bucket]}/ --acl public-read --delete --cache-control max-age=86400" | ||
puts "Site published" | ||
end | ||
|
||
|
||
# Now we need to invalidate the cloudfront cache for the site | ||
# this takes time! don't run this over and over | ||
# todo - build a list of the files that changed and only invalidate those | ||
desc 'Clears cache from cloudfront' | ||
task :invalidate_cdn_cache do | ||
# Now we need to invalidate the cloudfront cache for the site | ||
# this takes time! don't run this over and over | ||
# todo - build a list of the files that changed and only invalidate those | ||
sh "aws cloudfront create-invalidation --paths '/*' --distribution-id #{cloudfront_distribution_id}" | ||
task :invalidate_cdn_cache, [:cloudfront_distribution_id] do |task, args| | ||
if args[:cloudfront_distribution_id].nil? | ||
raise "cloudfront_distribution_id argument required" | ||
end | ||
sh "aws cloudfront create-invalidation --paths '/*' --distribution-id #{args[:cloudfront_distribution_id]}" | ||
puts "Cache invalidation requested" | ||
end | ||
|
||
|
||
# Now we need to invalidate the cloudfront cache for the site | ||
# this takes time! don't run this over and over | ||
# todo - build a list of the files that changed and only invalidate those | ||
desc 'show cloudfront invalidations' | ||
task :show_invalidations do | ||
# Now we need to invalidate the cloudfront cache for the site | ||
# this takes time! don't run this over and over | ||
# todo - build a list of the files that changed and only invalidate those | ||
sh "aws cloudfront list-invalidations --distribution-id #{cloudfront_distribution_id}" | ||
task :show_invalidations, [:cloudfront_distribution_id] do |task, args| | ||
if args[:cloudfront_distribution_id].nil? | ||
raise "cloudfront_distribution_id argument required" | ||
end | ||
|
||
sh "aws cloudfront list-invalidations --distribution-id #{args[:cloudfront_distribution_id]}" | ||
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
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 |
---|---|---|
|
@@ -16,11 +16,11 @@ | |
title: Techrangers | ||
email: [email protected] | ||
description: >- # this means to ignore newlines until "baseurl:" | ||
The Techrangers® is a team of students at the Center for Distributed Learning, | ||
who provide course development for faculty and web/application development for | ||
The Techrangers® is a team of students at the Center for Distributed Learning, | ||
who provide course development for faculty and web/application development for | ||
the University of Central Florida (UCF). | ||
baseurl: "" # the subpath of your site, e.g. /blog | ||
url: "http://techrangers.cdl.ucf.edu" # the base hostname & protocol for your site, e.g. http://example.com | ||
url: "https://techrangers.cdl.ucf.edu" # the base hostname & protocol for your site, e.g. http://example.com | ||
google_analytics: UA-36116523-10 | ||
|
||
# Build settings | ||
|
@@ -52,11 +52,10 @@ future: true | |
# Exclude from processing. | ||
# The following items will not be processed, by default. Create a custom list | ||
# to override the default setting. | ||
# exclude: | ||
# - Gemfile | ||
# - Gemfile.lock | ||
# - node_modules | ||
# - vendor/bundle/ | ||
# - vendor/cache/ | ||
# - vendor/gems/ | ||
# - vendor/ruby/ | ||
exclude: | ||
- RAKEFILE | ||
- Gemfile | ||
- Gemfile.lock | ||
- README.MD | ||
- dockerfile | ||
- vendor |