DevOps and System Administration Discussions
Dive into SAP DevOps and system administration. Join discussions to collaborate on optimizing workflows, share knowledge, and leverage resources effectively.
cancel
Showing results for 
Search instead for 
Did you mean: 

Starting Azure DevOps Pipeline with Project Piper for Cloud Integration Artifacts

Clen
Participant
0 Kudos

Hello community,

I tried to upload an iFlow using Piper command as part of the Azure DevOps pipeline but I got the below error. Any idea?

<code>Starting: CmdLine
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.198.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
bin/piper integrationArtifactDeploy --apiServiceKey {     "oauth": {         "clientid": "xx-xxxxxxxxx-xxx-xxxxxxxx|it!xxx",         "clientsecret": "xxxxx-xxx-xxxxxxxxxxxxxxxxxxxxxxxxxx=",         "url": "https://xxxxxxtrial.it-cpitrial05.cfapps.us10-001.hana.ondemand.com",         "tokenurl": "https://xxxxxxtrial.authentication.us10.hana.ondemand.com/oauth/token"     } } --integrationFlowId CostCenter_Replication_from_X_to_Y
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/f57a3325-1a48-416a-bcc0-887986890779.sh
info  integrationArtifactDeploy - Using stageName '__default' from env variable
info  integrationArtifactDeploy - Project config: NONE ('.pipeline/config.yml' does not exist)
info  integrationArtifactDeploy - fatal error: errorDetails****"category":"undefined","correlationId":"https://dev.azure.com/xxxxxxx/SCP-Pipeline/_build/results?buildId=38","error":"error unmarshalling serviceKey: unexpected end of JSON input","library":"SAP/jenkins-library","message":"step execution failed","result":"failure","stepName":"integrationArtifactDeploy"}
fatal integrationArtifactDeploy - step execution failed - error unmarshalling serviceKey: unexpected end of JSON input
##[error]Bash exited with code '1'.
Finishing: CmdLine

Below the pipeline set up.

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- main

jobs:
  - job: downloadPiper
    pool:
      vmImage: ubuntu-latest
    steps:
    - checkout: none
    - task: Cache@2
      inputs:
        key: piper-go-official
        path: bin
        cacheHitVar: FOUND_PIPER
      displayName: Cache piper go binary
    - script: |
          mkdir -p bin
          curl -L --output bin/piper https://github.com/SAP/jenkins-library/releases/download/v1.190.0/piper
          chmod +x bin/piper
      condition: ne(variables.FOUND_PIPER, 'true')
      displayName: 'Download Piper'
    - script: bin/piper version
      displayName: 'Piper Version'

  - job: uploadiFlow
    dependsOn: downloadPiper
    variables:
    - group: development
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - task: Cache@2
      inputs:
        key: piper-go-official
        path: bin 
      displayName: upload iflow
    - script: |
        bin/piper integrationArtifactUpload --verbose --apiServiceKey $(CREDENTIALS) --filePath iflows/CostCenter_Replication_from_X_to_Y.zip --integrationFlowId CostCenter_Replication_from_X_to_Y --integrationFlowName CostCenter_Replication_from_X_to_Y --packageId garage_demo_azure
Kind regards
Alexander
1 REPLY 1

Clen
Participant
0 Kudos

The $(CREDENTIALS) should be changed little the endcoded characters.

Kind regards
Alexander