Skip to content

jenkinsci/aliyun-oss-uploader-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins阿里云OSS上传插件

使用

1.下载源码&编译

git clone https://github.com/jenkinsci/aliyun-oss-uploader-plugin.git
cd aliyun-oss-uploader-plugin
mvn package -DskipTests

2.在plugins管理页面上传target下的hpi文件并安装,重启jenkins

3.修改项目,增加构建后操作,选择阿里云OSS上传

4.填写阿里云OSS配置信息

本地路径为相对于workspace的路径,例如填写为/abc,则本地路径为${WORKSPACE}/abc 本地路径可以设置为文件或目录。如果设置为文件则上传单个文件,设置为目录上传整个目录

构建

  1. 修改${USER}/.m2/settings.xml中的maven配置文件

mirrors节点中增加

<mirror>
  <id>repo.jenkins-ci.org</id>
  <url>https://repo.jenkins-ci.org/public/</url>
  <mirrorOf>m.g.o-public</mirrorOf>
</mirror>

pluginGroups节点中增加

<pluginGroup>org.jenkins-ci.tools</pluginGroup>

profiles节点中增加

<profile>
  <id>jenkins</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
</profile>
  1. 打包
mvn clean package -DskipTests
  1. 运行
mvn clean hpi:run