forward3d/cap-deploy-tagger

Tag the remote origin repo instead of the working one

Closed this issue · 4 comments

Hi,
nice toolset. We use a deployment setup, were our repositories are inside of Gitlab. When theres a new push to the Repo it triggers the GitLab CI, which does some sweet tests and then fires up Capistrano to deploy into the respective Environment.
Just wondering if there's a way to tag into the remote repository and not just on the local checked out?

Cheers

I'm not sure I understand.

It creates a tag in your local clone of the repository, then does a push --tags to push this to the remote. Is that not what you want? I don't understand what you mean by "tag into the remote repository".

This is exactly what i mean.. So this is already the way it's implemented?
I've just checked the output on our CI and there is the cap-deploy-tag line as
[cap-deploy-tagger] Tagged 5107bde with Deployed to Develop_staging
But when i check back in GitLab there are no Tags pushed.

So i thought that only the local repo clone would be tagged.
Capistrano doesn't output any error after the tag has set..

Here's the code - you can see it tags, then pushes. There must be something going south when the push happens. I've just noticed it doesn't log a thing - I'll push a new version with some logging so you can see what happens.

def self.tag(tag, stage)
  git "tag -f #{tag}_#{stage}"
  git "push -f --tags"
  "#{tag}_#{stage}"
end

def self.git(cmd)
  `git #{cmd} 2>&1`.chomp
end

def self.latest_revision
  git "rev-parse --short HEAD"
end

Yup, i think you're right. I've just checked the Gitlab-CI settings and it seems like there is a working repository generated on the fly. Because tagging manually inside the buildscript also works but is not shown in Gitlab. So this not a problem with your gem but with the way the ci works. I'll check that ...

Thanks for you quick reply!
Cheers