Skip to content
Closed
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
35 changes: 35 additions & 0 deletions buildpack/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,41 @@ def is_version_maintained(version):
return False


_SAP_HANA_CLIENT_DEPENDENCY = "sap.hana.client"


def _is_sap_hana_client_enabled():
return bool(os.environ.get("SAP_HANA_CLIENT_ENABLED", "").strip())


def stage_hana_client(buildpack_dir, build_dir, cache_dir):
if not _is_sap_hana_client_enabled():
return

try:
dest = os.path.join(build_dir, "model", "lib", "userlib")
util.mkdir_p(dest)
dep = util.get_dependency(_SAP_HANA_CLIENT_DEPENDENCY, buildpack_dir=buildpack_dir)
jar_name = "ngdbc-{}.jar".format(dep["version"])
util.resolve_dependency(
_SAP_HANA_CLIENT_DEPENDENCY,
dest,
buildpack_dir=buildpack_dir,
cache_dir=cache_dir,
unpack=False,
)
logging.info(
"SAP HANA client JAR [%s] staged to [%s]",
jar_name,
dest,
)
except Exception:
logging.warning(
"Failed to stage SAP HANA client JAR, continuing deployment...",
exc_info=True,
)


def stage(buildpack_dir, build_path, cache_path):
logging.debug("Creating directory structure for Mendix runtime...")
for name in ["runtimes", "log", "database", "data", "bin"]:
Expand Down
1 change: 1 addition & 0 deletions buildpack/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def cleanup_dependency_cache(cached_dir, dependency_list):
metering.stage(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
database.stage(BUILDPACK_DIR, BUILD_DIR)
runtime.stage(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
runtime.stage_hana_client(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
logs.stage(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
nginx.stage(BUILDPACK_DIR, BUILD_DIR, CACHE_DIR)
logging.info("Mendix Cloud Foundry Buildpack staging completed")
Expand Down
5 changes: 5 additions & 0 deletions dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ dependencies:
commit: 5fed98f8
fs: cflinuxfs4
version: 3.2.2
sap:
hana:
client:
artifact: "sap-hana-client/ngdbc-{{ version }}.jar"
version: "2.29.11"
telegraf:
agent:
artifact: telegraf/telegraf-{{ version }}_linux_amd64.tar.gz
Expand Down