diff --git a/.studio/common b/.studio/common index 6c2d231e2ef..7160a2101ee 100644 --- a/.studio/common +++ b/.studio/common @@ -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) diff --git a/.studiorc b/.studiorc index 9931437ac32..a99d0d6784c 100644 --- a/.studiorc +++ b/.studiorc @@ -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 diff --git a/components/automate-opensearch/habitat/hooks/post-run b/components/automate-opensearch/habitat/hooks/post-run index 8509f37dc06..5144e95507e 100644 --- a/components/automate-opensearch/habitat/hooks/post-run +++ b/components/automate-opensearch/habitat/hooks/post-run @@ -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 @@ -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. diff --git a/components/automate-opensearch/habitat/plan.sh b/components/automate-opensearch/habitat/plan.sh index 79284a7debe..6c27cfdd0b2 100644 --- a/components/automate-opensearch/habitat/plan.sh +++ b/components/automate-opensearch/habitat/plan.sh @@ -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. " 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=( @@ -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"