Browse Source

jenkinsfile

release_0.0.2
巴林闲侠 3 years ago
parent
commit
aff86a6820
  1. 8
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
  2. 3
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 11
      code/VideoAccess-VCMP/api/app/lib/models/camera.js
  4. 6
      code/VideoAccess-VCMP/api/app/lib/models/gb_camera.js
  5. 4
      jenkinsfile_vcmp_api
  6. 4
      jenkinsfile_vcmp_web

8
code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js

@ -206,7 +206,8 @@ async function createNvrCamera (ctx) {
serialNo: c.streamid, serialNo: c.streamid,
name: c.name, name: c.name,
sip: corCamera.sipip, sip: corCamera.sipip,
cloudControl: c.cloudControl cloudControl: c.cloudControl,
gbId: c.id,
}) })
} else { } else {
createData.push({ createData.push({
@ -219,6 +220,7 @@ async function createNvrCamera (ctx) {
createTime: moment().format(), createTime: moment().format(),
createUserId: userId, createUserId: userId,
forbidden: false, forbidden: false,
gbId: c.id,
}) })
} }
} else { } else {
@ -294,6 +296,7 @@ async function createIpcCamera (ctx) {
const gbCameraRes = await verifyIpcInfo({ serialNo }) const gbCameraRes = await verifyIpcInfo({ serialNo })
storageData.sip = gbCameraRes.dataValues.sipip storageData.sip = gbCameraRes.dataValues.sipip
storageData.gbId = gbCameraRes.dataValues.id
if (handleCameraId) { if (handleCameraId) {
await models.Camera.update(storageData, { await models.Camera.update(storageData, {
@ -436,7 +439,8 @@ async function createCascadeCamera (ctx) {
externalDomain, externalDomain,
cascadeType, cascadeType,
sip: c.sipip, sip: c.sipip,
name: c.name name: c.name,
gbId: c.id,
} }
const added = addedCmeraRes.find(ac => ac.serialNo == c.streamid) const added = addedCmeraRes.find(ac => ac.serialNo == c.streamid)
if (added) { if (added) {

3
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -27,6 +27,9 @@ async function getCameraProject (ctx, next) {
} : {}, } : {},
required: Boolean(nvrId), required: Boolean(nvrId),
attributes: ['id', 'name', 'serialNo'] attributes: ['id', 'name', 'serialNo']
}, {
model: models.GbCamera,
attributes: ['id', 'online']
}], }],
distinct: true distinct: true
} }

11
code/VideoAccess-VCMP/api/app/lib/models/camera.js

@ -246,7 +246,16 @@ module.exports = dc => {
key: "id", key: "id",
model: "secretYingshi" model: "secretYingshi"
} }
} },
gbId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "gb_id",
autoIncrement: false,
},
}, { }, {
tableName: "camera", tableName: "camera",
comment: "", comment: "",

6
code/VideoAccess-VCMP/api/app/lib/models/gb_camera.js

@ -146,11 +146,15 @@ module.exports = dc => {
comment: "", comment: "",
indexes: [] indexes: []
}); });
dc.models.GbCamera = GbCamera;
const Nvr = dc.models.Nvr; const Nvr = dc.models.Nvr;
Nvr.belongsTo(GbCamera, { foreignKey: 'serialNo', targetKey: 'streamid', as: 'gbNvr' }); Nvr.belongsTo(GbCamera, { foreignKey: 'serialNo', targetKey: 'streamid', as: 'gbNvr' });
GbCamera.hasMany(Nvr, { foreignKey: 'serialNo', sourceKey: 'streamid', as: 'gbNvr' }); GbCamera.hasMany(Nvr, { foreignKey: 'serialNo', sourceKey: 'streamid', as: 'gbNvr' });
const Camera = dc.models.Camera;
Camera.belongsTo(GbCamera, { foreignKey: 'gbId', targetKey: 'id' });
GbCamera.hasMany(Camera, { foreignKey: 'gbId', sourceKey: 'id' });
dc.models.GbCamera = GbCamera;
return GbCamera; return GbCamera;
}; };

4
code/VideoAccess-VCMP/api/jenkinsfile → jenkinsfile_vcmp_api

@ -8,10 +8,10 @@ pipeline {
stages { stages {
stage('Testing vcmp ......') { stage('Testing vcmp ......') {
steps { steps {
sh 'switch-auth.sh vcmp' sh 'switch-auth.sh anxinyun'
buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}" buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}"
buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}" buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}"
sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} .' sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./code/VideoAccess-VCMP/api'
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}' sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
} }
} }

4
code/VideoAccess-VCMP/web/jenkinsfile → jenkinsfile_vcmp_web

@ -8,10 +8,10 @@ pipeline {
stages { stages {
stage('Testing vcmp ......') { stage('Testing vcmp ......') {
steps { steps {
sh 'switch-auth.sh vcmp' sh 'switch-auth.sh anxinyun'
buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}" buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}"
buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}" buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}"
sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} .' sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./code/VideoAccess-VCMP/web'
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}' sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
} }
} }
Loading…
Cancel
Save