This commit is contained in:
Vicente Falco 2017-11-08 07:08:34 +01:00
commit 97da7e5c10
9 changed files with 37 additions and 34 deletions

24
Jenkinsfile vendored
View File

@ -9,6 +9,9 @@ env.NODE_ENV = branchName;
env.BRANCH_NAME = branchName; env.BRANCH_NAME = branchName;
env.TAG = "${env.BUILD_NUMBER}"; env.TAG = "${env.BUILD_NUMBER}";
if (branchName == "test")
env.NODE_ENV = "development";
if (branchName == branchProduction) if (branchName == branchProduction)
dockerHost = "tcp://172.16.255.29:2375"; dockerHost = "tcp://172.16.255.29:2375";
@ -25,35 +28,20 @@ node
sh "npm install" sh "npm install"
} }
stage ('build Project Salix'){ stage ('build Project'){
sh "gulp build" sh "gulp build"
} }
stage ("docker") stage ("docker")
{ {
stage ("Stopping/Removing Docker") stage ("Stopping/Removing Docker")
{ {
try sh "docker-compose down --rmi all"
{
sh "docker-compose stop"
sh "docker-compose rm -f"
}catch(Exception _){
echo "Error Stopping/Removing dockers"
}
} }
stage ("Generar dockers") stage ("Generar dockers")
{ {
stage ("build dockers") sh "docker-compose up -d --build"
{
sh "docker-compose build "
}
stage ("up dockers")
{
sh "docker-compose up -d"
}
} }
} }
} }

View File

@ -6,7 +6,8 @@ services:
container_name: "${BRANCH_NAME}-auth" container_name: "${BRANCH_NAME}-auth"
image: "auth:${TAG}" image: "auth:${TAG}"
build: build:
context: ./services/auth context: ./services
dockerfile: /auth/Dockerfile
expose: expose:
- "3000" - "3000"
ports: ports:
@ -18,7 +19,8 @@ services:
container_name: "${BRANCH_NAME}-salix" container_name: "${BRANCH_NAME}-salix"
image: "salix:${TAG}" image: "salix:${TAG}"
build: build:
context: ./services/salix context: ./services
dockerfile: /salix/Dockerfile
expose: expose:
- "3001" - "3001"
ports: ports:
@ -30,7 +32,8 @@ services:
container_name: "${BRANCH_NAME}-client" container_name: "${BRANCH_NAME}-client"
image: "client:${TAG}" image: "client:${TAG}"
build: build:
context: ./services/client context: ./services
dockerfile: /client/Dockerfile
expose: expose:
- "3002" - "3002"
ports: ports:
@ -54,7 +57,8 @@ services:
container_name: "${BRANCH_NAME}-production" container_name: "${BRANCH_NAME}-production"
image: "production:${TAG}" image: "production:${TAG}"
build: build:
context: ./services/production context: ./services
dockerfile: /production/Dockerfile
expose: expose:
- "3004" - "3004"
ports: ports:

View File

@ -1,6 +1,8 @@
FROM node:6.9.1 FROM node:6.9.1
COPY . /app COPY ./auth /app
COPY ./loopback /loopback
WORKDIR /app WORKDIR /app
@ -8,6 +10,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3000 EXPOSE 3000

View File

@ -1,6 +1,8 @@
FROM node:6.9.1 FROM node:6.9.1
COPY . /app COPY ./client /app
COPY ./loopback /loopback
WORKDIR /app WORKDIR /app
@ -8,6 +10,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3002 EXPOSE 3002

View File

@ -8,6 +8,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3003 EXPOSE 3003

View File

@ -10,7 +10,8 @@
"mustache": "^2.3.0", "mustache": "^2.3.0",
"mysql": "^2.13.0", "mysql": "^2.13.0",
"nodemailer": "^4.0.1", "nodemailer": "^4.0.1",
"path": "^0.12.7" "path": "^0.12.7",
"request": "^2.83.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,6 +1,8 @@
FROM node:6.9.1 FROM node:6.9.1
COPY . /app COPY ./production /app
COPY ./loopback /loopback
WORKDIR /app WORKDIR /app
@ -8,6 +10,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3004 EXPOSE 3004

View File

@ -1,6 +1,8 @@
FROM node:6.9.1 FROM node:6.9.1
COPY . /app COPY ./route /app
COPY ./loopback /loopback
WORKDIR /app WORKDIR /app
@ -8,6 +10,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3005 EXPOSE 3005

View File

@ -1,6 +1,8 @@
FROM node:6.9.1 FROM node:6.9.1
COPY . /app COPY ./salix /app
COPY ./loopback /loopback
WORKDIR /app WORKDIR /app
@ -8,6 +10,6 @@ RUN npm install
RUN npm -g install pm2 RUN npm -g install pm2
CMD ["pm2-docker", "."] CMD ["pm2-docker", "./server/server.js"]
EXPOSE 3001 EXPOSE 3001