greenlight/.gitlab-ci.yml
Jesus Federico 9b2424cde0
GRN2-112: Default language fallback fails with a 500 error (#469)
* GRN2-112: Default language fallback fails with a 500 error

* Updates for passing rspec tests

* Added cache for gitlab ci

* Updated cache for gitlab

* Restored Dockerfile

* Fixed glitch in filter for build and deployment
2019-04-17 15:33:38 -04:00

72 lines
1.6 KiB
YAML

stages:
- test
- build
- deploy
cache:
paths:
- /cache
before_script:
test:
stage: test
image: ruby:2.5
script:
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
- bundle install --path /cache
- bundle exec rake db:create RAILS_ENV=test
- bundle exec rake test & bundle exec rspec & bundle exec rubocop
except:
variables:
- $CD_TEST_IGNORE
build:
stage: build
image: docker:stable
services:
- docker:dind
script:
# Install bash, curl, git for deployment script
- apk update && apk add --no-cache bash curl git
# Install CA certs, openssl to https downloads, python for gcloud sdk
- apk add --update make ca-certificates openssl python
- update-ca-certificates
# Build.
- ./scripts/image_build.sh $CI_PROJECT_PATH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
only:
refs:
- branches
- tags
variables:
- $CD_DOCKER_USERNAME
- $CD_DOCKER_PASSWORD
except:
variables:
- $CD_BUILD_IGNORE
deploy:
stage: deploy
image: docker:stable
services:
- docker:dind
script:
# Install bash, curl, git for deployment script
- apk update && apk add --no-cache bash curl git
# Install CA certs, openssl to https downloads, python for gcloud sdk
- apk add --update make ca-certificates openssl python
- update-ca-certificates
# Deploy.
- ./scripts/image_deploy.sh $CI_PROJECT_PATH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA $CI_COMMIT_BEFORE_SHA
only:
refs:
- branches
- tags
variables:
- $CD_DOCKER_USERNAME
- $CD_DOCKER_PASSWORD
- $CD_DEPLOY_SCRIPT
except:
variables:
- $CD_DEPLOY_IGNORE