diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 2d6af4f..5d1120d 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -26,7 +26,7 @@ "--redisPort 6379", "--apMergeDeVeAnxinProjectId 1,2,3", "--axyApiUrl http://127.0.0.1:4100", - // "--apiEmisUrl http://10.8.30.112:14000", + "--apiEmisUrl http://10.8.30.112:14000", // 测试 // "--apiEmisUrl http://10.8.30.161:1111", // "--apiEmisUrl http://10.8.30.161:31111/", diff --git a/api/Dockerfile b/api/Dockerfile index 780ee6d..7fb2d7e 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -6,11 +6,13 @@ WORKDIR /var/app EXPOSE 8080 -RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ +RUN npm config set registry=http://10.8.30.22:7000 +# RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f # RUN rm -rf package-lock.json -RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ +RUN npm install --registry http://10.8.30.22:7000 +# RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 diff --git a/api/app/lib/controllers/means/index.js b/api/app/lib/controllers/means/index.js index b01692e..9a96528 100644 --- a/api/app/lib/controllers/means/index.js +++ b/api/app/lib/controllers/means/index.js @@ -48,9 +48,9 @@ async function fileList (ctx, next) { const { projectId, type } = ctx.query; let options = { where: {}, } - if (projectId) { - options.where.projectId = projectId - } + + options.where.projectId = projectId || null + if (type) { options.where.type = type } diff --git a/api/app/lib/models/project_folder.js b/api/app/lib/models/project_folder.js index 000cf4a..8a18f6f 100644 --- a/api/app/lib/models/project_folder.js +++ b/api/app/lib/models/project_folder.js @@ -17,7 +17,7 @@ module.exports = dc => { }, projectId: { type: DataTypes.INTEGER, - allowNull: false, + allowNull: true, defaultValue: null, comment: null, primaryKey: false, diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index 1e7883a..1b23ca1 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -9,6 +9,7 @@ podTemplate { container('image-builder') { sh''' + find . -depth -name '.svn' -type d -exec rm -rf {} + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup ''' } diff --git a/jenkinsfilenew_web b/jenkinsfilenew_web index ea99169..0fc6880 100644 --- a/jenkinsfilenew_web +++ b/jenkinsfilenew_web @@ -1,21 +1,22 @@ -podTemplate { - node('pod-templ-jenkins-slave-common') { - - env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" - env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" - env.GIT_Add = "${GIT_ADDRESS}/free-sun/OperationalService/src/branch/dev/web" - - stage('Run shell') { - git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' - - container('image-builder') { - sh''' - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup - ''' - } - - buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" - buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" - } - } -} +podTemplate { + node('pod-templ-jenkins-slave-common') { + + env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" + env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" + env.GIT_Add = "${GIT_ADDRESS}/free-sun/OperationalService/src/branch/dev/web" + + stage('Run shell') { + git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' + + container('image-builder') { + sh''' + find . -depth -name '.svn' -type d -exec rm -rf {} + + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + ''' + } + + buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" + buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" + } + } +} diff --git a/script/0.26/schema/updata_project_folder.sql b/script/0.26/schema/updata_project_folder.sql new file mode 100644 index 0000000..8cd1c15 --- /dev/null +++ b/script/0.26/schema/updata_project_folder.sql @@ -0,0 +1 @@ +alter table project_folder alter column project_id drop not null; \ No newline at end of file diff --git a/web/Dockerfile b/web/Dockerfile index f8f81ce..3e95ad7 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -6,15 +6,17 @@ WORKDIR /var/app EXPOSE 8080 -RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ +RUN npm config set registry=http://10.8.30.22:7000 +# RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f RUN rm -rf package-lock.json -RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ +RUN npm install --registry http://10.8.30.22:7000 RUN npm run build RUN rm -rf client/src RUN rm -rf node_modules -RUN npm install --production --registry https://nexus.ngaiot.com/repository/fs-npm/ +RUN npm install --production --registry http://10.8.30.22:7000 +# RUN npm install --production --registry https://nexus.ngaiot.com/repository/fs-npm/ FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 diff --git a/web/client/src/sections/means/containers/devOpsStandard.jsx b/web/client/src/sections/means/containers/devOpsStandard.jsx index 8dc6966..29c79e4 100644 --- a/web/client/src/sections/means/containers/devOpsStandard.jsx +++ b/web/client/src/sections/means/containers/devOpsStandard.jsx @@ -39,11 +39,11 @@ const Rest = (props) => { let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) setPomsList(data) setShowPomsList(data) - setPepProjectId(data[0]?.pepProjectId) - fileList(data[0]?.pepProjectId) + } })) - + // setPepProjectId(data[0]?.pepProjectId) + fileList(null) }, []) useEffect(() => { @@ -54,8 +54,8 @@ const Rest = (props) => { data = pomsList?.filter(v => v.pepProjectName?.indexOf(projectSearch) != -1) } setShowPomsList(data) - setPepProjectId(data[0]?.pepProjectId) - fileList(data[0]?.pepProjectId) + setPepProjectId(data[0]?.pepProjectId || null) + fileList(data[0]?.pepProjectId || null) setDataSource([]) setFileId('') setFileSearch('') @@ -70,8 +70,8 @@ const Rest = (props) => { data = pomsList } setShowPomsList(data) - setPepProjectId(data[0]?.pepProjectId) - fileList(data[0]?.pepProjectId) + setPepProjectId(data[0]?.pepProjectId || null) + fileList(data[0]?.pepProjectId || null) setDataSource([]) setFileId('') setFileSearch('') @@ -152,7 +152,7 @@ const Rest = (props) => { if (!fileData && !list?.children?.length) { dispatch(means.delFile(v.id)).then((res => { if (res.success) { - fileList(v.projectId) + fileList(v.projectId || null) } })) } @@ -279,6 +279,16 @@ const Rest = (props) => {