Skip to content
Trouver rapidement le bon professionnel pour les majeurs à protéger
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Jun 12, 2019
.gitlab-ci ci(gitlab): allow notification failure to fail Jul 22, 2019
.k8s feat(hasura): introduce hasura, change auth (#504) Jul 11, 2019
docker/postgres fix(postgres): rollback in flavor of version 10 (#224) May 22, 2019
optional/e2e chore(deps): update dependency eslint-plugin-cypress to ^2.6.0 (#555) Jul 22, 2019
packages feat(graphql): update models (#579) Jul 22, 2019
scripts refacto: dockerify (#11) Feb 15, 2019
.dockerignore build(docker): ignore more stuff (#402) Jun 20, 2019
.editorconfig refacto: add monorepo base Feb 13, 2019
.env.sample feat(hasura): introduce hasura, change auth (#504) Jul 11, 2019
.env.test build(docker): sed the frontend artifact to config the API_URL (#266) Jun 7, 2019
.gitignore ci(gitlab): deployment (#210) Jul 3, 2019
.gitlab-ci.yml refactor(gitlab): use advance release process (#439) Jul 4, 2019
.travis.yml ci(travis): simplify travis job Jul 21, 2019
CHANGELOG.md chore(release): version 23.4.5 Jul 5, 2019
Dockerfile refactor(jest-environment-knex): export jest-environment-knex (#576) Jul 21, 2019
LICENSE refacto: add monorepo base Feb 13, 2019
README.md Update README.md Jul 5, 2019
codecov.yml ci(codecov) ignore codecov app target for now... May 23, 2019
commitlint.config.js Feat/husky (#403) Jun 26, 2019
docker-compose.override.yaml.sample
docker-compose.test.yaml build(docker): sed the frontend artifact to config the API_URL (#266) Jun 7, 2019
docker-compose.yaml feat(hasura): introduce hasura, change auth (#504) Jul 11, 2019
lerna.json chore(release): version 23.4.5 Jul 5, 2019
package.json refactor(jest-environment-knex): export jest-environment-knex (#576) Jul 21, 2019
yarn.lock fix(deps): update dependency pg to ^7.11.0 (#496) Jul 22, 2019

README.md

eMJPM

Build Status Codacy Badge codecov

Installation

Make sure you're using NodeJS 10.15

# Install all the packages
$ yarn
# This will trigger some build on the `postinstall` script

Build

# Build all the packages
$ yarn build

# Build the "<package-name>"
$ yarn workspace <package-name> build

# For example for "@emjpm/api"
$ yarn workspace @emjpm/api build

Test

# Build all the packages
$ yarn test

# Build the "<package-name>"
$ yarn workspace <package-name> test

# For example for "@emjpm/api"
$ yarn workspace @emjpm/api test

E2E tests

The e2e tests are using the latest deployed socialgouv/emjpm-* images by default. To run the tests with

$ yarn lerna --scope @optional/e2e exec yarn
$ docker-compose -f ./docker-compose.yaml -f ./docker-compose.test.yaml up --build

$ NODE_ENV=test yarn workspace @emjpm/knex run migrate
$ NODE_ENV=test yarn workspace @emjpm/knex run seeds

$ yarn run -- lerna --scope @optional/e2e run cypress:run -- --headed

Manual deployment

To build and deploy manually some version :

# checkout your target branch
git pull

# edit docker-compose.override.yaml and .env

# build locally main docker image as emjpm-base
# you can override API_URL and SENTRY_PUBLIC_DSN env vars here
docker build . -t emjpm-base

# rebuild and launch instance using locally built image
BASE_IMAGE=emjpm-base docker-compose up --build -d

# run migrations and seeds
BASE_IMAGE=emjpm-base docker-compose run knex yarn workspace @emjpm/knex run migrate
BASE_IMAGE=emjpm-base docker-compose run knex yarn workspace @emjpm/knex run seeds

FAQ

  • If you have the Can't take lock to run migrations: Migration table is already locked error
$ docker-compose exec db psql -U postgres -d emjpm_test -c 'UPDATE knex_migrations_lock set is_locked=0;'
UPDATE 1
  • If you have migration error
$ docker-compose -f ./docker-compose.yaml -f ./docker-compose.dev.yaml exec api yarn knex migrate:rollback

Release policy

Auto

Trigger a custom build on Travis (in the "More options" right menu) on the master branch with a custom config:

env:
  global:
    - RELEASE=true

You can change the lerna arguments though the LERNA_ARGS variable.

env:
  global:
    - LERNA_ARGS="--force-publish --yes"
    - RELEASE=true

Manual

You need an Github token to release.

#
# Bump, push to git and publish to npm
$ yarn lerna version

#
# Publish the tag change log on the Github Release
$ CONVENTIONAL_GITHUB_RELEASER_TOKEN==************ npx conventional-github-releaser -p angular

#
# You might want to add a Gif to your release to make it groovy ;)

Deployment policy

All branches and tags are automaticly deployed See https://github.com/SocialGouv/work-in-france/deployments

Auto

Trigger a custom build on Travis (in the "More options" right menu) on the tag v* you with a custom config:

env:
  global:
    - PRODUCTION=true

Manual

# Run the k8s files
$ kubectl apply -f ./.k8s/frontend/deployment.yml
$ kubectl apply -f ./.k8s/frontend/service.yml
$ kubectl apply -f ./.k8s/frontend/ingress.yml

Branch name

You need to name your branch with the commit lint convention

branch name template:

type/***-***

Type

Must be one of the following:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

as a reference see https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-angular

You can’t perform that action at this time.