소스 검색

Merge pull request #3616 from infosiftr/tag-sharedtags

Also tag SharedTags (and include them in dependency calculations, etc)
yosifkit 8 년 전
부모
커밋
d094acdf2c
2개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 1
      bashbrew/go/src/bashbrew/cmd-push.go
  2. 3 1
      bashbrew/go/src/bashbrew/repo.go

+ 9 - 1
bashbrew/go/src/bashbrew/cmd-push.go

@@ -3,6 +3,7 @@ package main
 import (
 	"fmt"
 	"os"
+	"path"
 	"time"
 
 	"github.com/codegangsta/cli"
@@ -28,12 +29,19 @@ func cmdPush(c *cli.Context) error {
 			return cli.NewMultiError(fmt.Errorf(`failed fetching repo %q`, repo), err)
 		}
 
+		tagRepo := path.Join(namespace, r.RepoName)
 		for _, entry := range r.Entries() {
 			if r.SkipConstraints(entry) {
 				continue
 			}
 
-			for _, tag := range r.Tags(namespace, uniq, entry) {
+			// we can't use "r.Tags()" here because it will include SharedTags, which we never want to push directly (see "cmd-put-shared.go")
+			for i, tag := range entry.Tags {
+				if uniq && i > 0 {
+					break
+				}
+				tag = tagRepo + ":" + tag
+
 				created := dockerCreated(tag)
 				lastUpdated := fetchDockerHubTagMeta(tag).lastUpdatedTime()
 				if created.After(lastUpdated) {

+ 3 - 1
bashbrew/go/src/bashbrew/repo.go

@@ -147,7 +147,9 @@ func (r Repo) Entries() []manifest.Manifest2822Entry {
 func (r Repo) Tags(namespace string, uniq bool, entry manifest.Manifest2822Entry) []string {
 	tagRepo := path.Join(namespace, r.RepoName)
 	ret := []string{}
-	for i, tag := range entry.Tags {
+	tags := append([]string{}, entry.Tags...)
+	tags = append(tags, entry.SharedTags...)
+	for i, tag := range tags {
 		if uniq && i > 0 {
 			break
 		}