Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

feat(ci): don't push to dockerhub outside of release builds #64471

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dev/ci/internal/ci/images_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ func bazelPushImagesCmd(c Config, isCandidate bool, opts ...bk.StepOpt) func(*bk
}
// Default registries.
devRegistry := images.SourcegraphDockerDevRegistry
prodRegistry := images.SourcegraphDockerPublishRegistry
additionalProdRegistry := images.SourcegraphArtifactRegistryPublicRegistry
prodRegistry := images.SourcegraphArtifactRegistryPublicRegistry
var additionalProdRegistry string

// If we're building an internal release, we push the final images to that specific registry instead.
// See also: release_operations.go
switch c.RunType {
case runtype.PromoteRelease:
additionalProdRegistry = images.SourcegraphDockerPublishRegistry
case runtype.InternalRelease:
prodRegistry = images.SourcegraphInternalReleaseRegistry
// we don't want to push to the public registry on internal releases, but we do want to publish the release to the cloud ephemeral registry
Expand Down
2 changes: 1 addition & 1 deletion dev/ci/internal/ci/release_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func releasePromoteImages(c Config) operations.Operation {
// releaseTestOperations runs the script defined in release.yaml that tests the release.
func releaseTestOperation(c Config) operations.Operation {
devRegistry := images.SourcegraphDockerDevRegistry
prodRegistry := images.SourcegraphDockerPublishRegistry
prodRegistry := images.SourcegraphArtifactRegistryPublicRegistry

if c.RunType.Is(runtype.InternalRelease) {
prodRegistry = images.SourcegraphInternalReleaseRegistry
Expand Down
2 changes: 1 addition & 1 deletion doc/dev/background-information/sg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ OFFLINE=true sg start
Ensure that the `sourcegraph/syntax-highlighter:insiders` image is already available locally. If not, pull it with the following command before going offline to ensure that offline mode works seamlessly:

```bash
docker pull -q sourcegraph/syntax-highlighter:insiders
docker pull -q us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders
```

## `sg` and pre-commit hooks
Expand Down
4 changes: 2 additions & 2 deletions sg.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,15 @@ commands:
cmd: |
docker run --name=syntax-highlighter --rm -p9238:9238 \
-e WORKERS=1 -e ROCKET_ADDRESS=0.0.0.0 \
sourcegraph/syntax-highlighter:insiders
us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders
install: |
# Remove containers by the old name, too.
docker inspect syntect_server >/dev/null 2>&1 && docker rm -f syntect_server || true
docker inspect syntax-highlighter >/dev/null 2>&1 && docker rm -f syntax-highlighter || true
# Pull syntax-highlighter latest insider image, only during install, but
# skip if OFFLINE=true is set.
if [[ "$OFFLINE" != "true" ]]; then
docker pull -q sourcegraph/syntax-highlighter:insiders
docker pull -q us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders
fi

zoekt-indexserver-template: &zoekt_indexserver_template
Expand Down
Loading