-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: generate docker tags args from sourcegraph/sourcegraph
- Loading branch information
Showing
6 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
root_dir="$(dirname "${BASH_SOURCE[0]}")/.." | ||
cd "$root_dir" | ||
|
||
CONSTRAINT=$1 | ||
|
||
# Using `go run` ensures we are using the version of `update-docker-tags` pinned in `go.mod` | ||
go run github.com/slimsag/update-docker-tags \ | ||
-enforce="sourcegraph/cadvisor=$CONSTRAINT" \ | ||
-enforce="sourcegraph/frontend=$CONSTRAINT" \ | ||
-enforce="sourcegraph/jaeger-agent=$CONSTRAINT" \ | ||
-enforce="sourcegraph/github-proxy=$CONSTRAINT" \ | ||
-enforce="sourcegraph/gitserver=$CONSTRAINT" \ | ||
-enforce="sourcegraph/grafana=$CONSTRAINT" \ | ||
-enforce="sourcegraph/indexed-searcher=$CONSTRAINT" \ | ||
-enforce="sourcegraph/search-indexer=$CONSTRAINT" \ | ||
-enforce="sourcegraph/jaeger-all-in-one=$CONSTRAINT" \ | ||
-enforce="sourcegraph/postgres-11.4=$CONSTRAINT" \ | ||
-enforce="sourcegraph/precise-code-intel-worker=$CONSTRAINT" \ | ||
-enforce="sourcegraph/codeintel-db=$CONSTRAINT" \ | ||
-enforce="sourcegraph/syntax-highlighter=$CONSTRAINT" \ | ||
-enforce="sourcegraph/prometheus=$CONSTRAINT" \ | ||
-enforce="sourcegraph/query-runner=$CONSTRAINT" \ | ||
-enforce="sourcegraph/redis-cache=$CONSTRAINT" \ | ||
-enforce="sourcegraph/redis-store=$CONSTRAINT" \ | ||
-enforce="sourcegraph/repo-updater=$CONSTRAINT" \ | ||
-enforce="sourcegraph/searcher=$CONSTRAINT" \ | ||
-enforce="sourcegraph/symbols=$CONSTRAINT" \ | ||
-enforce="sourcegraph/minio=$CONSTRAINT" \ | ||
base/ | ||
go run ./update-tags "$CONSTRAINT" base/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
"os/exec" | ||
|
||
"github.com/sourcegraph/sourcegraph/enterprise/dev/ci/images" | ||
|
||
// pins update-docker-tags CLI | ||
_ "github.com/slimsag/update-docker-tags" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) == 2 { | ||
log.Fatal("constraint, directory arguments must be provided") | ||
} | ||
var ( | ||
constraint = os.Args[0] | ||
dir = os.Args[1] | ||
) | ||
args := []string{ | ||
"run", | ||
"github.com/slimsag/update-docker-tags", | ||
} | ||
for _, image := range images.SourcegraphDockerImages { | ||
enforce := fmt.Sprintf(`-enforce="sourcegraph/%s=%s"`, image, constraint) | ||
log.Println(enforce) | ||
args = append(args, enforce) | ||
} | ||
args = append(args, dir) | ||
cmd := exec.Command("go", args...) | ||
cmd.Stderr = os.Stderr | ||
cmd.Stdin = os.Stdin | ||
cmd.Stdout = os.Stdout | ||
if err := cmd.Run(); err != nil { | ||
log.Fatal((err)) | ||
} | ||
} |