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-10-05 21:17:18 +02:00
|
|
|
- check
|
|
|
|
- test
|
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"
|
2019-10-05 19:07:50 +02:00
|
|
|
MOBILIZON_INSTANCE_REGISTRATIONS_OPEN: "true"
|
2018-01-13 23:40:06 +01:00
|
|
|
|
2019-10-05 21:17:18 +02:00
|
|
|
lint:
|
|
|
|
stage: check
|
2019-03-22 11:37:58 +01:00
|
|
|
script:
|
|
|
|
- mix deps.get
|
2019-10-05 21:17:18 +02:00
|
|
|
- mix credo list
|
|
|
|
- mix format --check-formatted --dry-run
|
2019-03-22 11:04:57 +01:00
|
|
|
- cd js
|
2019-04-10 17:30:18 +02:00
|
|
|
- yarn install
|
|
|
|
- yarn run lint
|
2019-03-22 11:04:57 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
2019-10-05 21:17:18 +02:00
|
|
|
- deps
|
2019-03-22 11:04:57 +01:00
|
|
|
- js/node_modules
|
|
|
|
|
2019-10-05 21:17:18 +02:00
|
|
|
deps:
|
|
|
|
stage: check
|
2018-12-18 12:26:10 +01:00
|
|
|
script:
|
2019-03-08 13:42:34 +01:00
|
|
|
- mix deps.get
|
2019-02-22 14:18:52 +01:00
|
|
|
- mix hex.outdated
|
2019-10-05 21:17:18 +02:00
|
|
|
- cd js
|
|
|
|
- yarn outdated
|
2019-03-08 13:42:34 +01:00
|
|
|
allow_failure: true
|
2018-12-18 12:26:10 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
2019-10-05 21:17:18 +02:00
|
|
|
- js/node_modules
|
2018-01-13 23:35:11 +01:00
|
|
|
|
2019-10-05 21:17:18 +02:00
|
|
|
exunit:
|
|
|
|
stage: test
|
2018-12-18 12:26:10 +01:00
|
|
|
services:
|
2019-10-05 21:17:18 +02:00
|
|
|
- name: mdillon/postgis:11
|
2018-12-18 12:26:10 +01:00
|
|
|
alias: postgres
|
|
|
|
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
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2019-10-05 21:17:18 +02:00
|
|
|
cypress:
|
|
|
|
stage: test
|
2019-10-05 19:07:50 +02:00
|
|
|
services:
|
2019-10-05 21:17:18 +02:00
|
|
|
- name: mdillon/postgis:11
|
2019-10-05 19:07:50 +02:00
|
|
|
alias: postgres
|
|
|
|
script:
|
|
|
|
- mix deps.get
|
|
|
|
- cd js
|
|
|
|
- yarn install
|
|
|
|
- yarn run build
|
|
|
|
- cd ../
|
|
|
|
- MIX_ENV=e2e mix ecto.create
|
|
|
|
- MIX_ENV=e2e mix ecto.migrate
|
|
|
|
- MIX_ENV=e2e mix phx.server &
|
|
|
|
- cd js
|
|
|
|
- npx wait-on http://localhost:4000
|
|
|
|
- npx cypress run --record --parallel --key $CYPRESS_KEY
|
|
|
|
artifacts:
|
|
|
|
expire_in: 2 day
|
|
|
|
paths:
|
|
|
|
- js/tests/e2e/screenshots/**/*.png
|
2019-10-05 21:17:18 +02:00
|
|
|
- js/tests/e2e/videos/**/*.mp4
|
|
|
|
|
|
|
|
|
|
|
|
pages:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- mkdir public
|
|
|
|
- mix deps.get
|
|
|
|
- mix docs
|
|
|
|
- mv doc public/backend
|
|
|
|
- cd js
|
|
|
|
- yarn install
|
|
|
|
- yarn run styleguide:build
|
|
|
|
- mv styleguide ../public/frontend
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- deps
|
|
|
|
- js/node_modules
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 hour
|
|
|
|
paths:
|
|
|
|
- public
|