我想为一个开源项目(特别是这一个)做出贡献,在这个项目所有者已经建立了Travis。我想集成工作服到这个项目,并发送一个拉-请求。当我拥有这个项目时,这个过程很简单:
.travis.yml和语言专用工具配置构建/测试系统repoToken从工作服上拿走repoToken作为环境变量添加到项目的Travis系统中.travis.yml的after_success循环中添加特定于语言的配置。但是,当我不拥有存储库时,我会遇到一些问题。
/github/myusername/forkedrepo工作服,当我向存储库所有者发送PR时,它将是相同的,而它必须是/github/ownersusername/originalrepo。repoToken到所有者的Travis构建系统,因为我不拥有它。所以我的问题是:
repoToken环境变量系统和/或为所有者创建一个工作服系统?提前谢谢。
环境
发布于 2019-06-29 05:33:14
您可能想要根据您想要使用的覆盖率工具修改自己的pom.xml,请参阅https://github.com/trautonen/coveralls-maven-plugin了解一些说明。
您可以避免在github!上发布的pom.xml文件中放置回购令牌
相反,您可以从命令行运行覆盖率报告。
下面是一个小助手脚本,它允许从命令行运行转换。只要把你的钱放在像$HOME/.工作服之类的地方或者其他类似的地方就行了。
#!/bin/bash
# WF 2019-06-26
# create test coverage report for coveralls
tokenpath=$HOME/.coveralls/coveralls.token
if [ ! -f $tokenpath ]
then
echo "Script needs coveralls token in $tokenpath to work" 1>&2
echo "Script can only be run successfully by project admins" 1>&2
echo "see https://github.com/trautonen/coveralls-maven-plugin" 1>&2
exit 1
else
token=$(cat $tokenpath)
# comment out to use jacoco
#mvn clean test jacoco:report coveralls:report -D jacoco=true -DrepoToken=$token
# comment out to use cobertura
mvn cobertura:cobertura coveralls:report -DrepoToken=$token
fi这里是一个使用环境变量的COVERALLS_TOKEN更新版本:
#!/bin/bash
# WF 2019-06-26
# create test coverage report for coveralls
# is the environment variable not set?
if [ "$COVERALLS_TOKEN" = "" ]
then
tokenpath=$HOME/.dukes/coveralls.token
if [ ! -f $tokenpath ]
then
echo "Script needs coveralls token in $tokenpath to or COVERALLS_TOKEN environment variable to work" 1>&2
echo "Script can only be run successfully by project admins" 1>&2
echo "see https://github.com/trautonen/coveralls-maven-plugin" 1>&2
echo "see https://stackoverflow.com/a/56815300/1497139" 1>&2
exit 1
fi
else
export COVERALLS_TOKEN=$(cat $tokenpath)
fi
# the jacoco variable tries triggering a profile - check your pom.xml
# for any profile being in use
mvn clean test jacoco:report coveralls:report -D jacoco=true
#mvn clean test jacoco:report coveralls:report -D jacoco=true -DrepoToken=$token
#mvn cobertura:cobertura coveralls:report
#mvn cobertura:cobertura coveralls:report -DrepoToken=$COVERALLS_TOKENhttps://stackoverflow.com/questions/52628775
复制相似问题