-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (45 loc) · 1.55 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
image: ruby:2.3
variables:
GIT_SSL_NO_VERIFY: "true"
before_script:
- export http_proxy="http://proxy.justice.cz:3128/"
- export https_proxy="http://proxy.justice.cz:3128/"
- export no_proxy="git.servis.justice.cz"
stages:
- test
- deploy
test:2.3:
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- cache/bundler/
before_script:
- export LANG=en_US.UTF-8
- export LANGUAGE=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- export RUBYOPT="-KU -E utf-8:utf-8"
- export BUNDLE_GEMFILE="Gemfile_devel"
- export http_proxy="http://proxy.justice.cz:3128/"
- export https_proxy="http://proxy.justice.cz:3128/"
- export no_proxy="git.servis.justice.cz"
script:
- BASE_URL=`echo $CI_REPOSITORY_URL | sed "s;\/*$CI_PROJECT_PATH.*;;"`
- REPO_URL="$BASE_URL/libraries/azahara_schema.git"
- REPO_DIR=libraries/azahara_schema
- rm -fr $REPO_DIR
- git clone $REPO_URL $REPO_DIR
- "sed -i \"s|gem 'azahara_schema', path: '.*'|gem 'azahara_schema', path: '$REPO_DIR'|g\" Gemfile_devel"
- git config --global url."https://github.com".insteadOf git://github.com
- RAILS_ENV=test bundle install --path=cache/bundler --without production --jobs $(nproc) "${FLAGS[@]}"
- bundle exec rails db:migrate RAILS_ENV=test
- bundle exec rspec
deploy_gem:
stage: deploy
script:
- mkdir -p ~/.gem/
- 'echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials && chmod 600 ~/.gem/credentials'
- gem build egov_utils.gemspec
- gem push egov_utils-*
only:
- tags