-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
79 lines (73 loc) · 2.85 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
78
79
# 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
variables:
POSTGRES_ENABLED: 'true'
POSTGRES_USER: runner
POSTGRES_PASSWORD: ''
POSTGRES_DB: msipdes_pru
POSTGRES_HOST_AUTH_METHOD: trust
RAILS_ENV: test
BUNDLE_PATH: vendor/bundle
NOKOGIRI_USE_SYSTEM_LIBRARIES: 'true'
CC_TEST_REPORTER_ID: "568b1ae5098341f2ba3eb9e36f304e17325eb93a7d021f3cfb1e9fbe94a9a40f"
CI: 'Si'
stages:
- test
test:
stage: test
cache:
paths:
- apt-cache
- node_modules
- vendor/bundle
before_script:
- uname -a
- whoami
- echo "HOME=${HOME}"
- pwd
- which ruby
- ruby -v
- 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
- apt install -y poppler-utils # pdftoppm para presentar portada de anexo
- which pdftoppm
- 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 install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2
libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6
libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates
fonts-liberation libnss3 lsb-release xdg-utils wget libgbm-dev
- apt-get update -qq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -yqq yarn
- 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 -v
- ./cc-test-reporter before-build
- cp .env.gitlab .env
- 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
- createdb -U runner -h postgres sifasol_pru
- bin/rails db:create db:setup db:seed
- bin/rails msip:indices
- yarn
- bin/rails msip:stimulus_motores
- RAILS_ENV=test bin/rails assets:precompile
- gem install dotenv
script:
- bin/regresion.sh
- exit_code=$?
after_script:
- ./cc-test-reporter after-build -t simplecov --exit-code $exit_code || true
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml