2018-11-06 10:30:27 +01:00
|
|
|
image: tcitworld/mobilizon-ci
|
2018-01-13 23:35:11 +01:00
|
|
|
|
2018-12-18 12:26:10 +01:00
|
|
|
stages:
|
2019-03-22 11:37:58 +01:00
|
|
|
- deps
|
2018-12-18 12:26:10 +01:00
|
|
|
- front
|
|
|
|
- back
|
2019-03-18 12:37:04 +01:00
|
|
|
- deploy
|
2018-01-13 23:35:11 +01:00
|
|
|
|
2018-01-13 23:40:06 +01:00
|
|
|
variables:
|
|
|
|
MIX_ENV: "test"
|
2019-01-03 11:33:52 +01:00
|
|
|
# DB Variables for Postgres / Postgis
|
2018-10-11 17:37:39 +02:00
|
|
|
POSTGRES_DB: mobilizon_test
|
2018-01-14 00:21:20 +01:00
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: ""
|
2018-01-14 00:47:03 +01:00
|
|
|
POSTGRES_HOST: postgres
|
2019-01-03 11:33:52 +01:00
|
|
|
# DB Variables for Mobilizon
|
|
|
|
MOBILIZON_DATABASE_USERNAME: $POSTGRES_USER
|
|
|
|
MOBILIZON_DATABASE_PASSWORD: $POSTGRES_PASSWORD
|
|
|
|
MOBILIZON_DATABASE_DBNAME: $POSTGRES_DB
|
|
|
|
MOBILIZON_DATABASE_HOST: $POSTGRES_HOST
|
2018-12-18 11:24:22 +01:00
|
|
|
GEOLITE_CITIES_PATH: "/usr/share/GeoIP/GeoLite2-City.mmdb"
|
2018-01-13 23:40:06 +01:00
|
|
|
|
2019-03-22 11:37:58 +01:00
|
|
|
setup_elixir_deps:
|
|
|
|
stage: deps
|
|
|
|
script:
|
|
|
|
- mix deps.get
|
|
|
|
- mix compile
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
|
|
|
- _build
|
|
|
|
|
|
|
|
setup_js_deps:
|
|
|
|
stage: deps
|
|
|
|
before_script:
|
|
|
|
- cd js
|
|
|
|
script:
|
|
|
|
- npm install
|
|
|
|
after_script:
|
|
|
|
- cd ../
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- js/node_modules
|
|
|
|
|
2018-12-18 12:26:10 +01:00
|
|
|
js:
|
|
|
|
stage: front
|
|
|
|
before_script:
|
|
|
|
- cd js
|
|
|
|
- npm install
|
|
|
|
script:
|
|
|
|
- npm run build
|
|
|
|
after_script:
|
|
|
|
- cd ../
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- js/node_modules
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- priv/static
|
|
|
|
untracked: false
|
|
|
|
expire_in: 30 days
|
2018-01-13 23:49:37 +01:00
|
|
|
|
2019-03-08 13:42:34 +01:00
|
|
|
|
|
|
|
js_deps:
|
|
|
|
stage: front
|
|
|
|
before_script:
|
|
|
|
- cd js
|
|
|
|
- npm install
|
|
|
|
- npm install -g npm-check-updates
|
|
|
|
script:
|
|
|
|
- ncu --error-level 2
|
|
|
|
after_script:
|
|
|
|
- cd ../
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- js/node_modules
|
|
|
|
allow_failure: true
|
|
|
|
|
2019-03-22 11:04:57 +01:00
|
|
|
js_check:
|
|
|
|
stage: front
|
|
|
|
before_script:
|
|
|
|
- cd js
|
|
|
|
- npm install
|
|
|
|
script:
|
|
|
|
- npm run lint
|
|
|
|
after_script:
|
|
|
|
- cd ../
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- js/node_modules
|
|
|
|
|
2019-01-03 14:59:59 +01:00
|
|
|
elixir_check:
|
2018-12-18 12:26:10 +01:00
|
|
|
stage: back
|
|
|
|
before_script:
|
|
|
|
- mix deps.get
|
|
|
|
script:
|
2019-01-03 14:59:59 +01:00
|
|
|
- mix credo list
|
2019-02-22 14:18:52 +01:00
|
|
|
- mix format --check-formatted --dry-run
|
2019-03-08 13:42:34 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
|
|
|
|
|
|
|
elixir_deps:
|
|
|
|
stage: back
|
|
|
|
before_script:
|
|
|
|
- mix deps.get
|
|
|
|
script:
|
2019-02-22 14:18:52 +01:00
|
|
|
- mix hex.outdated
|
2019-03-08 13:42:34 +01:00
|
|
|
allow_failure: true
|
2018-12-18 12:26:10 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
2018-01-13 23:35:11 +01:00
|
|
|
|
2019-03-18 12:47:21 +01:00
|
|
|
pages:
|
2019-03-18 12:37:04 +01:00
|
|
|
stage: deploy
|
2019-03-14 15:00:34 +01:00
|
|
|
before_script:
|
|
|
|
- mix deps.get
|
|
|
|
script:
|
|
|
|
- mix docs
|
|
|
|
- mv doc public
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
2019-03-18 12:37:04 +01:00
|
|
|
only:
|
|
|
|
- master
|
2019-03-14 15:00:34 +01:00
|
|
|
artifacts:
|
|
|
|
expire_in: 1 hour
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
|
2018-01-13 23:35:11 +01:00
|
|
|
mix:
|
2018-12-18 12:26:10 +01:00
|
|
|
stage: back
|
|
|
|
services:
|
|
|
|
- name: mdillon/postgis:10
|
|
|
|
alias: postgres
|
|
|
|
dependencies:
|
|
|
|
- js
|
|
|
|
before_script:
|
|
|
|
- mix deps.get
|
|
|
|
- MIX_ENV=test mix ecto.create
|
|
|
|
- MIX_ENV=test mix ecto.migrate
|
2018-01-13 23:35:11 +01:00
|
|
|
script:
|
2018-12-18 12:26:10 +01:00
|
|
|
- mix coveralls
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
|
|
|
- _build
|