-
Notifications
You must be signed in to change notification settings - Fork 315
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
Initial Artifactory Pro plan #856
Merged
thesentinels
merged 1 commit into
habitat-sh:master
from
schisamo:schisamo/artifactory-pro
Jun 15, 2016
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}}/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pkg_origin=core | ||
pkg_name=artifactory-pro | ||
pkg_version=4.8.1 | ||
pkg_maintainer="The Habitat Maintainers <[email protected]>" | ||
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/ | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I saw @adamhjk switched the
redis
plan from using arun
hook to a line inplan.sh
:pkg_svc_run="bin/redis-server $pkg_svc_config_path/redis.config"
Maybe that's cleaner than using a run hook? Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevindickerson I think we need the hook as those exported environment variables are required in order for
artifactory.sh
to operate correctly.JAVA_HOME
needs to be dynamically resolved at hook execution time also.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So like
wouldn't work? (I think
pkg_path_for
should pull it at execute time??)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things begin to get pretty unreadable at some point. I would love to hear a comparison on using
pkg_svc_run
vs arun
hook. @fnichol ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not sure which is better than the other. Certainly having a separate run hook is less long. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, also worth noting that pkg_svc_run should not fork! Also ends with
2>&1
by defaultThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say you should make a run hook if the thing gets longer that what should fit on one line, as a loose, subjective, guideline.
pkg_svc_run
is nice for plans that don't have any other hooks because you only need to have the plan.sh file, but if you already have a hooks directory, and your run hook is more than one line, put it in a separate hook.