-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (70 loc) · 2.71 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Basado entre otros en: https://dev.to/mpressen/rails-minitest-gitlab-ci-31ap
image: "ruby:3.2.1"
services:
- name: vtamara/postgis-es_co:13.3-1
alias: postgres
- name: selenium/standalone-chrome
alias: chrome
variables:
RAILS_ENV: test
POSTGRES_ENABLED: "true"
POSTGRES_USER: runner
POSTGRES_PASSWORD: ""
POSTGRES_DB: sijrscol_pru
POSTGRES_HOST_AUTH_METHOD: trust
RAILS_ENV: test
NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
SELENIUM_REMOTE_URL: http://chrome:4444/wd/hub
DAST_WEBSITE: http://colombiajrs.info:5100
CC_TEST_REPORTER_ID: "829b7f6c38bb12d45bf7b1384fba4a7b8444867b69027726fab095c48ad76b74"
stages:
- test
- dast
test:
stage: test
cache:
paths:
- apt-cache
- node_modules
- vendor/bundle
before_script:
- uname -a
- cat /etc/os-release
- ruby -v
- which ruby
- export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
- apt-get update -yy && apt-get install build-essential libpq-dev postgresql-client -y
- curl -fsSL https://deb.nodesource.com/setup_16.x | bash - # https://www.linuxcapable.com/how-to-install-node-js-14-lts-16-npm-on-debian-11-bullseye/
- apt install -y -qq nodejs
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update -qq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -yqq yarn
- yarn install
- gem install bundler --no-document
- bundle install --jobs $(nproc) "${FLAGS[@]}"
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- cp .env.gitlab .env
- cp config/database.ci.yml config/database.yml
- cp db/structure.sql db/structure.sql.copia
- sed -e 's/provider = libc,//g;s/SET default_table_access_method.*/-- &/g' db/structure.sql.copia > db/structure.sql
- which psql
#- psql -h postgres -U runner --set ON_ERROR_STOP=1 --no-psqlrc --file /builds/pasosdeJesus/si_jrscol/db/structure.sql sijrscol_pru
- bin/rails db:drop db:create db:setup
- bin/rails msip:indices
- bin/rails msip:stimulus_motores
- bin/rails assets:precompile
script:
- bin/regresion.sh
- exit_code=$?
- echo "exit_code=$exit_code"
after_script:
- ./cc-test-reporter after-build -t simplecov || true
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/DAST.gitlab-ci.yml
#- template: Code-Quality.gitlab-ci.yml