Do I handover the value via parameter correctly?

Do I handover the value via parameter correctly?

Hi all

I have created the following pipelines:

kind: pipeline
type: docker
name: DEV build, push and deployment

steps:
  ....
  ....

  - name: Promote to STAGE
    image: appleboy/drone-ssh
    environment:
      GIT_REPO: ${DRONE_REPO}
      BUILD_NUMBER_REPO: ${DRONE_BUILD_NUMBER}
      SEMVER_REPO: ${DRONE_SEMVER_SHORT}
      ENV_REPO: stage
    settings:
      host: app.example.io
      username: 
        from_secret: app_vps_user
      password:
        from_secret: app_vps_pw
      port: 22
      script:
        - drone build promote "$GIT_REPO" "$BUILD_NUMBER_REPO" "$ENV_REPO" --param=SEMVER_REPO="$SEMVER_REPO"

trigger:
  event:
    - tag

image_pull_secrets:
  - dockerconfig

---
kind: pipeline
type: docker
name: STAGE deployment

steps:

  - name: Deploy to STAGE
    image: hub.example.io/devops/argcd-cli:0.1.38
    environment:
      ....
      IMAGE_VERSION: ${SEMVER_REPO}
      ....
    commands:
      - /sh/main.sh

trigger:
  event:
  - promote
  target:
  - stage

image_pull_secrets:
  - dockerconfig
  

As you can see above, on the stage DEV build, push and deployment in the pipeline Deploy to STAGE I have promoted for the next environment and have passed a parameter:

--param=SEMVER_REPO="$SEMVER_REPO"

On the second stage in the pipeline Deploy to STAGE, I use the passed parameter as follows:

    environment:
      ....
      IMAGE_VERSION: ${SEMVER_REPO}

The question is, do I use the passed parameter in the right way?

Thanks

Hello there,

The used way of passing this parameter looks valid offhand, kindly confirm if there is any issue faced here due to this and share more details around the same to investigate further.

Thanks!!

1 Like