Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from shawnzhu/ci
Browse files Browse the repository at this point in the history
Enables Travis CI
  • Loading branch information
shawnzhu authored Aug 22, 2017
2 parents d099b77 + 4f86300 commit 620e92c
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spec/
.git
.gitignore
.travis.yml
Gemfile
Gemfile.lock
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gemfile.lock
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sudo: required

services:
- docker

install: bundle

script: bundle exec rspec
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ MAINTAINER kzhu
ENV PRESTO_VERSION=0.181
ENV PRESTO_HOME=/opt/presto

ADD https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz /opt

RUN ln -s /opt/presto-server-${PRESTO_VERSION} ${PRESTO_HOME} && \
mkdir -p ${PRESTO_HOME}/data
RUN curl -L https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz -o /tmp/presto-server.tgz && \
tar -xzf /tmp/presto-server.tgz -C /opt && \
ln -s /opt/presto-server-${PRESTO_VERSION} ${PRESTO_HOME} && \
mkdir -p ${PRESTO_HOME}/data && \
rm -f /tmp/presto-server.tgz

COPY etc ${PRESTO_HOME}/etc
EXPOSE 8080
Expand All @@ -16,4 +17,6 @@ VOLUME ["${PRESTO_HOME}/etc", "${PRESTO_HOME}/data"]

WORKDIR ${PRESTO_HOME}

CMD ["./bin/launcher", "run"]
ENTRYPOINT ["./bin/launcher"]

CMD ["run"]
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://rubygems.org'

group :integration do
gem 'serverspec'
gem 'docker'
gem 'docker-api', :require => 'docker'
end
29 changes: 29 additions & 0 deletions spec/prestodb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'serverspec'
require 'docker'

describe 'shawnzhu/prestodb' do
before(:all) do
image = Docker::Image.build_from_dir('.')

set :backend, :docker
set :docker_image, image.id
end

describe file('/opt/presto-server-0.181') do
it { should be_directory }
end

describe file('/opt/presto') do
it { should be_symlink }
end

describe file('/opt/presto/data') do
it { should be_directory }
end

describe command('ls /opt/presto/etc/') do
%w{catalog config.properties jvm.config node.properties}.each do |file|
its(:stdout) { should contain(file) }
end
end
end

0 comments on commit 620e92c

Please sign in to comment.