Skip to content

Releasing lock ignores metadata #38

@rjosephwright

Description

@rjosephwright

I am trying to do an atomic update of metadata, and the update parameter does not help because I have to create or modify the metadata outside of the lock. Doing so would potentially cause the step to overwrite an update that happens after I get the lock to be able to modify it.

What I would like to do is this:

      - do:
          - put: environment_pool
            params:
              claim: environment-1

          - get: environment-1
            resource: environment_pool

          - task: update_metadata
            file: shared_tasks/update-metadata.yml
            input_mapping:
              environment: environment-1
              project_repo: my_application_repo
              build_version: my_application_version
            output_mapping:
              environment_out: environment_out
            params:
              APPLICATION_NAME: my_application

        ensure:
          put: environment_pool
          params:
            # This should(?) commit the metadata from environment_out
            release: environment_out

It seems like it would be a simple change to have UnclaimLock() take inDir as a parameter and do the mv command from there. However, I wonder if there are reasons for not doing it this way. Is there any other workaround I might use?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions