Browse Source

构建文件

dev
巴林闲侠 2 years ago
parent
commit
459385b711
  1. 29
      api/Dockerfile
  2. 6
      jenkinsfile_api
  3. 6
      jenkinsfile_web
  4. 76
      t --hard
  5. 30
      web/Dockerfile

29
api/Dockerfile

@ -1,14 +1,29 @@
FROM FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder
COPY . /var/app
WORKDIR /var/app
EXPOSE 8080
RUN npm config set registry=http://10.8.30.22:7000
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 http://10.8.30.22:7000
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12
COPY --from=builder --chown=node /var/app /home/node/app
WORKDIR /home/node/app
CMD ["node", "server.js"]
# FROM node:8-alpine
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
# FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
MAINTAINER liuxinyi "liu.xinyi@free-sun.com.cn"
# MAINTAINER liuxinyi "liu.xinyi@free-sun.com.cn"
COPY . /var/app
# COPY . /var/app
WORKDIR /var/app
# WORKDIR /var/app
EXPOSE 8080
# EXPOSE 8080
CMD ["-a", "http://10.8.30.35:19084", "-e", "iota-n1:9200,iota-n2:9200,iota-n3:9200,iota-n4:9200"]
# CMD ["-a", "http://10.8.30.35:19084", "-e", "iota-n1:9200,iota-n2:9200,iota-n3:9200,iota-n4:9200"]
ENTRYPOINT [ "node", "server.js" ]
# ENTRYPOINT [ "node", "server.js" ]

6
jenkinsfile_api

@ -10,9 +10,9 @@ pipeline {
steps {
sh 'switch-auth.sh anxinyun'
buildName "#${BUILD_NUMBER} ~/fs-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} ./api'
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
buildDescription "harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}"
sh 'nerdctl build -t harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./api'
sh 'nerdctl push harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
}
}
}

6
jenkinsfile_web

@ -10,9 +10,9 @@ pipeline {
steps {
sh 'switch-auth.sh anxinyun'
buildName "#${BUILD_NUMBER} ~/fs-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} ./web'
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
buildDescription "harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}"
sh 'nerdctl build -t harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./web'
sh 'nerdctl push harbor.anxinyun.cn/iot/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
}
}
}

76
t --hard

