无法从Jenkins推送GitHub

时间:2020-04-11 20:35:37

标签: jenkins github push git-push

首先,我想知道一件事:詹金斯(Jenkins)可以在GitHub软件仓库上推送分支主管吗?自从詹金斯(Jenkins)在本地克隆分支以来,我真的不知道。

我正在尝试用Job来做:我给仓库,depot.git和凭据提供访问权限,并提供推送GibHub仓库的权利。然后我正在使用此脚本:

cd GoSecuri-master
rm -rf pom.xml
echo '
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>groupId</groupId>
    <artifactId>GoSecuri</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>13</maven.compiler.source>
        <maven.compiler.target>13</maven.compiler.target>
    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.google.firebase/firebase-admin -->
        <dependency>
            <groupId>com.google.firebase</groupId>
            <artifactId>firebase-admin</artifactId>
            <version>6.8.1</version>
        </dependency>

    </dependencies>
</project>' > text.xml
cat text.xml
git add .
git commit -m "initial commit"
git push origin HEAD:master

但随后,该作业运行无止境!如果我使用“ git push origin master”,则会出现此错误:

+ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/mydepot'
Build step 'Exécuter un script shell' marked build as failure
Finished: FAILURE

请问您有什么解决方法吗?我在Google上寻找了一种解决方法,大约需要4个小时,但找不到任何帮助。谢谢。

0 个答案:

没有答案