Skip to content

Commit

Permalink
Testing changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yashvi Jain <[email protected]>
  • Loading branch information
Yashvi Jain committed Dec 3, 2024
1 parent 68943de commit d45f0fa
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
1 change: 1 addition & 0 deletions .studio/common
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ function build_all_changed_components() {
hab pkg install core/coreutils >/dev/null
mkdir -p /usr/bin
ln -sv "$(hab pkg path core/coreutils)/bin/env" /usr/bin/env 2>/dev/null
cp "$(hab pkg path core/coreutils)/bin/env" /usr/bin/env

pushd /src >/dev/null
for component in $(./scripts/changed_components.rb)
Expand Down
3 changes: 3 additions & 0 deletions .studiorc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ DOC
start_all_services() {
start_deployment_service
chef-automate dev deployinate

cp "$(hab pkg path core/coreutils)/bin/env" /usr/bin/env

if [[ -f "/src/dev/license.jwt" ]]; then
chef-automate license apply "/src/dev/license.jwt"
fi
Expand Down
27 changes: 14 additions & 13 deletions components/automate-opensearch/habitat/hooks/post-run
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

exec 2>&1

sleep 120
# Executing opensearch securityadmin
echo "Executing opensearch securityadmin"
hab pkg exec core/bash {{pkg.path}}/os/plugins/opensearch-security/tools/securityadmin.sh -cd {{pkg.svc_config_path}}/securityconfig -icl -key {{pkg.svc_config_path}}/admin-key.pem -cert {{pkg.svc_config_path}}/admin.pem -cacert {{pkg.svc_config_path}}/root-ca.pem -nhnv -h "localhost" -p {{cfg.transport.port}}
hab pkg exec core/bash {{pkg.path}}/os/plugins/opensearch-security/tools/securityadmin.sh -cd {{pkg.svc_config_path}}/securityconfig -icl -key {{pkg.svc_config_path}}/admin-key.pem -cert {{pkg.svc_config_path}}/admin.pem -cacert {{pkg.svc_config_path}}/root-ca.pem -nhnv -h "localhost" -p {{cfg.network.port}}
echo "Done !!!! Executing opensearch securityadmin"

source {{pkg.svc_config_path}}/health_check
Expand Down Expand Up @@ -55,18 +56,18 @@ if [[ $(wait_until_healthy 5) -ne 0 ]]; then
exit 1 # always exit 0 in post-run or it'll retry the hook
fi

echo "Configuring index settings"
curl \
-s \
-i \
-H 'Content-Type: application/json'\
-X PUT "https://${HOST}:{{cfg.network.port}}/_all/_settings?preserve_existing=true" \
-k \
-u admin:admin \
-d '{
"index.number_of_replicas": "{{cfg.index.number_of_replicas}}",
"index.refresh_interval": "{{cfg.index.refresh_interval}}"
}'
# echo "Configuring index settings"
# curl \
# -s \
# -i \
# -H 'Content-Type: application/json'\
# -X PUT "https://${HOST}:{{cfg.network.port}}/_all/_settings?preserve_existing=true" \
# -k \
# -u admin:admin \
# -d '{
# "index.number_of_replicas": "{{cfg.index.number_of_replicas}}",
# "index.refresh_interval": "{{cfg.index.refresh_interval}}"
# }'

# The health-check hook will return an error unless we touch sentinel file to
# signal to the health check that this hook has completed successfully.
Expand Down
21 changes: 18 additions & 3 deletions components/automate-opensearch/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
pkg_name="automate-opensearch"
pkg_description="Wrapper package for core/elasticsearch"
pkg_origin="chef"
pkg_version="1.3.19"
pkg_version="2.18.0"
pkg_maintainer="Chef Software Inc. <[email protected]>"
pkg_license=("Chef-MLSA")
pkg_upstream_url="https://www.chef.io/automate"
pkg_source="https://artifacts.opensearch.org/releases/bundle/opensearch/1.3.19/opensearch-1.3.19-linux-x64.tar.gz"
pkg_shasum=af901097211df4c3d2ef75f0c3699452d82a87adac60c240520a3ca03f969595
pkg_source="https://artifacts.opensearch.org/releases/bundle/opensearch/2.18.0/opensearch-2.18.0-linux-x64.tar.gz"
pkg_shasum=ae3cb4107b2e0cdbb9b98bb4e5f2f019b736b68e995442c718e459d39ff01df1
# pkg_source="https://artifacts.opensearch.org/releases/bundle/opensearch/2.11.1/opensearch-2.11.1-linux-x64.tar.gz"
# pkg_shasum=926eb3f99f592e7518d5dc1e250ae11d1bb45ef766a90222a8df11bb2ee35a9c


pkg_build_deps=(
Expand Down Expand Up @@ -52,7 +54,20 @@ do_build() {
return 0
}

do_after() {
if [ ! -f /usr/bin/env ]; then
echo "inside the /usr/ib/env"
cp $(pkg_path_for core/coreutils)/bin/env /usr/bin/env
fi

}

do_install() {
if [ ! -f /usr/bin/env ]; then
echo "inside the /isr/ib/env"
cp $(pkg_path_for core/coreutils)/bin/env /usr/bin/env
fi

cd "$HAB_CACHE_SRC_PATH/opensearch-${pkg_version}"
chown -RL hab:hab ${pkg_prefix}
mkdir -p "${pkg_prefix}/os"
Expand Down

0 comments on commit d45f0fa

Please sign in to comment.