Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create a local directory on host-machine, where you want to store the container-logs. mkdir /jenkins/:

    Code Block
    titleSetup Volume for Jenkins container on Host-machine
    mkdir /jenkins
    sudo chown -R 1000:1000 /jenkins/


  • Install/setup Jenkins using the command:

    Code Block
    docker run --name JENKINS-CONTAINER-NAME --rm --detach --privileged --network jenkins --network-alias docker --volume /jenkins:/var/jenkins_home --publish 2376:2376 -p 80:8080 -p 50000:50000 mehmoodasif/jenkins 
  • A

...


Setup credentials to access Nexus Akraino Repository: 

  • Create an a .netrc file as follows:

    Code Block
    title.netrc file
    machine nexus.akraino.org login LFID_USERID password LFID_PASSWORD


  • Copy the .netrc file to /jenkins/ directory of host-machine. 

Push logs to Nexus Akraino Repository:

...

Create an .sh file. We named it as push-logs.sh.:

Code Block
titleAn example (sh-script) to push logs to Nexus Akraino Repository
NEXUS_URL=https://nexus.akraino.org
SILO=<silo name provided above>
JENKINS_HOSTNAME=<hostname/IP of your Jenkins host>

# JOB_NAME and BUILD_NUMBER should be set by Jenkins 
BUILD_URL="${JENKINS_HOSTNAME}/job/${JOB_NAME}/${BUILD_NUMBER}/"

NEXUS_PATH="${SILO}/job/${JOB_NAME}/${BUILD_NUMBER}"

lftools deploy logs $NEXUS_URL $NEXUS_PATH $BUILD_URL
 
echo "Logs uploaded to $NEXUS_URL/content/sites/logs/$NEXUS_PATH"

...