Skip to content
Permalink
Browse files

Testing Circle 2.0 config - 1

  • Loading branch information...
Francois Barbanson authored and yelidrissi committed Oct 10, 2018
1 parent 618e06c commit 2b771ec389dc63f24f3f4a3d5bb9f873e7dc143e
Showing with 44 additions and 27 deletions.
  1. +22 −0 .circleci/config.yml
  2. +1 −4 Dockerfile
  3. +20 −8 Thorfile
  4. +0 −14 circle.yml
  5. +1 −1 sitediff.gemspec
@@ -0,0 +1,22 @@
version: 2
jobs:
build:

docker:
- image: circleci/ruby:2.5.1

steps:
- checkout
- setup_remote_docker
- run: bundle install
- run: bundle exec thor docker:build
- run: bundle exec thor docker:compose spec --local
- run: bundle exec thor docker:compose spec --no-local
- run: bundle exec thor docker:compose fixture:local --local
- run: bundle exec thor docker:compose fixture:local --no-local

# FIXME currently sitediff's exit code differs from what you expect from a
# 'diff' (non-zero status only when it crashes). When we fix that, the
# following should be guarded from non-zero exit codes.


@@ -19,13 +19,10 @@ ENV NOKOGIRI_USE_SYSTEM_LIBRARIES 1

# Install thor and rspec globally so we can test the gem without bundle exec
RUN gem install thor rspec --no-rdoc --no-ri

ADD . /sitediff
COPY . /sitediff
WORKDIR /sitediff

RUN apt-get install -y build-essential patch ruby-dev zlib1g-dev liblzma-dev


RUN apt-get remove -y bundler && gem install bundler
RUN bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/
RUN gem install nokogiri -v 1.8.2
@@ -45,15 +45,27 @@ class Docker < Base
desc 'run', 'Run a rake task (or a login shell if none given) inside docker'
def run_(task = 'bash')
docker_opts = ['-t', "-v #{File.dirname(__FILE__)}:/sitediff"]
if task == 'bash'
cmd = 'bash'
docker_opts << '-i'
else
# pass down the local flag to docker command
cmd = "#{executable('thor')} #{task} #{@local ? '--local' : '--no-local'}"
finish_exec(task, docker_opts)
end

desc 'compose', 'Run a task inside docker without volume mounting (not supported with compose)'
def compose(task = 'bash')
docker_opts = ['-t']
finish_exec(task, docker_opts)
end

no_commands do
def finish_exec(task, docker_opts)
if task == 'bash'
cmd = 'bash'
docker_opts << '-i'
else
# pass down the local flag to docker command
cmd = "#{executable('thor')} #{task} #{@local ? '--local' : '--no-local'}"
end
puts "docker run #{docker_opts.join(' ')} #{IMAGE} #{cmd}"
run "docker run #{docker_opts.join(' ')} #{IMAGE} #{cmd}"
end
puts "docker run #{docker_opts.join(' ')} #{IMAGE} #{cmd}"
run "docker run #{docker_opts.join(' ')} #{IMAGE} #{cmd}"
end
end

This file was deleted.

@@ -18,7 +18,7 @@ DESC
s.bindir = 'bin'
s.executables = 'sitediff'

# Apprently we require pkg-config
# Apparently we require pkg-config
s.add_dependency 'pkg-config', '~> 1.1'

s.add_dependency 'thor', '~> 0.20.0'

0 comments on commit 2b771ec

Please sign in to comment.
You can’t perform that action at this time.