私がGitHubに持っている私のプロジェクトの1つとして、ドッキング・イメージとしてビルドしてドッキング・ハブにプッシュしたかったのです。このプロジェクトはScalaのコードベースを持つBSBです。ここでDockerエラーを伴うコードとしてのJenkinsパイプライン
は私JenkinsFileが定義されている方法です。
#!groovy
node {
// set this in Jenkins server under Manage Jenkins > Credentials > System > Global Credentials
docker.withRegistry('https://hub.docker.com/', 'joesan-docker-hub-credentials') {
git credentialsId: '630bd271-01e7-48c3-bc5f-5df059c1abb8', url: 'https://github.com/joesan/monix-samples.git'
sh "git rev-parse HEAD > .git/commit-id"
def commit_id = readFile('.git/commit-id').trim()
println comit_id
stage "build" {
def app = docker.build "Monix-Sample"
}
stage "publish" {
app.push 'master'
app.push "${commit_id}"
}
}
}
私はジェンキンスサーバーからこれを実行しようとしたとき、私は次のエラーを取得する:
java.io.FileNotFoundException
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:167)
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:159)
at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:161)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:65)
at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:157)
at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:159)
at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:101)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE
これはVMの内部で実行されているので、 Azureでは、VMが外に出ることができないと思ったが、VMにsshしてGitリポジトリから引き出すことができたので、そうではないようだ。だからここで何が問題なの?どうすればこの仕事をすることができますか?
問題、あなたはそれを修正する方法について詳しく説明してもらえますし、固定しましたか?私は、あなたが問題をどのように解決したかについて上記で説明したことから理解できませんでした。したがって、あなたはもう少し精巧になりますか? – sparkr
明示しようとしました、ご意見ください。 – akumlehn
JenkinsのAdditioal Behaviorsはどこにありますか? – sparkr