.drone.yml in apress-api-1.24.0 vs .drone.yml in apress-api-1.24.2
- old
+ new
@@ -1,30 +1,72 @@
-build:
- test:
- image: abakpress/dind-testing
- privileged: true
- pull: true
- volumes:
- - /home/data/drone/images:/images
- - /home/data/drone/gems:/bundle
- environment:
- - COMPOSE_FILE_EXT=drone
- - RUBY_IMAGE_TAG=2.2-latest
- - POSTGRES_IMAGE_TAG=9.3-latest
- commands:
- - wrapdocker docker -v
+---
+kind: pipeline
+type: docker
+name: build
- - fetch-images --image abakpress/ruby-app:$RUBY_IMAGE_TAG
+volumes:
+ - name: rubygems
+ host:
+ path: /home/data/drone/rubygems
+ - name: bundle
+ host:
+ path: /home/data/drone/gems
- - dip provision
- - dip rspec
+spec_step_common: &spec_step_common
+ pull: if-not-exists
+ volumes:
+ - name: bundle
+ path: /bundle
+ commands:
+ - rm -fr Gemfile.lock gemfiles/
+ - bundle install -j 5
+ - bundle exec appraisal install
+ - bundle exec appraisal bundle exec rspec
- release:
- image: abakpress/gem-publication
- pull: true
- when:
- event: push
- branch: master
- volumes:
- - /home/data/drone/rubygems:/root/.gem
- commands:
- - release-gem --public
+steps:
+- name: postgres
+ image: abakpress/postgres-db:9.6-latest
+ pull: if-not-exists
+ environment:
+ POSTGRES_DB: docker
+ detach: true
+
+- name: build on ruby2.2
+ image: abakpress/ruby-app:2.2-latest
+ environment:
+ TEST_DB_HOST: postgres
+ TEST_DB_NAME: docker
+ TEST_DB_USERNAME: postgres
+ BUNDLE_PATH: /bundle/2.2
+ <<: *spec_step_common
+
+- name: build on ruby2.3
+ image: abakpress/ruby-app:2.3-latest
+ environment:
+ TEST_DB_HOST: postgres
+ TEST_DB_NAME: docker
+ TEST_DB_USERNAME: postgres
+ BUNDLE_PATH: /bundle/2.3
+ <<: *spec_step_common
+
+- name: build on ruby2.4
+ image: abakpress/ruby-app:2.4-latest
+ environment:
+ TEST_DB_HOST: postgres
+ TEST_DB_NAME: docker
+ TEST_DB_USERNAME: postgres
+ BUNDLE_PATH: /bundle/2.4
+ <<: *spec_step_common
+
+- name: release
+ image: abakpress/gem-publication:latest
+ pull: if-not-exists
+ when:
+ event: push
+ branch: master
+ status: success
+ volumes:
+ - name: rubygems
+ path: /root/.gem
+ commands:
+ - release-gem --public
+