Skip to content

Commit

Permalink
updated csdp-installer (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
roi-codefresh authored Jun 1, 2022
1 parent c8cb9ff commit c56fd7b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
4 changes: 2 additions & 2 deletions installer/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: csdp-installer
description: A Helm chart used for installing a CSDP runtime
type: application
version: 0.1.24
appVersion: v0.0.11
version: 0.1.25
appVersion: v0.0.12
55 changes: 37 additions & 18 deletions installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,20 @@ create_default_git_source() {
echo ""
}

ping_app_proxy() {
echo " --> Checking connection to app-proxy"
echo "Pinging ${CSDP_RUNTIME_INGRESS_URL}/app-proxy/api/health"
APP_PROXY_PING_RESPONSE=`curl "${CSDP_RUNTIME_INGRESS_URL}/app-proxy/api/readyz" -Ssfl --insecure`

if [[ "$APP_PROXY_PING_RESPONSE" -ne "OK" ]] ; then
echo "Failed to ping app-proxy address"
echo ${GIT_SOURCE_CREATE_RESPONSE}
exit 1
fi

echo " --> App-proxy is ready!"
}

#
# Start here:
#
Expand Down Expand Up @@ -348,7 +362,6 @@ else
create_codefresh_secret
fi
echo ""
echo ""

# 2. Check repo creds secret
echo "Checking secret $REPO_CREDS_SECRET_NAME..."
Expand All @@ -365,13 +378,8 @@ else
fi
fi
echo ""
echo ""

create_argocd_token_secret
echo ""
echo ""

# 4. Check bootstrap application
# 3. Create the bootstrap application
echo "Checking application $BOOTSTRAP_APP_NAME..."
if kubectl -n "$NAMESPACE" get application "$BOOTSTRAP_APP_NAME"; then
echo " --> Application $BOOTSTRAP_APP_NAME exists"
Expand All @@ -382,19 +390,30 @@ else
fi
echo ""

# 5. Check git integration
echo "Checking default git integration..."
echo "Checking application $BOOTSTRAP_APP_NAME..."
if kubectl -n "$NAMESPACE" get secret -l io.codefresh.integration-type=git -l io.codefresh.integration-name=default 2>&1 | grep "No resources found"; then
echo " --> Default git integration doesn't exists."
echo ""
create_git_integration
else
echo " --> Default git integration exists"
fi
# 4. Create argo-cd jwt token for events-reporter event-source
create_argocd_token_secret
echo ""

# 6. Register to git integration
# 4.5. Ping app-proxy to check if it is reachable
ping_app_proxy
echo ""

# Complete installation for non managed runtimes
# a. create default git integration
# b. register user to default git integration
if [[ "$CSDP_MANAGED_RUNTIME" -ne "true" ]] ; then
# 5. Check git integration
echo "Checking default git integration..."
echo "Checking application $BOOTSTRAP_APP_NAME..."
if kubectl -n "$NAMESPACE" get secret -l io.codefresh.integration-type=git -l io.codefresh.integration-name=default 2>&1 | grep "No resources found"; then
echo " --> Default git integration doesn't exists."
echo ""
create_git_integration
else
echo " --> Default git integration exists"
fi

# 6. Register to git integration
register_to_git_integration

if [[ "$CSDP_CREATE_DEFAULT_GIT_SOURCE" == "true" ]]; then
Expand Down

0 comments on commit c56fd7b

Please sign in to comment.