Welcome to the Linux Foundation Forum!

Lab 6 Containers not building

I followed the directions and pushed upstream then created and accepted PR. However, when I am looking at the logs, I am not seeing containers being built. Below is my console output from my most recent worker-build:

  1. Started by an SCM change
  2. Running as SYSTEM
  3. Building in workspace /var/jenkins_home/workspace/instavote/worker-build
  4. The recommended git tool is: NONE
  5. No credentials specified
  6.  
  7.  
  8. git rev-parse --resolve-git-dir /var/jenkins_home/workspace/instavote/worker-build/.git # timeout=10
  9.  
  10.  
  11. Fetching changes from the remote Git repository
  12.  
  13.  
  14. git config remote.origin.url https://github.com/5c077-60rd0n/example-voting-app.git # timeout=10
  15.  
  16.  
  17. Fetching upstream changes from https://github.com/5c077-60rd0n/example-voting-app.git
  18.  
  19.  
  20. git --version # timeout=10

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Answers

  • I will just leave the tail of the log since it seems there is a char limit:

    1. <===[JENKINS REMOTING CAPACITY]===>channel started
    2. Executing Maven: -B -f /var/jenkins_home/workspace/instavote/worker-build/worker/pom.xml compile
    3. [INFO] Scanning for projects...
    4. [INFO]
    5. [INFO] ---------------------------< worker:worker >----------------------------
    6. [INFO] Building worker 1.0-SNAPSHOT
    7. [INFO] --------------------------------[ jar ]---------------------------------
    8. [INFO]
    9. [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ worker ---
    10. [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
    11. [INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/instavote/worker-build/worker/src/main/resources
    12. [INFO]
    13. [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ worker ---
    14. [INFO] Nothing to compile - all classes are up to date
    15. [INFO] ------------------------------------------------------------------------
    16. [INFO] BUILD SUCCESS
    17. [INFO] ------------------------------------------------------------------------
    18. [INFO] Total time: 1.527 s
    19. [INFO] Finished at: 2023-11-03T15:04:12Z
    20. [INFO] ------------------------------------------------------------------------
    21. Waiting for Jenkins to finish collecting data
    22. [JENKINS] Archiving /var/jenkins_home/workspace/instavote/worker-build/worker/pom.xml to worker/worker/1.0-SNAPSHOT/worker-1.0-SNAPSHOT.pom
    23. Triggering a new build of instavote » worker-test
    24. Finished: SUCCESS
  • This is my Jenkinsfile that resides in my worker directory: It shows code from Lab 7 as well.

    1. ipeline {
    2. agent {
    3. docker {
    4. image 'maven:3.6.1-jdk-8-slim'
    5. args '-v $HOME/.m2:/root/.m2'
    6. }
    7. }
    8.  
    9. stages {
    10. stage('build') {
    11. steps {
    12. echo 'building worker app'
    13. dir('worker') {
    14. sh 'mvn compile'
    15. }
    16. }
    17. }
    18. stage('test') {
    19. steps {
    20. echo 'running unit tests on morker app'
    21. dir('worker') {
    22. sh 'mvn clean test'
    23. }
    24. }
    25. }
    26. stage('package') {
    27. steps {
    28. echo 'packaging worker app into a jarfile'
    29. dir('worker') {
    30. sh 'mvn package -DskipTests'
    31. archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
    32. }
    33. }
    34. }
    35. stage('docker-package') {
    36. agent any
    37. steps {
    38. echo 'Packaging worker app with docker'
    39. script {
    40. docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
    41. def workerImage = docker.build("sagordondevops/worker:v${env.BUILD_ID}", "./worker")
    42. workerImage.push()
    43. workerImage.push('latest')
    44. }
    45. }
    46. }
    47. }
    48. }
    49.  
    50. post {
    51. always {
    52. echo 'the job is complete'
    53. }
    54. }
    55. }
  • Hi @scott.gordon, I'll go through Lab 6 and will provide you an update as soon as I can.

    Regards,
    Luis.

  • Posts: 1,268
    edited November 2023

    Hi @scott.gordon,

    The console output looks good, in fact it finished with "BUILD SUCCESS".

    What do you get when you take a look at the 'docker ps' with watch, as shown in the Validation section of Lab 6?

    Regards,
    Luis.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training