Skip to content

Commit

Permalink
Merge pull request #332 from ePages-de/develop
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
Unai Abrisketa authored Aug 20, 2018
2 parents 541e176 + 8511306 commit 08df140
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 39 deletions.
77 changes: 40 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
defaults: &defaults
working_directory: ~/repo

deploy: &deploy
docker:
- image: circleci/python:3.6.3
steps:
- attach_workspace:
at: ./
- run:
name: Install AWS CLI
command: pip install awscli --upgrade --user
- run:
name: Download epages-docs
command: |
~/.local/bin/aws s3 sync s3://$S3_BUCKET_NAME ./_site --exclude "about/*" \
--exclude "api/*" \
--exclude "beyond-essence/*" \
--exclude "blog/*" \
--exclude "devjobs/*" \
--exclude "api/*" \
--exclude "assets/css/*" \
--exclude "assets/fonts/*" \
--exclude "assets/img/*" \
--exclude "assets/js/*" \
--exclude "assets/slick/*" \
--exclude "404.html" \
--exclude "index.html"
- run:
name: Upload to S3
command: ~/.local/bin/aws s3 sync ./_site s3://$S3_BUCKET_NAME/ --size-only --delete --acl public-read

version: 2

jobs:
build:
build_test:
<<: *defaults
docker:
- image: circleci/ruby:2.4.2
Expand All @@ -20,72 +49,46 @@ jobs:
name: Bundle Install
command: bundle install
- run:
name: Test posts
command: bundle exec rake test_posts
- run:
name: Test files
command: bundle exec rake test_files
name: Jekyll build
command: bundle exec jekyll build
- run:
name: Test html
command: bundle exec rake test_html
name: Test
command: bundle exec rake test_ci
- save_cache:
key: rubygems-v1-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Jekyll build
command: bundle exec jekyll build
- persist_to_workspace:
root: ./
paths:
- ./_site

deploy_production:
<<: *defaults
docker:
- image: circleci/python:3.6.3
environment:
S3_BUCKET_NAME: developer.epages.com
steps:
- attach_workspace:
at: ./
- run:
name: Install AWS CLI
command: pip install awscli --upgrade --user
- run:
name: Upload to s3
command: ~/.local/bin/aws s3 sync ./_site s3://$S3_BUCKET_NAME/ --delete --acl public-read
<<: *deploy

deploy_staging:
<<: *defaults
docker:
- image: circleci/python:3.6.3
environment:
S3_BUCKET_NAME: staging.developer.epages.com
steps:
- attach_workspace:
at: ./
- run:
name: Install AWS CLI
command: pip install awscli --upgrade --user
- run:
name: Upload to s3
command: ~/.local/bin/aws s3 sync ./_site s3://$S3_BUCKET_NAME/ --delete --acl public-read
<<: *deploy

workflows:
version: 2
build_and_deploy:
build_test_deploy:
jobs:
- build
- build_test
- deploy_production:
requires:
- build
- build_test
filters:
branches:
only: master
- deploy_staging:
requires:
- build
- build_test
filters:
branches:
only: develop
8 changes: 6 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,16 @@ task :test_html do
check_html: true,
allow_hash_href: true }

sh 'bundle exec jekyll build'

HTMLProofer.check_directory('./_site', options).run
end

task :test do
sh 'bundle exec jekyll build'

sh 'rake test_ci'
end

task :test_ci do
sh 'rake test_html'
sh 'rake test_files'
sh 'rake test_posts'
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ exclude:
- config/
- log/
- vendor
- LICENSE-CC-BY-40.txt

feed:
path: /blog/feed.xml
Expand Down

0 comments on commit 08df140

Please sign in to comment.