diff --git a/source/_posts/linux/博客图片迁移记.md b/source/_posts/linux/博客图片迁移记.md index 281d997..d582889 100644 --- a/source/_posts/linux/博客图片迁移记.md +++ b/source/_posts/linux/博客图片迁移记.md @@ -1,6 +1,6 @@ --- title: 博客图片迁移记 -date: 2019-03-30 20:45:01 +date: 2019-4-18 10:53:34 tags: - jenkins - nodejs @@ -217,5 +217,16 @@ hexo.extend.filter.register('before_post_render', function(data){ 如果此时修改文章中的图片路径, 静态化之后的文件就是指向对象仓库的URL地址了 日常编写正则处理一下( 注意使用前瞻断言, 正则尽可能精确, 避免影响到其他内容 ) -### 5.执行构建 +### 5.验证 以上所有做好之后, 在jenkins里面执行构建验证文件同步是否成功 +![执行构建](/images/linux/nos/执行构建.png) + +之前的构建步骤没什么变化, 最后调用nodejs脚本只要成功把新图片上传上去就可以了 +然后访问博客 +查看文章页面中的图片路径是否正确 +![文章图片路径](/images/linux/nos/文章图片路径.png) + +### 未竟的事情 +1. 脚本当中只是简单比较文件路径和文件名来确定文件是否在对象仓库存在, 并没有精确比对文件是否有差异 +严格来说应该在本地读取文件获取到md5值, 然后根据listObject接口返回拿到的md5值进行比对 +2. 上传过程的成功未进行本地md5值与服务器回传的md5值的比对, 不能确定上传过程数据的完整性 \ No newline at end of file diff --git a/source/images/linux/nos/执行构建.png b/source/images/linux/nos/执行构建.png new file mode 100644 index 0000000..dcfa94c Binary files /dev/null and b/source/images/linux/nos/执行构建.png differ diff --git a/source/images/linux/nos/文章图片路径.png b/source/images/linux/nos/文章图片路径.png new file mode 100644 index 0000000..7f552c8 Binary files /dev/null and b/source/images/linux/nos/文章图片路径.png differ