Skip to content

Commit

Permalink
Add image publishing semaphore config
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Jan 21, 2025
1 parent 5da191e commit 97dff2c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .semaphore/push-images/goldmane.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: v1.0
name: Publish goldmane images
agent:
machine:
type: f1-standard-2
os_image: ubuntu2204

execution_time_limit:
minutes: 60

global_job_config:
env_vars:
- name: DEV_REGISTRIES
value: quay.io/calico docker.io/calico
secrets:
- name: docker
- name: quay-robot-calico+semaphoreci
prologue:
commands:
- checkout
# Semaphore is doing shallow clone on a commit without tags.
# unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always)
- retry git fetch --unshallow
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USER" --password-stdin
- echo $QUAY_TOKEN | docker login --username "$QUAY_USER" --password-stdin quay.io
- export BRANCH_NAME=$SEMAPHORE_GIT_BRANCH

blocks:
- name: Publish goldmane images
dependencies: []
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C goldmane cd CONFIRM=true; fi
- name: Publish goldmane multi-arch manifests
dependencies:
- Publish goldmane images
skip:
when: "branch !~ '.+'"
task:
jobs:
- name: Linux multi-arch manifests
commands:
- if [ -z "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C goldmane push-manifests-with-tag CONFIRM=true; fi
4 changes: 4 additions & 0 deletions .semaphore/semaphore.yml.d/03-promotions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ promotions:
pipeline_file: push-images/typha.yml
auto_promote:
when: "branch =~ 'master|release-'"
- name: Push Goldmane images
pipeline_file: push-images/goldmane.yml
auto_promote:
when: "branch =~ 'master|release-'"
- name: Publish openstack packages
pipeline_file: push-images/packaging.yaml
auto_promote:
Expand Down
10 changes: 8 additions & 2 deletions goldmane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ IMAGE_BUILD_MARKER = goldmane_container-$(ARCH).created
###############################################################################
include ../lib.Makefile

# Configure variables used by ci/cd common targets from lib.Makefile.
BUILD_IMAGES=goldmane

.PHONY: image build
image: $(IMAGE_BUILD_MARKER)
build: bin/goldmane-$(ARCH)
Expand All @@ -24,8 +27,8 @@ sub-image-%:
# Build goldmane image.
calico/goldmane: $(IMAGE_BUILD_MARKER)
$(IMAGE_BUILD_MARKER): bin/goldmane-$(ARCH)
$(DOCKER_BUILD) --build-arg TARGETARCH=$(ARCH) -t calico/goldmane:latest-$(ARCH) -f docker/Dockerfile .
$(MAKE) retag-build-images-with-registries BUILD_IMAGES=calico/goldmane VALIDARCHES=$(ARCH) IMAGETAG=latest
$(DOCKER_BUILD) --build-arg TARGETARCH=$(ARCH) -t goldmane:latest-$(ARCH) -f docker/Dockerfile .
$(MAKE) retag-build-images-with-registries BUILD_IMAGES=$(BUILD_IMAGES) VALIDARCHES=$(ARCH) IMAGETAG=latest
touch $@

bin/goldmane-$(ARCH): $(shell find . -name '*.go')
Expand Down Expand Up @@ -55,6 +58,9 @@ ut:
###############################################################################
# Release
###############################################################################
## Deploys images to registry
cd: image-all cd-common

release-build: .release-$(VERSION).created
.release-$(VERSION).created:
$(MAKE) clean image-all RELEASE=true
Expand Down
2 changes: 1 addition & 1 deletion goldmane/pkg/aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
"time"

"github.com/stretchr/testify/require"
googleproto "google.golang.org/protobuf/proto"

"github.com/projectcalico/calico/goldmane/pkg/aggregator"
"github.com/projectcalico/calico/goldmane/pkg/internal/types"
"github.com/projectcalico/calico/goldmane/pkg/internal/utils"
"github.com/projectcalico/calico/goldmane/proto"
"github.com/projectcalico/calico/libcalico-go/lib/logutils"
googleproto "google.golang.org/protobuf/proto"
)

var (
Expand Down

0 comments on commit 97dff2c

Please sign in to comment.