@ -1,76 +0,0 @@
2adac9cb (HEAD -> dev) HEAD@{0}: reset: moving to HEAD^^^
e5135673 (origin/dev_backup) HEAD@{1}: reset: moving to HEAD^^
020d4eda (origin/dev) HEAD@{2}: reset: moving to HEAD
020d4eda (origin/dev) HEAD@{3}: reset: moving to HEAD
020d4eda (origin/dev) HEAD@{4}: commit: 12151
d13b52a9 HEAD@{5}: reset: moving to HEAD
d13b52a9 HEAD@{6}: pull --tags origin dev: Fast-forward
2d649d8e HEAD@{9}: pull --tags origin dev: Merge made by the 'ort' strategy.
1a9dd433 HEAD@{10}: commit: 清除log
a9d12cd8 HEAD@{11}: pull --tags origin dev: Merge made by the 'ort' strategy.
8573588e HEAD@{12}: commit: 五分钟刷新
39b8e12b HEAD@{13}: pull --tags origin dev: Fast-forward
6aba4d7a HEAD@{14}: pull --tags origin dev: Merge made by the 'ort' strategy.
2e6dc29a HEAD@{15}: commit: 提交
283a16ae HEAD@{16}: pull --tags origin dev: Merge made by the 'ort' strategy.
590ec5dd HEAD@{17}: commit: 提交
8eb418ae HEAD@{19}: commit: 日期去掉了日,加上了百分号
bf01c153 HEAD@{20}: commit: 提交
76ad089b HEAD@{21}: pull --tags origin dev: Merge made by the 'ort' strategy.
45f58fda HEAD@{22}: commit: 代码提交
d9079d38 HEAD@{23}: commit: 提交日期处理
8e0048ac HEAD@{24}: pull --tags origin dev: Fast-forward
c1607d94 HEAD@{25}: pull --tags origin dev: Fast-forward
670dcf18 HEAD@{26}: pull --tags origin dev: Merge made by the 'ort' strategy.
ec02aeb9 HEAD@{27}: commit: nan优化
974e3c67 HEAD@{28}: commit: 换成定位了
a61dc4e9 HEAD@{29}: pull --tags origin dev: Fast-forward
d77627f9 HEAD@{30}: pull --tags origin dev: Merge made by the 'ort' strategy.
01ef6b5a HEAD@{31}: commit: 柱体问题解决
e9424d3e HEAD@{32}: pull --tags origin dev: Merge made by the 'ort' strategy.
c276432d HEAD@{33}: commit: 样式和颜色提交
45c415e6 (origin/release_0.0.4) HEAD@{34}: pull --tags origin dev: Fast-forward
79723f61 HEAD@{35}: commit: 线条
9c81764c HEAD@{36}: pull --tags origin dev: Merge made by the 'ort' strategy.
3f398ea2 HEAD@{37}: commit: 提交bug
502b068d HEAD@{38}: pull --tags origin dev: Merge made by the 'ort' strategy.
7a5b8b64 HEAD@{39}: commit: 提交
aeff1fe5 HEAD@{40}: commit: 路由修改
11da9451 HEAD@{41}: pull --tags origin dev: Merge made by the 'ort' strategy.
ed7ab5a8 HEAD@{42}: commit: 完成
06063067 HEAD@{43}: pull --tags origin dev: Merge made by the 'ort' strategy.
755a333f HEAD@{44}: commit: 接口调用
2b153823 HEAD@{45}: pull --tags origin dev: Merge made by the 'ort' strategy.
f0558530 HEAD@{46}: commit: 路政统计
50eb042e HEAD@{47}: pull --tags origin dev: Merge made by the 'ort' strategy.
a1dfeddb HEAD@{48}: commit: 提交鼠标移出事件
5469d9df HEAD@{49}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
49a0b5d7 HEAD@{50}: commit: 提交
11279671 HEAD@{51}: commit: 提交领导驾驶舱
3919e2c3 HEAD@{52}: pull --tags origin dev: Merge made by the 'ort' strategy.
b9302fdf HEAD@{53}: commit: 提交代码
79328f49 HEAD@{54}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
c6a3b352 HEAD@{55}: commit: 提交样式
14ed5747 HEAD@{56}: pull --tags origin dev: Fast-forward
80e11974 HEAD@{57}: pull --tags origin dev: Merge made by the 'ort' strategy.
a561e62b HEAD@{58}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
163ce6c1 HEAD@{59}: commit: 提交left.less的更改
4de26fc7 HEAD@{60}: pull: Fast-forward
4a1ae175 HEAD@{61}: pull --tags origin dev: Fast-forward
e7a01d52 HEAD@{62}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
c7e7cd4c HEAD@{63}: commit: 提交领导驾驶舱
fc3f2a92 HEAD@{64}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
f166aa29 HEAD@{65}: commit: 领导驾驶舱提交代码
e6030bcf HEAD@{66}: commit: 上传
b299cd97 HEAD@{67}: pull --tags origin dev: Merge made by the 'ort' strategy.
69e7f3b6 HEAD@{68}: commit: 删除冗余,提交
a74afb8f HEAD@{69}: commit: 文件
68c13e99 HEAD@{70}: commit: 文件上传
dacf49b4 HEAD@{71}: commit: 文件上传
1190cc0d HEAD@{72}: commit (merge): Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev
0c57a227 HEAD@{73}: commit: 头部样式完成
8ab4f5f2 HEAD@{74}: pull --tags origin dev: Merge made by the 'ort' strategy.
50714cbf HEAD@{75}: commit: 公共组件图标样式修改
34413ac0 HEAD@{76}: commit: test
eee5aedf HEAD@{77}: commit: test
cbdfefa3 (master) HEAD@{79}: clone: from https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good.git

30
web/Dockerfile

@ -1,12 +1,30 @@
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder
COPY . /var/app
WORKDIR /var/app
EXPOSE 8080
RUN npm config set registry=http://10.8.30.22:7000
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f
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 http://10.8.30.22:7000
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20
COPY --from=builder --chown=node /var/app /home/node/app
WORKDIR /home/node/app
CMD ["node", "server.js"]
#FROM node:12-alpine
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
# FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
MAINTAINER liuxinyi "liu.xinyi@free-sun.com.cn"
# MAINTAINER liuxinyi "liu.xinyi@free-sun.com.cn"
COPY . /var/app
# COPY . /var/app
WORKDIR /var/app
# WORKDIR /var/app
EXPOSE 5000
# EXPOSE 5000
ENTRYPOINT [ "node", "server.js" ]
# ENTRYPOINT [ "node", "server.js" ]
Loading…
Cancel
Save