Skip to content

Commit

Permalink
ci-search: replace bazel based deployment
Browse files Browse the repository at this point in the history
Replaces the bazel based deployment with kustomize.

Signed-off-by: Daniel Hiller <[email protected]>
  • Loading branch information
dhiller committed Dec 19, 2024
1 parent 7037fe3 commit 51262ee
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 7 deletions.
8 changes: 8 additions & 0 deletions github/ci/services/ci-search/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace: ci-search

resources:
- manifests/full.yaml
- manifests/ingress.yaml

patches:
- path: patches/statefulset.yaml
63 changes: 56 additions & 7 deletions github/ci/services/ci-search/hack/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,62 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This file is part of the KubeVirt project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# 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.
#
# Copyright the KubeVirt Authors.
#
#

set -eo pipefail
set -e
set -u
set -o pipefail

main(){
local environment=${1}
set -x

bazelisk run //github/ci/services/ci-search:${environment}.apply
WORK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BASE_DIR="$(cd "${WORK_DIR}/.." && pwd)"

bazelisk run //github/ci/services/common/k8s/cmd/wait -- -namespace ci-search -selector search -kind statefulset
function usage {
cat <<EOF
usage: $0 [-d] <environment>
EOF
}

main "${@}"
dry_run=false
while getopts "d" opt; do
case "${opt}" in
d )
dry_run="true"
shift
;;
\? )
usage
exit 1
;;
esac
done

environment="${1}"
[ -d "${BASE_DIR}/overlays/${environment}" ] || exit 1

cd "${BASE_DIR}"

if [ "$dry_run" = "true" ]; then
kubectl kustomize "./overlays/${environment}"
exit 0
fi

kubectl apply -k "./overlays/${environment}"

go run ../common/k8s/cmd/wait -- -namespace ci-search -selector search -kind statefulset
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resources:
- ../../base

secretGenerator:
- name: bugzilla-credentials
files:
- api=./secrets/bugzilla-credentials
type: Opaque
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
95988ba4a329c1b0a62e679f1bf5ade1fe6158f0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
- ../../base
- ./cluster-issuer.yaml

secretGenerator:
- name: bugzilla-credentials
files:
- api=./secrets/bugzilla-credentials
type: Opaque
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
95988ba4a329c1b0a62e679f1bf5ade1fe6158f0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
95988ba4a329c1b0a62e679f1bf5ade1fe6158f0

0 comments on commit 51262ee

Please sign in to comment.