Skip to content
Open
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 @@ -158,8 +158,10 @@ else
OPERATOR_SDK=$(shell which operator-sdk)
endif

check: lint-all ## Check all files lint error
check: lint-all get-cluster-credentials ## Check all files lint error
./common/scripts/lint-csv.sh
echo "Checking GHE pull"
@common/scripts/ghe_config.sh

code-dev: ## Run the default dev commands which are the go tidy, fmt, vet then execute the $ make code-gen
@echo Running the common required commands for developments purposes
Expand Down
58 changes: 58 additions & 0 deletions common/scripts/ghe_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
#
# Copyright 2025 IBM Corporation
#
# 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.
#

KUBECTL=$(which kubectl)
GIT_USERNAME=$(${KUBECTL} -n default get secret helm-repo-cred -o jsonpath='{.data.username}' | base64 --decode)
GIT_TOKEN=$(${KUBECTL} -n default get secret helm-repo-cred -o jsonpath='{.data.password}' | base64 --decode)

URL_ENCODED_USERNAME=$(echo $GIT_USERNAME | jq -Rr @uri)

retries=5
sleep_timer=5

while true; do

if [ $retries -eq 0 ]; then
break
fi

rm -rf helm-charts-reduction

git clone "https://$URL_ENCODED_USERNAME:[email protected]/IBMPrivateCloud/helm-charts-reduction.git"

git config --global user.email "[email protected]"
git config --global user.name "ibm-common-service-operator"

cd helm-charts-reduction
git checkout staging

cp -r ../helm-cluster-scoped/* source-charts/ibm-common-service-operator-cluster-scoped
cp -r ../helm/* source-charts/ibm-common-service-operator

is_changes=$(git status --short)
if [ -z "${is_changes}" ]; then
echo "No changes to add/commit, skipping"
exit 0
fi
git add .
git commit -s -m "updated helm files for ibm-common-service-operator"
git push
if [ $? -eq 0 ]; then
break
fi
retries=$(( retries - 1 ))
done