Skip to content

Commit

Permalink
update hypershift cli repos (#205)
Browse files Browse the repository at this point in the history
* support custom cli repos

* copy binary
  • Loading branch information
mukrishn authored Jun 14, 2022
1 parent 5a4a3ca commit 36a1371
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster_install_method": "osd",
"ocm_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"rosa_environment": "staging",
"openshift_worker_count": 9,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster_install_method": "osd",
"ocm_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"rosa_environment": "staging",
"openshift_worker_count": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"aws_secret_access_key": "",
"rosa_environment": "staging",
"rosa_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"openshift_worker_count": 9,
"openshift_network_type": "OpenShiftSDN",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"aws_secret_access_key": "",
"rosa_environment": "staging",
"rosa_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"openshift_worker_count": 12,
"openshift_network_type": "OVNKubernetes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"aws_secret_access_key": "",
"rosa_environment": "staging",
"rosa_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"openshift_worker_count": 9,
"openshift_network_type": "OpenShiftSDN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cluster_install_method": "osd",
"ocm_cli_version": "master",
"hypershift_cli_version": "main",
"ocm_environment": "stage",
"rosa_environment": "staging",
"openshift_worker_count": 9,
Expand Down
22 changes: 18 additions & 4 deletions dags/openshift_nightlies/scripts/install/hypershift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ setup(){
export KUBECONFIG=/home/airflow/auth/config
if [[ $INSTALL_METHOD == "osd" ]]; then
export OCM_CLI_VERSION=$(cat ${json_file} | jq -r .ocm_cli_version)
if [[ ${OCM_CLI_VERSION} == "master" ]]; then
git clone https://github.com/openshift-online/ocm-cli
if [[ ${OCM_CLI_VERSION} != "null" ]]; then
OCM_CLI_FORK=$(cat ${json_file} | jq -r .ocm_cli_fork)
git clone -q --depth=1 --single-branch --branch ${OCM_CLI_VERSION} ${OCM_CLI_FORK}
pushd ocm-cli
sudo PATH=$PATH:/usr/bin:/usr/local/go/bin make
sudo mv ocm /usr/local/bin/
Expand All @@ -64,8 +65,9 @@ setup(){
ocm whoami
else
export ROSA_CLI_VERSION=$(cat ${json_file} | jq -r .rosa_cli_version)
if [[ ${ROSA_CLI_VERSION} == "master" ]]; then
git clone --depth=1 --single-branch --branch master https://github.com/openshift/rosa
if [[ ${ROSA_CLI_VERSION} != "null" ]]; then
ROSA_CLI_FORK=$(cat ${json_file} | jq -r .rosa_cli_fork)
git clone -q --depth=1 --single-branch --branch ${ROSA_CLI_VERSION} ${ROSA_CLI_FORK}
pushd rosa
make
sudo mv rosa /usr/local/bin/
Expand All @@ -78,6 +80,18 @@ setup(){
rosa verify quota
rosa verify permissions
fi
export HYPERSHIFT_CLI_VERSION=$(cat ${json_file} | jq -r .hypershift_cli_version)
if [[ ${HYPERSHIFT_CLI_VERSION} != "null" ]]; then
HYPERSHIFT_CLI_FORK=$(cat ${json_file} | jq -r .hypershift_cli_fork)
echo "Remove current Hypershift CLI directory.."
rm -rf hypershift
rm /usr/local/bin/hypershift || true
git clone -q --depth=1 --single-branch --branch ${HYPERSHIFT_CLI_VERSION} ${HYPERSHIFT_CLI_FORK}
pushd hypershift
make build
cp bin/hypershift /usr/local/bin
popd
fi
export BASEDOMAIN=$(_get_base_domain $(_get_cluster_id ${MGMT_CLUSTER_NAME}))
echo [default] >> aws_credentials
echo aws_access_key_id=$AWS_ACCESS_KEY_ID >> aws_credentials
Expand Down
10 changes: 6 additions & 4 deletions dags/openshift_nightlies/scripts/install/rosa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ setup(){
export UUID=$(uuidgen)
if [[ $INSTALL_METHOD == "osd" ]]; then
export OCM_CLI_VERSION=$(cat ${json_file} | jq -r .ocm_cli_version)
if [[ ${OCM_CLI_VERSION} == "master" ]]; then
git clone https://github.com/openshift-online/ocm-cli
if [[ ${OCM_CLI_VERSION} != "null" ]]; then
OCM_CLI_FORK=$(cat ${json_file} | jq -r .ocm_cli_fork)
git clone -q --depth=1 --single-branch --branch ${OCM_CLI_VERSION} ${OCM_CLI_FORK}
pushd ocm-cli
sudo PATH=$PATH:/usr/bin:/usr/local/go/bin make
sudo mv ocm /usr/local/bin/
Expand All @@ -197,8 +198,9 @@ setup(){
aws iam get-user | jq -r .User.UserName
else
export ROSA_CLI_VERSION=$(cat ${json_file} | jq -r .rosa_cli_version)
if [[ ${ROSA_CLI_VERSION} == "master" ]]; then
git clone --depth=1 --single-branch --branch master https://github.com/openshift/rosa
if [[ ${ROSA_CLI_VERSION} != "null" ]]; then
ROSA_CLI_FORK=$(cat ${json_file} | jq -r .rosa_cli_fork)
git clone -q --depth=1 --single-branch --branch ${ROSA_CLI_VERSION} ${ROSA_CLI_FORK}
pushd rosa
make
sudo mv rosa /usr/local/bin/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@
"hosted_cluster_instance_type": "m5.2xlarge",
"hosted_cluster_network_type": "OpenShiftSDN",
"hosted_control_plane_availability": "SingleReplica",
"hosted_cluster_release_image": ""
"hosted_cluster_release_image": "",
"rosa_cli_fork": "https://github.com/openshift/rosa",
"ocm_cli_fork": "https://github.com/openshift-online/ocm-cli",
"hypershift_cli_fork": "https://github.com/openshift/hypershift"
}
4 changes: 3 additions & 1 deletion dags/openshift_nightlies/tasks/install/rosa/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
"sleep_time": 30,
"daemon_mode": true,
"fips": false,
"rosa_expiration_time": "2880"
"rosa_expiration_time": "2880",
"rosa_cli_fork": "https://github.com/openshift/rosa",
"ocm_cli_fork": "https://github.com/openshift-online/ocm-cli"
}

0 comments on commit 36a1371

Please sign in to comment.