Skip to content

Commit

Permalink
makefile: use nightly version on master branch
Browse files Browse the repository at this point in the history
It makes development and testing on cloud providers easier.
And 0.3.0 isn't compatible with master.
  • Loading branch information
zimnx committed Nov 24, 2020
1 parent 9d5818f commit 071a472
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -2,9 +2,8 @@ all: test local-build

# Image URL to use all building/pushing image targets
REPO ?= scylladb/scylla-operator
TAG ?= $(shell git describe --tags --always --abbrev=0)
TAG ?= $(shell ./version.sh)
IMG ?= $(REPO):$(TAG)
NIGHTLY_IMG ?= $(REPO):nightly
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"

Expand Down Expand Up @@ -47,11 +46,12 @@ cert-manager:

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests cert-manager
cd config/operator/operator && kustomize edit set image controller=${IMG}
kustomize build config/operator/default | kubectl apply -f -
kubectl apply -f examples/common/operator.yaml

# Generate manifests e.g. CRD, RBAC etc.
manifests:
cd config/operator/operator && kustomize edit set image controller=${IMG}

controller-gen $(CRD_OPTIONS) paths="$(PKG)" output:crd:dir=config/operator/crd/bases \
rbac:roleName=manager-role output:rbac:artifacts:config=config/operator/rbac \
webhook output:webhook:artifacts:config=config/operator/webhook
Expand Down Expand Up @@ -96,4 +96,4 @@ release:

nightly:
goreleaser --snapshot --rm-dist --config=.goreleaser-nightly.yml
docker push ${NIGHTLY_IMG}
docker push ${IMG}
2 changes: 1 addition & 1 deletion config/operator/operator/kustomization.yaml
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: scylladb/scylla-operator
newTag: v0.3.0
newTag: nightly
2 changes: 1 addition & 1 deletion examples/common/operator.yaml
Expand Up @@ -1832,7 +1832,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: scylladb/scylla-operator:v0.3.0
image: scylladb/scylla-operator:nightly
imagePullPolicy: IfNotPresent
name: manager
ports:
Expand Down
27 changes: 27 additions & 0 deletions version.sh
@@ -0,0 +1,27 @@
#!/bin/bash
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -euo pipefail

BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" != "master" ]]; then
echo $(git describe --tags --always --abbrev=0)
exit 0
fi

echo 'nightly'

0 comments on commit 071a472

Please sign in to comment.