Jenkins y routes
This commit is contained in:
parent
c341009489
commit
48cac24d88
|
@ -1,31 +1,19 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
import groovy.json.*;
|
||||
|
||||
def image;
|
||||
def branchName = "${env.BRANCH_NAME}";
|
||||
def branchNameTest = "preprod";
|
||||
def branchNameProd = "master";
|
||||
def prefixDocker = "test";
|
||||
def dockerNginxName = ["nginx", "-p 80:80 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client --link test-mailer:mailer --link test-production:production"]
|
||||
def dockerAuthName = ["auth", "-p 3000:3000"]
|
||||
def dockerSalixName = ["salix", "-p 3001:3001"]
|
||||
def dockerClientName = ["client", "-p 3002:3002"]
|
||||
def dockerMailerName = ["mailer", "-p 3003:3003"]
|
||||
def dockerProductionName = ["production", "-p 3004:3004"]
|
||||
|
||||
def buildNumber = "${env.BUILD_NUMBER}";
|
||||
def branchProduction = "master"
|
||||
def branchTest = "test";
|
||||
def dockerHost = "${env.DOCKER_HOST}";
|
||||
|
||||
def dockers = [dockerAuthName, dockerSalixName, dockerClientName, dockerMailerName, dockerProductionName, dockerNginxName]
|
||||
|
||||
node {
|
||||
|
||||
if (branchName == branchNameProd)
|
||||
prefixDocker = "prod";
|
||||
if (branchName == branchProduction)
|
||||
dockerHost = "tcp://172.16.255.29:2375";
|
||||
|
||||
node
|
||||
{
|
||||
stage ('Checkout') {
|
||||
checkout scm
|
||||
}
|
||||
|
||||
stage ('install modules'){
|
||||
sh "npm install"
|
||||
|
@ -35,10 +23,6 @@ node {
|
|||
sh "gulp build"
|
||||
}
|
||||
|
||||
for (int i = 0; i < dockers.size(); i++)
|
||||
{
|
||||
def element = dockers[i][0]
|
||||
def ports = dockers[i][1]
|
||||
|
||||
stage ("docker ${element}")
|
||||
{
|
||||
|
@ -57,25 +41,18 @@ node {
|
|||
echo "Error Stage Stopping"
|
||||
}
|
||||
}
|
||||
stage ("Create Docker Image ${element}") {
|
||||
dir("./services/${element}"){
|
||||
stage ("Install modules service ${element}"){
|
||||
if (fileExists('./package.json'))
|
||||
sh "npm i"
|
||||
|
||||
stage ("Generar dockers")
|
||||
{
|
||||
stage ("build dockers")
|
||||
{
|
||||
sh "docker-compose build "
|
||||
}
|
||||
stage("Build image ${element}"){
|
||||
image = docker.build("${prefixDocker}-${element}:${buildNumber}", ".")
|
||||
|
||||
stage ("up dockers")
|
||||
{
|
||||
sh "docker-compose up -d"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Run Docker ${element}"){
|
||||
image.run ("${ports} --name ${prefixDocker}-${element}")
|
||||
}
|
||||
/*
|
||||
stage('docker registry'){
|
||||
docker.withServer('tcp://harbor.verdnatura.es','docker-registry')
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "MailServer",
|
||||
"version": "1.0.0",
|
||||
"port": 3003,
|
||||
"debug": false,
|
||||
"defaultLanguage": "es",
|
||||
"senderMail": "noreply@localhost",
|
||||
"senderName": ""
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"user": "rot",
|
||||
"password": "",
|
||||
"database": "vn"
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"host": "smtp.verdnatura.es",
|
||||
"port": 465,
|
||||
"secure": true,
|
||||
"auth": {
|
||||
"id": 10240,
|
||||
"user": "nocontestar",
|
||||
"pass": "ub606cux7op"
|
||||
},
|
||||
"tls": {
|
||||
"rejectUnauthorized": false
|
||||
},
|
||||
"pool": true
|
||||
}
|
|
@ -12,7 +12,8 @@ module.exports = function(FakeProduction) {
|
|||
});
|
||||
|
||||
FakeProduction.routeList = function(ctx, cb) {
|
||||
var query = `select routeFk from FakeProduction where routeFk is not null group by RouteFk order by routeFk`;
|
||||
// var query = `select routeFk from FakeProduction where routeFk is not null group by RouteFk order by routeFk`;
|
||||
let query = `call salix.production_control_source(1,1)`;
|
||||
var params = [];
|
||||
FakeProduction.rawSql(query, params, cb)
|
||||
.then(function(response){
|
||||
|
|
Loading…
Reference in New Issue