Docker image push stage- Jenkins
def imageName = 'node'
stage ('Build Docker Image') {
environment {
DOCKER_CREDS = credentials('docker-registry-credentials')
}
steps {
sh 'docker login https://registry.docker.com -u $DOCKER_CREDS_USR -p $DOCKER_CREDS_PSW'
sh "docker build -t registry.docker.com/${orgName}/${imageName}:9 ."
sh "docker push registry.docker.com/${orgName}/${imageName}:9"
}
post {
success {
echo "Build Docker Image stage completed"
}
failure {
echo "Build Docker Image stage failed"
}
}
}
0 notes
Creating docker image with node, chrome and git
# taking debian as base image
From debian:stretch
# prints OS info
RUN cat /etc/os-release
# installing default JDK and curl
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y default-jdk
RUN apt-get install -y curl
# installing node and pre-requisites
RUN apt-get install -y gnupg2
RUN apt-get upgrade -y
RUN apt-get install -y curl software-properties-common
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt-get install -y nodejs
# installing build essentials
RUN apt-get install -y build-essential
# install xvfb
RUN apt-get install --fix-missing -y xvfb
# installing git
RUN apt-get install -y git-core
# installing chrome steps
RUN apt install -y wget
#Download the Google signing key and install it.
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
# Set up Google Chrome repository.
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
# Update repository index and install chrome.
RUN apt-get update && apt-get -y install google-chrome-stable
RUN google-chrome --version
0 notes
Karate testing reports - Jenkins
Ref:
https://github.com/intuit/karate
https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/DemoTestParallel.java
After karate html report is generated, the following code needs to be injected in the Jenkins stage code to see the “Karate Report” on the Jenkins.
publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'target',
reportFiles: 'cucumber-html-reports/overview-features.html',
reportName: 'Karate Report'
]
0 notes