2017-03-25 1 views
0

전 GCE에서 젠킨스 CD와 k8s에 대해 머리를 쓰려고합니다. 응용 프로그램이 구축되지 않습니다 어떤 이유 https://cloud.google.com/solutions/continuous-delivery-jenkins-container-engineGCE에 젠킨스가 없습니다.

: enter image description here

이것은 젠킨스 콘솔 출력 내가 GCE에 대한 자습서를 따라하고 있습니다.

이 내 젠킨스 파일입니다

node { 
    def project = 'xxxxxx' 
    def appName = 'gceme' 
    def feSvcName = "${appName}-frontend" 
    def imageTag = "eu.gcr.io/${project}/${appName}:${env.BRANCH_NAME}.${env.BUILD_NUMBER}" 

    checkout scm 

    sh("echo Build image") 
    stage 'Build image' 
    sh("docker build -t ${imageTag} .") 

    sh("echo Run Go tests") 
    stage 'Run Go tests' 
    sh("docker run ${imageTag} go test") 

    sh("echo Push image to registry") 
    stage 'Push image to registry' 
    sh("gcloud docker push ${imageTag}") 

    sh("echo Deploy Application") 
    stage "Deploy Application" 
    switch (env.BRANCH_NAME) { 
    // Roll out to canary environment 
    case "canary": 
     // Change deployed image in canary to the one we just built 
     sh("sed -i.bak 's#eu.gcr.io/cloud-solutions-images/gceme:1.0.0#${imageTag}#' ./k8s/canary/*.yaml") 
     sh("kubectl --namespace=production apply -f k8s/services/") 
     sh("kubectl --namespace=production apply -f k8s/canary/") 
     sh("echo http://`kubectl --namespace=production get service/${feSvcName} --output=json | jq -r '.status.loadBalancer.ingress[0].ip'` > ${feSvcName}") 
     break 

    // Roll out to production 
    case "master": 
     // Change deployed image in canary to the one we just built 
     sh("sed -i.bak 's#eu.gcr.io/cloud-solutions-images/gceme:1.0.0#${imageTag}#' ./k8s/production/*.yaml") 
     sh("kubectl --namespace=production apply -f k8s/services/") 
     sh("kubectl --namespace=production apply -f k8s/production/") 
     sh("echo http://`kubectl --namespace=production get service/${feSvcName} --output=json | jq -r '.status.loadBalancer.ingress[0].ip'` > ${feSvcName}") 
     break 

    // Roll out a dev environment 
    default: 
     // Create namespace if it doesn't exist 
     sh("kubectl get ns ${env.BRANCH_NAME} || kubectl create ns ${env.BRANCH_NAME}") 
     // Don't use public load balancing for development branches 
     sh("sed -i.bak 's#LoadBalancer#ClusterIP#' ./k8s/services/frontend.yaml") 
     sh("sed -i.bak 's#eu.gcr.io/cloud-solutions-images/gceme:1.0.0#${imageTag}#' ./k8s/dev/*.yaml") 
     sh("kubectl --namespace=${env.BRANCH_NAME} apply -f k8s/services/") 
     sh("kubectl --namespace=${env.BRANCH_NAME} apply -f k8s/dev/") 
     echo 'To access your environment run `kubectl proxy`' 
     echo "Then access your service via http://localhost:8001/api/v1/proxy/namespaces/${env.BRANCH_NAME}/services/${feSvcName}:80/" 
    } 
} 

사람이 올바른 방향으로 저를 이끌어 주시겠습니까? 나는 길을 잃었다.

답변

0

존재하지 않는 dockerfile에 대한 심볼릭 링크를 만드는 중 문제가 발생했음을 분명히 알 수 있습니다. 주어진 위치를 추적하여 파일이 존재하고 필수 권한이 ​​있는지 확인하십시오.

0

절대 실패. Dockerfile을 잊었습니다 ...

관련 문제