Skip to content

Commit

Permalink
Testing CircleCI 2.0 builds and deploying to S3.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Nov 9, 2017
1 parent 200b11c commit 29321be
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 48 deletions.
49 changes: 49 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: 2
jobs:
build:
working_directory: ~/app
docker:
- image: circleci/ruby:2.4
steps:
- checkout
- restore_cache:
key: build-deps-{{ checksum "Gemfile.lock" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: build-deps-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run: bundle exec rake
- persist_to_workspace:
root: build
deploy:
docker:
- image: circleci/python:3.6
working_directory: ~/app
steps:
- checkout
- attach_workspace:
at: build
- restore_cache:
key: deploy-deps-{{ checksum "requirements.txt" }}
- run:
command: |
python3 -m venv vendor/venv
. vendor/venv/bin/activate
pip install -r requirements.txt
- save_cache:
key: build-deps-{{ checksum "requirements.txt" }}
paths:
- vendor/venv
- run: aws s3 sync ./build/ s3://${BUCKET_NAME}/ --delete
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: s3
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Ignore local bundle
/vendor/bundle

# Ignore local virtualenv (for awscli)
/vendor/venv

# Ignore the bundler binstubs
/bin

Expand Down
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "https://rubygems.org"

gem "rake", "~> 12.2.1"

# For faster file watcher updates on Windows:
gem "wdm", "~> 0.1.0", platforms: [:mswin, :mingw]

Expand All @@ -13,15 +15,15 @@ gem "middleman-livereload", "~> 3.4.6"
# Syntax highlighting
gem "middleman-syntax", "~> 3.0.0"

# Deploy to GitHub Pages
gem "middleman-gh-pages", "~> 0.3.1"

# Assets
gem "middleman-sprockets", "~> 4.1.0"

# Bootstrap
gem "bootstrap-sass", "~> 3.3.7"

# Asset minification
gem "mini_racer", "~> 0.1.14"

source "https://rails-assets.org" do
# jQuery
gem "rails-assets-jquery", "~> 1.12.4"
Expand Down
22 changes: 12 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (7.1.4)
autoprefixer-rails (7.1.6)
execjs
backports (3.8.0)
backports (3.10.3)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
Expand All @@ -33,7 +33,7 @@ GEM
fast_blank (1.0.0)
fastimage (2.1.0)
ffi (1.9.18)
haml (5.0.3)
haml (5.0.4)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
Expand All @@ -42,6 +42,7 @@ GEM
http_parser.rb (0.6.0)
i18n (0.7.0)
kramdown (1.15.0)
libv8 (5.9.211.38.1)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -79,8 +80,6 @@ GEM
servolux
tilt (~> 2.0)
uglifier (~> 3.0)
middleman-gh-pages (0.3.1)
rake (> 0.9.3)
middleman-livereload (3.4.6)
em-websocket (~> 0.5.1)
middleman-core (>= 3.3)
Expand All @@ -91,6 +90,8 @@ GEM
middleman-syntax (3.0.0)
middleman-core (>= 3.2)
rouge (~> 2.0)
mini_racer (0.1.14)
libv8 (~> 5.9)
minitest (5.10.3)
padrino-helpers (0.13.3.4)
i18n (~> 0.6, >= 0.6.7)
Expand All @@ -99,7 +100,7 @@ GEM
padrino-support (0.13.3.4)
activesupport (>= 3.1)
parallel (1.12.0)
public_suffix (3.0.0)
public_suffix (3.0.1)
rack (2.0.3)
rack-livereload (0.3.16)
rack
Expand All @@ -113,7 +114,7 @@ GEM
rails-assets-numeral (2.0.6)
rails-assets-parsleyjs (2.7.2)
rails-assets-jquery (> 1.8)
rake (12.1.0)
rake (12.2.1)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
Expand All @@ -127,7 +128,7 @@ GEM
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
tzinfo (1.2.3)
tzinfo (1.2.4)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
Expand All @@ -138,18 +139,19 @@ PLATFORMS
DEPENDENCIES
bootstrap-sass (~> 3.3.7)
middleman (~> 4.2.1)
middleman-gh-pages (~> 0.3.1)
middleman-livereload (~> 3.4.6)
middleman-sprockets (~> 4.1.0)
middleman-syntax (~> 3.0.0)
mini_racer (~> 0.1.14)
rails-assets-bootbox (~> 4.4.0)!
rails-assets-font-awesome (~> 4.7.0)!
rails-assets-jquery (~> 1.12.4)!
rails-assets-moment (~> 2.18.1)!
rails-assets-numeral (~> 2.0.0)!
rails-assets-parsleyjs (~> 2.7.0)!
rake (~> 12.2.1)
tzinfo-data
wdm (~> 0.1.0)

BUNDLED WITH
1.15.1
1.16.0
13 changes: 5 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
load "middleman-gh-pages/tasks/gh-pages.rake"

require "rake/testtask"
Rake::TestTask.new do |t|
t.pattern = "test/**/test_*.rb"
Expand All @@ -8,12 +6,11 @@ end
# Build before running tests (since the tests rely on a build).
task :test => [:build]

# Run the tests after building (this doesn't cause an infinite loop with the
# above, since rake tasks only get executed once).
#
# This ensures that we run the tests during the "rake publish" process (which
# calls "build").
Rake::Task["build"].enhance do
task :build do
sh "bundle exec middleman build --clean"

# Run the tests after building (this doesn't cause an infinite loop with the
# above, since rake tasks only get executed once).
Rake::Task["test"].invoke
end

Expand Down
27 changes: 0 additions & 27 deletions circle.yml

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
awscli==1.11.184

0 comments on commit 29321be

Please sign in to comment.