From fdaffaeac19b886d4a6f85f1fa894ab840dd5aa3 Mon Sep 17 00:00:00 2001 From: Mark Pundsack Date: Tue, 21 Jun 2016 20:36:49 -0700 Subject: [PATCH 1/2] Add more complicated Ruby example --- Ruby-with-build.gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Ruby-with-build.gitlab-ci.yml diff --git a/Ruby-with-build.gitlab-ci.yml b/Ruby-with-build.gitlab-ci.yml new file mode 100644 index 0000000..7239887 --- /dev/null +++ b/Ruby-with-build.gitlab-ci.yml @@ -0,0 +1,39 @@ +# Official language image. Look for the different tagged releases at: +# https://hub.docker.com/r/library/ruby/tags/ +image: "ruby:2.3" + +# Cache gems in between builds +cache: + key: "$CI_BUILD_STAGE" + paths: + - vendor/ruby + +# This is a basic example for a gem or script which doesn't use +# services such as redis or postgres +build: + stage: build + script: + - ruby -v # Print out ruby version for debugging + - gem install bundler --no-ri --no-rdoc --path vendor # Bundler is not installed with the image + - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby + artifacts: + untracked: true + expires_in: 1 week + +# Optional - Delete if not using `rubocop` +rubocop: + script: + - rubocop + +rails: + # Pick zero or more services to be used on all builds. + # Only needed when using a docker container to run your tests in. + # Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service + services: + # - mysql:latest + # - redis:latest + # - postgres:latest + script: + - bundle exec rake db:migrate + - bundle exec rake test # If using default rake tests + #- rspec spec # If using rspec From 3be4dea0f49c8e553b985ffdbe4b17a240df0cc5 Mon Sep 17 00:00:00 2001 From: Mark Pundsack Date: Tue, 21 Jun 2016 20:40:15 -0700 Subject: [PATCH 2/2] Fix bundler --- Ruby-with-build.gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Ruby-with-build.gitlab-ci.yml b/Ruby-with-build.gitlab-ci.yml index 7239887..a1e7c0d 100644 --- a/Ruby-with-build.gitlab-ci.yml +++ b/Ruby-with-build.gitlab-ci.yml @@ -8,14 +8,14 @@ cache: paths: - vendor/ruby -# This is a basic example for a gem or script which doesn't use -# services such as redis or postgres +before_script: + - gem install bundler --no-ri --no-rdoc # Bundler is not installed with the image + build: stage: build script: - - ruby -v # Print out ruby version for debugging - - gem install bundler --no-ri --no-rdoc --path vendor # Bundler is not installed with the image - - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby + - ruby -v # Print out ruby version for debugging + - bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby artifacts: untracked: true expires_in: 1 week