Skip to content

Commit 9fd35cd

Browse files
committed
Update jenkins sample to Cloud Pak for Data 4.5
1 parent b180044 commit 9fd35cd

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

samples/jenkins/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To upload config file as a Jenkins secret, open the [credentials configuration p
7373
Add the credentials with the following configuration:
7474
- Kind: Secret file
7575
- File: Select cpdctl configuration file copied in the previous step
76-
- ID: CPDCTL_CPD402_CONFIG
76+
- ID: CPDCTL_CPD450_CONFIG
7777
- Description: Description of the credentials
7878

7979
![secret-file-credentials.png](img/secret-file-credentials.png)
@@ -136,7 +136,7 @@ into text files, located in the [pipelines](pipelines) directory. The division m
136136
All of the pipelines have some common steps, to set up a working environment, install dependencies or to define the stage:
137137
1. `node` - allocates an executor on a build agent (node) and runs further code in the context of a workspace on that agent.
138138
In this sample, the default agent is used.
139-
2. `withCredentials([file(credentialsId: 'CPDCTL_CPD402_CONFIG', variable: 'CPDCONFIG')])` - loads cpdctl configuration file
139+
2. `withCredentials([file(credentialsId: 'CPDCTL_CPD450_CONFIG', variable: 'CPDCONFIG')])` - loads cpdctl configuration file
140140
from a secret file uploaded to Jenkins in the Credentials section.
141141
3. `checkout scm` - the code from the Source Control Management defined in the job configuration.
142142
4. `stage` - defines the pipeline stage

samples/jenkins/pipelines/dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node {
2-
withCredentials([file(credentialsId: 'CPDCTL_CPD402_CONFIG', variable: 'CPDCONFIG')]) {
2+
withCredentials([file(credentialsId: 'CPDCTL_CPD450_CONFIG', variable: 'CPDCONFIG')]) {
33
checkout scm
44

55
stage('Install cpdctl') {

samples/jenkins/pipelines/prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node {
2-
withCredentials([file(credentialsId: 'CPDCTL_CPD402_CONFIG', variable: 'CPDCONFIG')]) {
2+
withCredentials([file(credentialsId: 'CPDCTL_CPD450_CONFIG', variable: 'CPDCONFIG')]) {
33
checkout scm
44

55
stage('Install cpdctl') {

samples/jenkins/pipelines/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node {
2-
withCredentials([file(credentialsId: 'CPDCTL_CPD402_CONFIG', variable: 'CPDCONFIG')]) {
2+
withCredentials([file(credentialsId: 'CPDCTL_CPD450_CONFIG', variable: 'CPDCONFIG')]) {
33
checkout scm
44

55
stage('Install cpdctl') {

samples/jenkins/scripts/dev/train_model.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ notebook_id=$(find_asset notebook "train_model")
3030
env_id=$(cpdctl environment list --output json -j "resources[?metadata.name=='$env_name'] | [0].metadata.asset_id" --raw-output)
3131
echo "Using notebook environment '$env_name': $env_id"
3232

33-
cpd_url=$(cpdctl config profile get cpd --output json -j 'Profile.URL' --raw-output)
33+
# assume there is only single profile configured
34+
cpd_url=$(cpdctl config profile list --output json -j '[0].Profile.URL' --raw-output)
35+
3436
# assume there is only single user configured
35-
user_name=$(cpdctl config user list --output json -j '[0].Name' --raw-output)
36-
user_apikey=$(cpdctl config user get demouser --output json -j "User.Apikey.Value" --raw-output)
37+
user=$(cpdctl config user list --output json -j '[0].Name' --raw-output)
38+
user_name=$(cpdctl config user get "${user}" --output json -j 'User.Username' --raw-output)
39+
user_apikey=$(cpdctl config user get "${user}" --output json -j "User.Apikey.Value" --raw-output)
3740

3841
cat > job.json <<-EOJSON
3942
{

0 commit comments

Comments
 (0)