Skip to content

Push src and tags should happen separately, and in that order #110

@krishicks

Description

@krishicks

Presently when a put configured to push both tags and source is configured, it will use a git command that does both in one go. The problem I came across is that git pushes the tag prior to pushing the source. This is problematic when the tag successfully is pushed and the source cannot be because someone else has pushed to the remote.

https://github.com/concourse/git-resource/blob/master/assets/out#L87

I think this should become "push_src", and the call to "push_src_and_tags" should be an ordered push_src followed by push_tags to get around this issue.

I can make the PR if there's agreement.

Failure below:

Identity added: /tmp/git-resource-private-key (ci)
To github.com:pivotal-cf/pcf-pipelines.git
 * [new tag]         v0.2.0-rc.8 -> v0.2.0-rc.8
 ! [rejected]        HEAD -> master (fetch first)
error: failed to push some refs to 'git@github.com:pivotal-cf/pcf-pipelines.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

The solution to this for now is to do two separate puts, where the first pushes source and the second pushes tags.

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