蒜蓉粉丝蒸扇贝 2020-02-20
version: 1 type: maven resolver: snapshotRepo: maven-virtual releaseRepo: maven-virtual serverID: Default-Server deployer: snapshotRepo: maven-virtual releaseRepo: maven-virtual serverID: Default-Server
在项目目录下编写配置文件 (jira-cli.conf)
version: 1 issues: serverID: Default-Server trackerName: JIRA regexp: (.+-[0-9]+)\s-\s(.+) keyGroupIndex: 1 summaryGroupIndex: 2 trackerUrl: http://my-jira.com/issues aggregate: true aggregationStatus: RELEASED
ARTIFACTORY_URL http://192.168.230.32:8081/artifactory ARTIFACTORY_USER admin ARTIFACTORY_PASS password MAVEN_REPO_KEY maven-virtual
* 在项目目录下编写脚本(.gitlab-ci.yml) image: docker:git services: - docker:dind stages: - build build: image: maven:3.5.4-jdk-8-alpine stage: build script: # Install - apk add git # Set the M2_HOME environment variable - export M2_HOME=/usr/share/maven # Download JFrog CLI - curl -fL https://getcli.jfrog.io | sh # Configure Artifactory instance with JFrog CLI - ./jfrog rt config --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS - ./jfrog rt c show # Mvn clean install - ./jfrog rt mvn "clean install" maven.conf --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID # Collect the environment variables - ./jfrog rt bce gitlabci-maven-artifactory $CI_JOB_ID # Add jira issue - ./jfrog rt bag gitlabci-maven-artifactory $CI_JOB_ID --config jira-cli.conf # Add sonar(optional) - ./jfrog rt sp "maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "qulity.gate.sonarUrl=http://192.168.230.156:9000/dashboard/index/gitlabci-maven-artifactory" # Add properties(optional) - ./jfrog rt sp "maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "deploy.tool=ansible" - ./jfrog rt sp "maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "ip=127.0.0.1" # Pass the build information to Artifactory - ./jfrog rt bp gitlabci-maven-artifactory $CI_JOB_ID # Promote - ./jfrog rt bpr gitlabci-maven-artifactory $CI_JOB_ID maven-pro-local # Xray scan(optional) - ./jfrog rt bs gitlabci-maven-artifactory $CI_JOB_ID --fail=false # Download(optional) - ./jfrog rt dl maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/multi3-3.7-20191213.050538-8.war all-my-frogs/ when: manual
HAP-1007 - This is a sample issue
* 执行构建(可配置手动或自动执行) CI/CD--Pipelines
* Job中查看构建输出
* artifactory中的issue信息(可点击 HAP-1007 链接至 Jira 地址)
更多?精彩内容?请微信搜索公众号:jfrogchina
??更多技术分享?可以关注?2?月?20?日在线课堂:《Artifactory & GitLab CI持续集成实践》
课程介绍
现在随着开源项目越来越多,大部分开发人员都会去引用大量第三方依赖,开源第三方组件的使用频率大幅增加。引用第三方已经开发好的组件给我们所有开发者带来极大的便利,减少了大量的重复性工作,提升了开发效率。但同时也给我们带来了一些隐患,因为开源并不代表这个软件是安全的,如何对引用第三方包进行安全管控是企业需要关注的问题
课程收益
本次课程主要介绍JFrog Xray如何解决第三方组件的安全问题。
本期话题
课堂活动
本期课堂讲师会在结束前进行抽奖活动
第一名:小米蓝牙耳机
第二名:JFrog新版T恤
第三名:JFrog新版T恤