Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
c8c7fbe9
Commit
c8c7fbe9
authored
6 years ago
by
Wilson JALLET
Browse files
Options
Downloads
Patches
Plain Diff
Change NODE_ENV use to TARGET_ENV
new variable used for target environment (dev, staging, production)
parent
5dd4cd8f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
db/knex_router.js
+2
-1
2 additions, 1 deletion
db/knex_router.js
src/app.ts
+0
-1
0 additions, 1 deletion
src/app.ts
with
4 additions
and
4 deletions
.gitlab-ci.yml
+
1
−
1
View file @
c8c7fbe9
...
@@ -51,7 +51,7 @@ docker:build:
...
@@ -51,7 +51,7 @@ docker:build:
script
:
script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
-
echo "Building Dockerfile..."
-
echo "Building Dockerfile..."
-
docker build --pull -t ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} -t ${CI_APPLICATION_REPOSITORY}:latest .
-
docker build --pull -t ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} -t ${CI_APPLICATION_REPOSITORY}:latest
--build-arg TARGET_ENV=staging
.
-
echo "Pushing to GitLab Container registry $CI_APPLICATION_REPOSITORY with tags '${CI_APPLICATION_TAG}' and 'latest'"
-
echo "Pushing to GitLab Container registry $CI_APPLICATION_REPOSITORY with tags '${CI_APPLICATION_TAG}' and 'latest'"
-
docker push ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
-
docker push ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
-
docker push ${CI_APPLICATION_REPOSITORY}:latest
-
docker push ${CI_APPLICATION_REPOSITORY}:latest
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
1
−
1
View file @
c8c7fbe9
...
@@ -10,7 +10,7 @@ COPY package*.json ./
...
@@ -10,7 +10,7 @@ COPY package*.json ./
# Install app dependencies
# Install app dependencies
RUN
npm
install
--only
=
production
RUN
npm
install
--only
=
production
ENV
NODE_ENV=staging
ARG
TARGET_ENV
ENV
LDAP_URI=http://frankiz.eleves.polytechnique.fr:389
ENV
LDAP_URI=http://frankiz.eleves.polytechnique.fr:389
COPY
. .
COPY
. .
...
...
This diff is collapsed.
Click to expand it.
db/knex_router.js
+
2
−
1
View file @
c8c7fbe9
/**
/**
* @file Charge la configuration knexjs adaptée à l'environnement (production ou développement) puis exporte un objet knex permettant les requêtes SQL
* @file Charge la configuration knexjs adaptée à l'environnement (production ou développement) puis exporte un objet knex permettant les requêtes SQL
*/
*/
require
(
'
dotenv
'
).
config
();
const
environment
=
process
.
env
.
NODE
_ENV
||
'
development
'
;
const
environment
=
process
.
env
.
TARGET
_ENV
||
'
development
'
;
const
config
=
require
(
'
../knexfile
'
)[
environment
];
const
config
=
require
(
'
../knexfile
'
)[
environment
];
console
.
log
(
"
Running Knex configuration '%s'
"
,
environment
);
console
.
log
(
"
Running Knex configuration '%s'
"
,
environment
);
...
...
This diff is collapsed.
Click to expand it.
src/app.ts
+
0
−
1
View file @
c8c7fbe9
...
@@ -199,7 +199,6 @@ app.post('/login',
...
@@ -199,7 +199,6 @@ app.post('/login',
/**
/**
* @desc API GraphQL
* @desc API GraphQL
*/
*/
const
environment
=
process
.
env
.
NODE_ENV
||
'
development
'
;
/**
/**
* @desc Define GraphQL request context object, through a callback, with authorization.
* @desc Define GraphQL request context object, through a callback, with authorization.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment