Skip to content
Snippets Groups Projects
Commit 9e2b1cfc authored by Guillaume WANG's avatar Guillaume WANG
Browse files

Merge branch 'master' of gitlab.binets.fr:br/sigma-backend

parents fe5ef0dc 47252609
No related branches found
No related tags found
No related merge requests found
...@@ -25,28 +25,23 @@ stages: ...@@ -25,28 +25,23 @@ stages:
# make migrations on and seed the db # make migrations on and seed the db
install-dependencies: install-dependencies:
stage: install stage: install
before_script:
- npm i -g npm
script: script:
- npm install -q - npm ci
artifacts: artifacts:
paths: paths:
- node_modules/ - node_modules/
tags:
- build
build: build:
stage: build stage: build
before_script: before_script:
- export NODE_ENV=staging
- echo $LDAP_CONN_CONFIG > ldap_connexion_config.json - echo $LDAP_CONN_CONFIG > ldap_connexion_config.json
script: script: npm run build
- npm run build
- knex migrate:latest
- knex seed:run
artifacts: artifacts:
paths: paths:
- build/ - build/
tags:
- build
- database
deploy-staging: deploy-staging:
stage: deploy stage: deploy
...@@ -63,9 +58,10 @@ deploy-staging: ...@@ -63,9 +58,10 @@ deploy-staging:
- ssh -p22 sigma-dev@roued "rm -rf /opt/sigma-back-dev/assets" - ssh -p22 sigma-dev@roued "rm -rf /opt/sigma-back-dev/assets"
- scp -p22 -r build/ sigma-dev@roued:/opt/sigma-back-dev/build - scp -p22 -r build/ sigma-dev@roued:/opt/sigma-back-dev/build
- scp -p22 -r assets/ sigma-dev@roued:/opt/sigma-back-dev/assets - scp -p22 -r assets/ sigma-dev@roued:/opt/sigma-back-dev/assets
- scp -p22 -r db/ sigma-dev@roued:/opt/sigma-back-dev/db
- scp -p22 knexfile.js sigma-dev@roued:/opt/sigma-back-dev/knexfile.js
- ssh -p22 sigma-dev@roued "cd /opt/sigma-back-dev && knex migrate:latest && knex seed:run"
- scp -p22 package.json "package-lock.json" ldap_config.json ldap_connexion_config.json sigma-back-dev.service sigma-dev@roued:/opt/sigma-back-dev/ - scp -p22 package.json "package-lock.json" ldap_config.json ldap_connexion_config.json sigma-back-dev.service sigma-dev@roued:/opt/sigma-back-dev/
environment: environment:
name: staging name: staging
url: http://129.104.210.10:3000 url: http://129.104.210.10:3000
tags:
- deployment
...@@ -30,10 +30,10 @@ module.exports = { ...@@ -30,10 +30,10 @@ module.exports = {
directory: path.resolve('./db/seeds') directory: path.resolve('./db/seeds')
} }
}, },
production: { staging: {
client: 'pg', client: 'pg',
connection: { connection: {
host: 'localhost', host: '129.201.104.10',
user: 'will', user: 'will',
password: 'password', password: 'password',
database: 'sigma_dev', database: 'sigma_dev',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment