0

I want to rsync some files into a timestamped folder on a remote host. That would require something like:

pipeline:
  deploy:
    image: drillster/drone-rsync
    hosts: ["foo.com"]
    source: "./build/"
    target: "/home/app/deploy/${TIMESTAMP}/"

Is this possible?

mkaito
  • 1,005
  • 1
  • 10
  • 19

1 Answers1

0

Drone offers three distinct timestamp variables as part of the environment interpolation done before the yaml file is loaded:

DRONE_BUILD_CREATED
DRONE_BUILD_STARTED
DRONE_BUILD_FINISHED

Of these, the last is probably close enough in time to what would be generated by the theoretical example in the question, just off by a few seconds at worst. It's certainly good enough to timestamp deployments.

mkaito
  • 1,005
  • 1
  • 10
  • 19