Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Software is to be deployed to a live server using a declarative pipeline script. The server is connected as a jenkins node labeled LiveLinuxAgent. The

Software is to be deployed to a live server using a declarative pipeline script. The server is connected as a jenkins node labeled LiveLinuxAgent. The deploymen Commands, including a command that depends on a file's presence in the Jenkins workspace. This file contains sensitive information like API tokens and environment
What is the recommended approach for deploying this pipeline?
Pick ONE option
A)
node (Label: "LiveLinuxAgent"){
stage("Deploy to the server"){
fetch file Secretfiles.secrets;
sh " use $Secretfiles.secrets"
}
}
B)
node (Label: "LivelinuxAgent"){
stage("deploy to the server"){
withCredentials([string(credentialsId: 'Secrets', variable: 'Secrets.secrets')]){
sh "use $Secrets.secrets"
}
}
}
c)
pipeline{
agent {
label 'LiveLinuxAgent'
}
stages{
stage("deploy to the server"){
steps{
withCredentials([string(credentialsId: 'Secrets', variable: 'Secrets.secrets')]){
sh "use $Secrets.secrets"
}
}
}
}
}
D)
pipeline{
agent {
label 'LiveLinuxAgent'
}
stages{
stage("deploy to the server"){
steps{
withCredentials([file(credentialsId: 'Secrets', variable: 'Secrets.secrets')]){
sh "use $Secrets.secrets"
}
}
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

Students also viewed these Databases questions

Question

Draw a sampling distribution of a biased estimator.

Answered: 1 week ago