Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Changes build to publish docker images to all OCIR regions #103

Merged
merged 1 commit into from
May 21, 2018
Merged
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ USE_GLOBAL_NAMESPACE ?= false
ifdef WERCKER
# Insert swear words about mysql group replication and hostname length. Arghh..
VERSION := ${WERCKER_GIT_COMMIT}
TENANT := "oracle"
else
NEW_NAMESPACE ?= e2e-${USER}
VERSION := ${USER}-$(shell date +%Y%m%d%H%M%S)
TENANT := "spinnaker"
endif

ROOT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
PKG := github.com/oracle/mysql-operator
REGISTRY := wcr.io/oracle
REGISTRY := iad.ocir.io/$(TENANT)
SRC_DIRS := cmd pkg test/examples
REGISTRY_STRING := $(subst /,_,$(REGISTRY))
CMD_DIRECTORIES := $(sort $(dir $(wildcard ./cmd/*/)))
Expand Down
2 changes: 1 addition & 1 deletion ci-docker-images/mysql-operator-ci-e2e/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGE ?= wcr.io/oracle/mysql-operator-ci-e2e
IMAGE ?= iad.ocir.io/oracle/mysql-operator-ci-e2e
VERSION ?= 1.1.1

.PHONY: build
Expand Down
4 changes: 2 additions & 2 deletions cmd/mysql-operator/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

const (
mysqlServer = "mysql/mysql-server"
mysqlAgent = "wcr.io/oracle/mysql-agent"
mysqlAgent = "iad.ocir.io/oracle/mysql-agent"
)

// Images is the configuration of required MySQLOperator images. Remember to configure the appropriate
Expand Down Expand Up @@ -123,7 +123,7 @@ func (s *MySQLOperatorServer) AddFlags(fs *pflag.FlagSet) *pflag.FlagSet {
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).")
fs.StringVar(&s.Namespace, "namespace", metav1.NamespaceAll, "The namespace for which the MySQL operator manages MySQL clusters. Defaults to all.")
fs.StringVar(&s.Images.MySQLServerImage, "mysql-server-image", s.Images.MySQLServerImage, "The name of the target 'mysql-server' image. Defaults to: mysql/mysql-server.")
fs.StringVar(&s.Images.MySQLAgentImage, "mysql-agent-image", s.Images.MySQLAgentImage, "The name of the target 'mysql-agent' image. Defaults to: wcr.io/oracle/mysql-agent.")
fs.StringVar(&s.Images.MySQLAgentImage, "mysql-agent-image", s.Images.MySQLAgentImage, "The name of the target 'mysql-agent' image. Defaults to: iad.ocir.io/oracle/mysql-agent.")
fs.DurationVar(&s.MinResyncPeriod.Duration, "min-resync-period", s.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.")
return fs
}
4 changes: 2 additions & 2 deletions docs/user/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ data:
mysql-operator-config.yaml: |
images:
mysqlServer: mysql/mysql-server
mysqlAgent: wcr.io/oracle/mysql-agent
mysqlAgent: iad.ocir.io/oracle/mysql-agent
---
apiVersion: apps/v1beta1
kind: Deployment
Expand Down Expand Up @@ -73,7 +73,7 @@ spec:
containers:
- name: mysql-operator-controller
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: wcr.io/oracle/mysql-operator:{{ .Values.image.tag }}
image: iad.ocir.io/oracle/mysql-operator:{{ .Values.image.tag }}
ports:
- containerPort: 10254
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion mysql-operator/templates/03-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
containers:
- name: mysql-operator-controller
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: wcr.io/oracle/mysql-operator:{{ .Values.image.tag }}
image: iad.ocir.io/oracle/mysql-operator:{{ .Values.image.tag }}
ports:
- containerPort: 10254
args:
Expand Down
70 changes: 63 additions & 7 deletions wercker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
box: golang:1.9
no-response-timeout: 10
no-response-timeout: 60
command-timeout: 60

test:
base-path: "/go/src/github.com/oracle/mysql-operator"
Expand Down Expand Up @@ -52,10 +53,36 @@ push-operator-image:
chmod +x /mysql-operator

- internal/docker-push:
registry: https://wcr.io/v2
repository: wcr.io/oracle/mysql-operator
registry: https://iad.ocir.io/v2
repository: iad.ocir.io/oracle/mysql-operator
tag: $VERSION
entrypoint: /mysql-operator
username: $OCIRUSERNAME
password: $OCIRPASSWORD

- internal/docker-push:
registry: https://lhr.ocir.io/v2
repository: lhr.ocir.io/oracle/mysql-operator
tag: $VERSION
entrypoint: /mysql-operator
username: $OCIRUSERNAME
password: $OCIRPASSWORD

- internal/docker-push:
registry: https://phx.ocir.io/v2
repository: phx.ocir.io/oracle/mysql-operator
tag: $VERSION
entrypoint: /mysql-operator
username: $OCIRUSERNAME
password: $OCIRPASSWORD

- internal/docker-push:
registry: https://fra.ocir.io/v2
repository: fra.ocir.io/oracle/mysql-operator
tag: $VERSION
entrypoint: /mysql-operator
username: $OCIRUSERNAME
password: $OCIRPASSWORD

push-agent-image:
box:
Expand All @@ -74,17 +101,46 @@ push-agent-image:
chmod +x /mysql-agent

- internal/docker-push:
registry: https://wcr.io/v2
repository: wcr.io/oracle/mysql-agent
registry: https://iad.ocir.io/v2
username: $OCIRUSERNAME
password: $OCIRPASSWORD
repository: iad.ocir.io/oracle/mysql-agent
tag: $VERSION
entrypoint: /mysql-agent
user: mysql

- internal/docker-push:
registry: https://lhr.ocir.io/v2
username: $OCIRUSERNAME
password: $OCIRPASSWORD
repository: lhr.ocir.io/oracle/mysql-agent
tag: $VERSION
entrypoint: /mysql-agent
user: mysql

- internal/docker-push:
registry: https://phx.ocir.io/v2
username: $OCIRUSERNAME
password: $OCIRPASSWORD
repository: phx.ocir.io/oracle/mysql-agent
tag: $VERSION
entrypoint: /mysql-agent
user: mysql

- internal/docker-push:
registry: https://fra.ocir.io/v2
username: $OCIRUSERNAME
password: $OCIRPASSWORD
repository: fra.ocir.io/oracle/mysql-agent
tag: $VERSION
entrypoint: /mysql-agent
user: mysql

e2e-test:
base-path: "/go/src/github.com/oracle/mysql-operator"
box:
registry: https://wcr.io/v2
id: wcr.io/oracle/mysql-operator-ci-e2e:1.1.1
registry: https://iad.ocir.io/v2
id: iad.ocir.io/oracle/mysql-operator-ci-e2e:1.1.1
steps:
- script:
name: e2e default tests
Expand Down