Skip to content

How to use environment variables in script #25

@iamface

Description

@iamface

I'm having issues utilizing the script area and using an environment variable within. I'm trying to use my TARGET variable which I have set and using for this plugin. I would also like to use it in a script after the rsync is complete.

image: drillster/drone-rsync
    environment:
      RSYNC_KEY:
        from_secret: key
      RSYNC_USER:
        from_secret: user
      TARGET:
        from_secret: target
    settings:
      hosts:
        from_secret: host
      source: artifact.tar.gz
      target:
        from_secret: target
      script:
        - cd $${TARGET}
        - ls -al

This does not change directories, but simply runs ls -al at the root. Am I using the variable incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions