인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

zizoen123님의 프로필 이미지
zizoen123

작성한 질문수

Jenkins를 이용한 CI/CD Pipeline 구축

실습6) Ansible Playbook으로 Docker 컨테이너 생성하기

실습6)Ansible Playbook 으로 Docker 컨테이너 생성에서 UNSTABLE 오류발생관련해 질문드립니다.

작성

·

888

0

안녕하세요 개인적으로 해결해보려했지만 실패하여 질문드립니다. Jenkins Configuration 에서 Exec command 를 입력한 후 빌드하였을 때, success 가 아닌 unstable오류가 발생합니다. 환경은 macOS m1 입니다.

 

[전문]

Started by user Administrator
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/My-Playbook-Project
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/My-Playbook-Project/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/KimTaeKang57/cicd-web-project # timeout=10
Fetching upstream changes from https://github.com/KimTaeKang57/cicd-web-project
 > git --version # timeout=10
 > git --version # 'git version 2.30.2'
 > git fetch --tags --force --progress -- https://github.com/KimTaeKang57/cicd-web-project +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/kimtaekang^{commit} # timeout=10
Checking out Revision 190229199b4c5da35d976e66d1c0cfecb6dc399c (refs/remotes/origin/kimtaekang)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 190229199b4c5da35d976e66d1c0cfecb6dc399c # timeout=10
Commit message: "jenkins ansible cicd test2"
 > git rev-list --no-walk 190229199b4c5da35d976e66d1c0cfecb6dc399c # timeout=10
Parsing POMs
Established TCP socket on 37051
[My-Playbook-Project] $ java -cp /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.14.jar:/var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.8.5/boot/plexus-classworlds-2.6.0.jar:/var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.8.5/conf/logging jenkins.maven3.agent.Maven35Main /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.8.5 /var/jenkins_home/war/WEB-INF/lib/remoting-3071.v7e9b_0dc08466.jar /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.14.jar /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.14.jar 37051
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/jenkins_home/workspace/My-Playbook-Project/pom.xml clean compile package
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.njonecompany.web:web >----------------------
[INFO] Building cicd-web-project maven webapp 1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ web ---
[INFO] Deleting /var/jenkins_home/workspace/My-Playbook-Project/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /var/jenkins_home/workspace/My-Playbook-Project/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ web ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/My-Playbook-Project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /var/jenkins_home/workspace/My-Playbook-Project/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ web ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.njonecompany.web.TestWelcome
10:56:52,415 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:56:52,415 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:56:52,416 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/var/jenkins_home/workspace/My-Playbook-Project/target/classes/logback.xml]
10:56:52,461 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:56:52,462 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
10:56:52,464 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
10:56:52,496 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
10:56:52,496 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
10:56:52,496 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
10:56:52,497 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.njonecompany.web] to DEBUG
10:56:52,497 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [com.njonecompany.web] to false
10:56:52,497 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[com.njonecompany.web]
10:56:52,497 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
10:56:52,497 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
10:56:52,497 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
10:56:52,497 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6e2aa843 - Registering current configuration as safe fallback point

2023-01-06 10:56:52 [main] DEBUG c.n.web.controller.WelcomeController - Welcome to njonecompany.com...
Fri Jan 06 10:56:52 UTC 2023

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /
       Parameters = {}
          Headers = []
             Body = <no character encoding set>
    Session Attrs = {}

Handler:
             Type = com.njonecompany.web.controller.WelcomeController
           Method = com.njonecompany.web.controller.WelcomeController#index(Model)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = index
             View = null
        Attribute = msg
            value = Hi, there
        Attribute = today
            value = Fri Jan 06 10:56:52 UTC 2023

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Language:"en"]
     Content type = null
             Body = 
    Forwarded URL = /WEB-INF/views/index.jsp
   Redirected URL = null
          Cookies = []
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.582 s - in com.njonecompany.web.TestWelcome
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[JENKINS] Recording test results
[INFO] 
[INFO] --- maven-war-plugin:3.2.2:war (default-war) @ web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [web] in [/var/jenkins_home/workspace/My-Playbook-Project/target/hello-world]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/jenkins_home/workspace/My-Playbook-Project/src/main/webapp]
[INFO] Webapp assembled in [49 msecs]
[INFO] Building war: /var/jenkins_home/workspace/My-Playbook-Project/target/hello-world.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.203 s
[INFO] Finished at: 2023-01-06T10:56:54Z
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /var/jenkins_home/workspace/My-Playbook-Project/pom.xml to com.njonecompany.web/web/1.0/web-1.0.pom
[JENKINS] Archiving /var/jenkins_home/workspace/My-Playbook-Project/target/hello-world.war to com.njonecompany.web/web/1.0/web-1.0.war
SSH: Connecting from host [d4ca119eba8c]
SSH: Connecting with configuration [ansible-server] ...
SSH: EXEC: completed after 204 ms
SSH: Disconnecting configuration [ansible-server] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

은 다음과 같고,

ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE

 

오류 상태는 다음과 같습니다.

 

 

답변 1

0

Dowon Lee님의 프로필 이미지
Dowon Lee
지식공유자

안녕하세요, 이도원입니다.

올려주신 메시지를 확인 해 보면, 마지막 문구에서 ‘Send build artifacts over SSH’ 가 보이네요. 해당 문구는 ‘ansible-server'에서 접속할 수 없다는 오류라서, Exec command를 수행하기 전이나 후에 빌드 된 결과물을 ansible-server로 복사하는 부분이 있을텐데, 복사가 안되는 문제인거 같습니다. 글로벌 설정에서 ansible-server로 등록 된 Host에 SSH 접속이 가능한지 다시 한번 확인해 보시면 좋을 것 같습니다.

감사합니다.

zizoen123님의 프로필 이미지
zizoen123

작성한 질문수

질문하기