Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitpod Related Changes #334

Open
wants to merge 1 commit into
base: release-v5.0.3
Choose a base branch
from
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
Gitpod Related Changes
  • Loading branch information
Karun Agarwal committed Jul 21, 2023
commit c1e5dec600f2930159fdc5899fafe3db53ee7402
30 changes: 30 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
tasks:
- name: Setup
openMode: tab-after
init: |
sed -i "s#mode_of_installation: localhost#mode_of_installation: public#" config_files/config.yml
export trimmed_gitpod_url=${GITPOD_WORKSPACE_URL:8}
sed -i "s#api_endpoint: localhost#api_endpoint: 80-$trimmed_gitpod_url#" config_files/config.yml
sudo chmod u+x install.sh
sudo ./install.sh

ports:
- port: 4200
onOpen: ignore
visibility: public
description: Cqube Dashboard

- port: 8080
onOpen: ignore
visibility: public
description: Keycloak

- port: 80
onOpen: ignore
visibility: public
description: Nginx HTTP

- port: 443
onOpen: ignore
visibility: public
description: Nginx HTTPS
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# cQube_devops Installation

### Gitpod

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Samagra-Development/cqube-devops/tree/release-v5.0.3)

### Prerequisites to install cQube_devops:

- Ubuntu 22.04 (supported)
Expand Down
10 changes: 8 additions & 2 deletions ansible/roles/configurations/templates/keycloak.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ sudo docker exec -i keycloak_app sh << 'EOF'

/opt/jboss/keycloak/bin/kcadm.sh create realms -s realm=cQube -s enabled=true -o

/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000
{% if mode_of_installation == 'localhost' %}
/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000 -s 'redirectUris=["http://{{ api_endpoint }}/*"]' -s directAccessGrantsEnabled=true
{% else %}
/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000 -s 'redirectUris=["https://{{ api_endpoint }}/*"]' -s directAccessGrantsEnabled=true
{% endif %}

EOF
/opt/jboss/keycloak/bin/kcadm.sh create users -r cQube -s username={{ keycloak_adm_name }} -s enabled=true
/opt/jboss/keycloak/bin/kcadm.sh set-password --username {{ keycloak_adm_name }} -r cQube -p {{ keycloak_adm_password }}
EOF
14 changes: 14 additions & 0 deletions config_files/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
base_dir: /opt
system_user_name: gitpod
access_type: VSK
state_name: HP
local_ipv4_address: 10.0.0.1
mode_of_installation: localhost
storage_type: local
api_endpoint: localhost
google_analytics_tracking_id: NA
db_user: cqube_user
db_name: cqube
db_password: cQube@123
keycloak_adm_name: admin
keycloak_adm_password: Admin@123
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ fi

#Running script to display important links
chmod u+x shell_scripts/install_generate_access_links.sh
. "shell_scripts/install_generate_access_links.sh"
. "shell_scripts/install_generate_access_links.sh"
22 changes: 2 additions & 20 deletions shell_scripts/config_file_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -465,24 +465,6 @@ printf "read_only_db_password: cQube@123\n" >> config_files/config.yml
fi

}
check_version
rm config_files/config.yml
touch config_files/config.yml
if [[ -e "config_files/config.yml" ]]; then
check_base_dir
check_sys_user
check_access_type
check_state
check_ip
check_mode_of_installation
check_storage_type
check_api_endpoint
check_google_analytics
check_config_db
#check_config_read_only_db
check_keycloak_name
check_keycloak_password
fi

check_config_file(){
if [[ -e "config_files/config.yml" ]]; then
Expand All @@ -500,8 +482,8 @@ echo -e "\e[0;33m${bold}If you want to edit config value please enter yes.${norm
* ) echo "Please answer yes or no.";;
esac
done
if [[ $yn == yes ]]; then
if [[ -e "config_files/config.yml" ]]; then
if [[ $yn == yes ]]; then
rm config_files/config.yml
touch config_files/config.yml
check_base_dir
Expand All @@ -527,4 +509,4 @@ if [[ $yn == no ]]; then
fi
}

check_config_file
check_config_file