Add `pod push` command #51

Closed
alloy opened this Issue Nov 7, 2011 · 8 comments

Comments

Projects
None yet
4 participants
Contributor

lukeredpath commented Feb 7, 2012

In the absence of this push command, here's a little script I knocked up that publishes the podspec in your current directory to master, assuming you have push access:

#!/usr/bin/env macruby
require 'rubygems'
require 'cocoapods'
require 'pathname'
require 'fileutils'

MASTER_REPO_PATH = File.expand_path("~/.cocoapods/master")

spec_path = Pathname.glob("*.podspec")[0]

unless spec_path
  puts "Couldn't find .podspec file in current directory."
  exit 1
end

spec = Pod::Specification.from_file(spec_path)

output_path = File.join(MASTER_REPO_PATH, spec.name, spec.version.to_s)

FileUtils.mkdir_p(output_path)
FileUtils.cp(spec_path, output_path)

Dir.chdir(MASTER_REPO_PATH) do
  system "git pull --rebase"
  system "git add #{spec.name}"
  system "git commit -m 'Added spec for #{spec.name} (v#{spec.version.to_s})'"
  system "git push"
end
Owner

alloy commented Feb 7, 2012

That looks good enough to me. The commands aren’t very well tested atm, nor do I think most of them really need it, so please do merge this as the pod push command and we’ll improve it as we go.

Contributor

lukeredpath commented Feb 7, 2012

OK, I'll see if I can find an hour later to play. I've just called it a day on some client work so it's time for a break!

Owner

alloy commented Feb 7, 2012

Well said, sir, well said.

This was referenced Feb 22, 2012

Owner

alloy commented Mar 19, 2012

Idea: pod release – updates the podspec automagically from your repo. (I know there are several challenges involved and the interface would have to be interactive, at least the first time you run it)

Steps:

  1. pod release (in the repo)
  2. cocoapods extracts the latest version tag (via git).
  3. cocoapods clones or finds the CocoaPods repo (also asks for confirmation and pulls in the case of clone).
  4. cocoapods creates a new version for the pod.
  5. cocoapods pushes after showing the spec and asking for confirmation.

From CocoaPods/Specs@85b146b#commitcomment-1100432.

Owner

floere commented Mar 19, 2012

@alloy Thanks for moving it to the right issue!

Owner

fabiopelosin commented Apr 26, 2012

Steps:

  1. pod release (in the repo)
  2. cocoapods extracts the latest version tag (via git).
  3. cocoapods clones or finds the CocoaPods repo (also asks for confirmation and pulls in the case of clone).
  4. cocoapods creates a new version for the pod.
  5. cocoapods pushes after showing the spec and asking for confirmation.

Is this issue closed by 1161684? The logic discussed here is not exactly implemented.

Owner

fabiopelosin commented Aug 21, 2012

I'm closing this as the current implementation of pod push appears to work well enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment