diff --git a/plans/artifactory-pro/config/storage.properties b/plans/artifactory-pro/config/storage.properties new file mode 100644 index 0000000000..b782551a30 --- /dev/null +++ b/plans/artifactory-pro/config/storage.properties @@ -0,0 +1,14 @@ +type={{cfg.database.type}} +url={{cfg.database.url}} +driver={{cfg.database.driver}} + +## Determines where the actual artifacts binaries are stored. Available options: +## filesystem - binaries are stored in the filesystem (recommended, default) +## fullDb - binaries are stored as blobs in the db, filesystem is used for caching +## cachedFS - binaries are stored in the filesystem, but a front cache (with faster access) is added +## IMPORTANT NOTE: This property should not be change after the initial setup. To change binaries storage you have to export and import +binary.provider.type={{cfg.storage.binary_provider_type}} + +## Determines the maximum filesystem cache size in bytes when using binary provider type fullDb or cachedFS. Default is 5GB +## Supported units are TB (terabytes), GB (gigabytes), MB (megabytes) and KB (kilobytes) +binary.provider.cache.maxSize={{cfg.storage.binary_provider_cache_size}} diff --git a/plans/artifactory-pro/default.toml b/plans/artifactory-pro/default.toml new file mode 100644 index 0000000000..dbcea54cd4 --- /dev/null +++ b/plans/artifactory-pro/default.toml @@ -0,0 +1,21 @@ +# _ _ __ _ _____ +# /\ | | (_)/ _| | | | __ \ +# / \ _ __| |_ _| |_ __ _ ___| |_ ___ _ __ _ _ | |__) | __ ___ +# / /\ \ | '__| __| | _/ _` |/ __| __/ _ \| '__| | | | | ___/ '__/ _ \ +# / ____ \| | | |_| | || (_| | (__| || (_) | | | |_| | | | | | | (_) | +# /_/ \_\_| \__|_|_| \__,_|\___|\__\___/|_| \__, | |_| |_| \___/ +# __/ | +# |___/ + +license = "" + +[database] + +type = "derby" +url = "jdbc:derby:{db.home};create=true" +driver = "org.apache.derby.jdbc.EmbeddedDriver" + +[storage] + +binary_provider_type = "filesystem" +binary_provider_cache_size = "5GB" diff --git a/plans/artifactory-pro/hooks/init b/plans/artifactory-pro/hooks/init new file mode 100644 index 0000000000..08f20b8b5f --- /dev/null +++ b/plans/artifactory-pro/hooks/init @@ -0,0 +1,27 @@ +#!/bin/sh + +echo "Preparing ARTIFACTORY_HOME..." + +# Move directories that ship in the package into place +for dir in bin etc tomcat webapps +do + cp -R {{pkg.path}}/$dir {{pkg.svc_var_path}}/ +done + +# Create required ephemeral directories +for dir in backup data logs +do + mkdir -p {{pkg.svc_var_path}}/$dir +done + +# Set license data +echo {{cfg.license}} > {{pkg.svc_var_path}}/etc/artifactory.lic + +# Symlink config files into $ARTIFACTORY_HOME/etc +for config in storage.properties +do + echo "Linking $config" + ln -sf {{pkg.svc_config_path}}/$config {{pkg.svc_var_path}}/etc/$config +done + +chown -R hab:hab {{pkg.svc_path}}/* diff --git a/plans/artifactory-pro/hooks/run b/plans/artifactory-pro/hooks/run new file mode 100644 index 0000000000..128fb3122a --- /dev/null +++ b/plans/artifactory-pro/hooks/run @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "Starting Artifactory Pro" + +export JAVA_HOME=$(hab pkg path core/server-jre) +export ARTIFACTORY_HOME={{pkg.svc_var_path}} + +{{pkg.svc_var_path}}/bin/artifactory.sh 2>&1 diff --git a/plans/artifactory-pro/plan.sh b/plans/artifactory-pro/plan.sh new file mode 100644 index 0000000000..cc259746fa --- /dev/null +++ b/plans/artifactory-pro/plan.sh @@ -0,0 +1,21 @@ +pkg_origin=core +pkg_name=artifactory-pro +pkg_version=4.8.1 +pkg_maintainer="The Habitat Maintainers " +pkg_license=("JFrog Artifactory EULA") +pkg_source=https://dl.bintray.com/jfrog/${pkg_name}/org/artifactory/pro/jfrog-${pkg_name}/${pkg_version}/jfrog-${pkg_name}-${pkg_version}.zip +pkg_shasum=481f755a51faa33492829becb5f00ed3e07a392a0669a02d4d874db13dbcbc3f +pkg_deps=(core/bash core/server-jre) +pkg_build_deps=(core/unzip) +pkg_expose=(8081) + +do_build() { + fix_interpreter "bin/artifactory.sh" core/bash bin/bash + return 0 +} + +do_install() { + build_line "Copying files from $PWD" + mkdir -p $pkg_prefix + cp -R * $pkg_prefix/ +}