Skip to content

Instantly share code, notes, and snippets.

@balser
Last active December 18, 2019 13:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balser/9619485 to your computer and use it in GitHub Desktop.
Save balser/9619485 to your computer and use it in GitHub Desktop.
drone.io (open source edition) config for rails with postgres db, and output, logs, etc.
image: ruby2.0.0
env:
- RAILS_ENV=test
script:
- cp config/drone.database.yml config/database.yml
- bundle install
- psql -c 'create database test;' -U postgres -h 127.0.0.1
- bin/rake db:schema:load
- bin/rake test:all
services:
- postgres
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
75483b8e8fc3 drone-ed5a21876c:latest /bin/sh -c /bin/bash 11 minutes ago Up 11 minutes sleepy_euclid
22f26dca80a0 bradrydzewski/postgres:9.1 /usr/lib/postgresql/ 11 minutes ago Up 11 minutes 127.0.0.1:49176->5432/tcp boring_euclid,sleepy_euclid/postgres
$ git clone --depth=50 --recursive --branch=master git@github.com:balser/drone-rails.git /var/cache/drone/src/github.com/balser/drone-rails
Cloning into '/var/cache/drone/src/github.com/balser/drone-rails'...
Warning: Permanently added 'github.com,192.30.252.128' (RSA) to the list of known hosts.
$ git checkout -qf 4d7e3dec4e1684367c57af096f96714be2215dd3
$ cp config/drone.database.yml config/database.yml
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.1.1)
Installing i18n (0.6.9)
Installing json (1.8.1)
Installing minitest (5.3.1)
Installing atomic (1.1.16)
Installing thread_safe (0.3.0)
Installing tzinfo (1.1.0)
Installing activesupport (4.1.0.rc1)
Installing builder (3.2.2)
Installing erubis (2.7.0)
Installing actionview (4.1.0.rc1)
Installing rack (1.5.2)
Installing rack-test (0.6.2)
Installing actionpack (4.1.0.rc1)
Installing mime-types (1.25.1)
Installing polyglot (0.3.4)
Installing treetop (1.4.15)
Installing mail (2.5.4)
Installing actionmailer (4.1.0.rc1)
Installing activemodel (4.1.0.rc1)
Installing arel (5.0.0)
Installing activerecord (4.1.0.rc1)
Installing coffee-script-source (1.7.0)
Installing execjs (2.0.2)
Installing coffee-script (2.2.0)
Installing thor (0.18.1)
Installing railties (4.1.0.rc1)
Installing coffee-rails (4.0.1)
Installing hike (1.2.3)
Installing multi_json (1.9.0)
Installing jbuilder (2.0.4)
Installing jquery-rails (3.1.0)
Installing pg (0.17.1)
Using bundler (1.3.5)
Installing tilt (1.4.1)
Installing sprockets (2.11.0)
Installing sprockets-rails (2.0.1)
Installing rails (4.1.0.rc1)
Installing rdoc (4.1.1)
Installing sass (3.2.15)
Installing sass-rails (4.0.2)
Installing sdoc (0.4.0)
Installing spring (1.1.2)
Installing turbolinks (2.2.1)
Installing uglifier (2.5.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
$ psql -c 'create database test;' -U postgres -h 127.0.0.1
CREATE DATABASE
$ bin/rake db:schema:load
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
test:
adapter: postgresql
host: 127.0.0.1
database: test
username: postgres
starting service container bradrydzewski/postgres:9.1
creating build image
Step 0 : FROM bradrydzewski/ruby:2.0.0
---> 234bd8089bce
Step 1 : WORKDIR /var/cache/drone/src/github.com/balser/drone-rails
---> Using cache
---> f0f1f251747e
Step 2 : ADD drone /usr/local/bin/
---> 1436e6550564
Step 3 : USER ubuntu
---> Running in 45a47042a522
---> 076305d59400
Step 4 : ENV HOME /home/ubuntu
---> Running in 72582ebc613d
---> fe129d855e39
Step 5 : ENV LANG en_US.UTF-8
---> Running in 75bdf9615124
---> e23fa1638b99
Step 6 : ENV LANGUAGE en_US:en
---> Running in 039bbad81d01
---> b0370592e8ac
Step 7 : ENV LOGNAME ubuntu
---> Running in 32d7005d53b1
---> ed97b95f1073
Step 8 : ENV TERM xterm
---> Running in a00b2bd3dc97
---> d18782a3037e
Step 9 : ENV SHELL /bin/bash
---> Running in c61e47f75d1f
---> 629a9018a453
Step 10 : ADD id_rsa /home/ubuntu/.ssh/id_rsa
---> cab3970b9c4d
Step 11 : RUN sudo chown -R ubuntu:ubuntu /home/ubuntu/.ssh
---> Running in 1c2a3152930a
---> e3304f0433c2
Step 12 : RUN sudo chown -R ubuntu:ubuntu /var/cache/drone
---> Running in 4ab7ed3abe9f
---> 085fb4dfe131
Step 13 : RUN sudo chown -R ubuntu:ubuntu /usr/local/bin/drone
---> Running in 37ac671890a1
---> fd4c0213c3c0
Step 14 : RUN sudo chmod 600 /home/ubuntu/.ssh/id_rsa
---> Running in 2490143c1ae8
---> c1d8212d966e
Step 15 : ADD proxy.sh /etc/drone.d/
---> 63ae576d2649
Step 16 : ENTRYPOINT /bin/bash -e /usr/local/bin/drone
---> Running in 24b062d55a90
---> 8673ad5d57a4
Successfully built 8673ad5d57a4
Removing intermediate container 039bbad81d01
Removing intermediate container 2490143c1ae8
Removing intermediate container 24b062d55a90
Removing intermediate container a00b2bd3dc97
Removing intermediate container 45a47042a522
Removing intermediate container 72582ebc613d
Removing intermediate container 32d7005d53b1
Removing intermediate container c61e47f75d1f
Removing intermediate container 4ab7ed3abe9f
Removing intermediate container b6d3b7a7331b
Removing intermediate container 405f6870d845
Removing intermediate container 75bdf9615124
Removing intermediate container bafd39fdfd64
Removing intermediate container 1c2a3152930a
Removing intermediate container 37ac671890a1
copying repository to /var/cache/drone/src/github.com/balser/drone-rails
starting build
temp directory is /tmp/drone
@gowthamgts
Copy link

Is it possible to enable caching of gems?

@talhashoaib
Copy link

How to give test credentials while running tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment