diff --git a/.gitignore b/.gitignore index 9b89fc9d..82d2e388 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,5 @@ +_site +.idea +.eclipse .project .classpath -.settings -target -bin -.metadata -.idea -*.iml -**/integrationTest.properties -/target/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bb6447a0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: java - -jdk: - - openjdk7 - -script: mvn package diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..f38cff2e --- /dev/null +++ b/Gemfile @@ -0,0 +1,25 @@ +source 'https://rubygems.org' + +# older ruby versions have problems! Lets be specific. use 'rvm use 1.9.3@sites --create' to use specific ruby version +ruby '1.9.3' +gem 'awestruct', '0.5.4.rc3' # Framework for creating static HTML sites +gem 'uglifier', '~> 2.0.1' # Ruby wrapper for UglifyJS JavaScript compressor +gem 'cssminify', '~> 1.0.2' # CSS compression using YUI compressor +gem 'rb-fsevent', '~> 0.9.3' # FSEvents API with Signals catching (without RubyCocoa) +gem 'kramdown', '~> 1.0.1' # Kramdown works on all platforms, rdiscount only on mri +gem 'htmlcompressor', '~> 0.0.3' # Adds in HTML minification, helps remove the warning on awestruct startup +gem 'RedCloth' +gem 'listen', '~> 1.0' +gem 'asciidoctor', '0.1.4' +gem 'slim' +gem 'less' +#gem 'therubyracer' +gem 'tilt', '~> 1.4.0' +gem 'coderay' +gem 'html_press', '~> 0.8.1' +gem 'git' # required to run the '-deploy' option + +# To enable guard and livereload (is C native thus not available on windows. Commented out for now) +#gem 'guard' +#gem 'guard-livereload' +#gem 'yajl-ruby' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..a76a07e2 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,109 @@ +GEM + remote: https://rubygems.org/ + specs: + POpen4 (0.1.4) + Platform (>= 0.4.0) + open4 + Platform (0.4.0) + RedCloth (4.2.9) + asciidoctor (0.1.4) + awestruct (0.5.4.rc3) + bootstrap-sass (>= 2.3.1.0) + compass (>= 0.12.1) + compass-960-plugin (~> 0.10.4) + haml (~> 4.0.1) + listen (~> 1.0) + mime-types (= 1.25) + nokogiri (= 1.5.10) + rack (~> 1.5.2) + rest-client (>= 1.6.7) + ruby-s3cmd (~> 0.1.5) + tilt (>= 1.3.5, < 2.0) + zurb-foundation (>= 4.0.9, < 5.0) + bootstrap-sass (3.1.1.0) + sass (~> 3.2) + chunky_png (1.3.0) + coderay (1.1.0) + commonjs (0.2.7) + compass (0.12.3) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (= 3.2.14) + compass-960-plugin (0.10.4) + compass (>= 0.10.0) + css_press (0.3.2) + csspool-st (= 3.1.2) + json + cssminify (1.0.2) + csspool-st (3.1.2) + execjs (2.0.2) + ffi (1.9.3) + fssm (0.2.10) + git (1.2.6) + haml (4.0.5) + tilt + html_press (0.8.2) + htmlentities + multi_css (>= 0.1.0) + multi_js (>= 0.1.0) + htmlcompressor (0.0.7) + yui-compressor (~> 0.9.6) + htmlentities (4.3.1) + json (1.8.1) + kramdown (1.0.2) + less (2.5.0) + commonjs (~> 0.2.7) + listen (1.3.1) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + rb-kqueue (>= 0.2) + mime-types (1.25) + multi_css (0.1.0) + css_press + multi_js (0.1.0) + uglifier (~> 2) + multi_json (1.9.2) + nokogiri (1.5.10) + open4 (1.3.3) + rack (1.5.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.3) + ffi (>= 0.5.0) + rb-kqueue (0.2.2) + ffi (>= 0.5.0) + rest-client (1.6.7) + mime-types (>= 1.16) + ruby-s3cmd (0.1.5) + sass (3.2.14) + slim (2.0.2) + temple (~> 0.6.6) + tilt (>= 1.3.3, < 2.1) + temple (0.6.7) + tilt (1.4.1) + uglifier (2.0.1) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + yui-compressor (0.9.6) + POpen4 (>= 0.1.4) + zurb-foundation (4.3.2) + sass (>= 3.2.0) + +PLATFORMS + ruby + +DEPENDENCIES + RedCloth + asciidoctor (= 0.1.4) + awestruct (= 0.5.4.rc3) + coderay + cssminify (~> 1.0.2) + git + html_press (~> 0.8.1) + htmlcompressor (~> 0.0.3) + kramdown (~> 1.0.1) + less + listen (~> 1.0) + rb-fsevent (~> 0.9.3) + slim + tilt (~> 1.4.0) + uglifier (~> 2.0.1) diff --git a/README.html b/README.html new file mode 100644 index 00000000..4d459588 --- /dev/null +++ b/README.html @@ -0,0 +1,7 @@ +
Visit this site at http://openshift.github.io/openshift-java-client
+ +To run this site locally, checkout this gh-pages-awestruct branch, run "bundle install", and then run "awestruct -d"
+ +To deploy this site, checkout the gh-pages-awestruct branch, run "awestruct", then then run "awestruct -P production –deploy".
diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 706b3a93..3f998a3c --- a/README.md +++ b/README.md @@ -1,41 +1,8 @@ -OpenShift Java Client [](https://travis-ci.org/openshift/openshift-java-client) [](https://maven-badges.herokuapp.com/maven-central/com.openshift/openshift-java-client) -=========================== +OpenShift Java Client Website +===================== -Java client for the OpenShift REST API. It pretty much offers all features that are currently available in the rhc-* command line tools -(create/rename a domain, create/destroy applications, list applications, list available cartridges, add cartridges, etc.). +Visit this site at http://openshift.github.io/openshift-java-client -Only for Version 2 ----------------- -This client is used by JBoss Tools for OpenShift 2.x. -For later OpenShift versions see https://github.com/openshift/openshift-restclient-java/. - -Usage ------ -An exemplary usage of the client may look like the following: - - IOpenShiftConnection connection = - new OpenShiftConnectionFactory().getConnection("myApplicationId", "user", "password"); - IUser user = connection.getUser(); - IDomain domain = user.createDomain("myDomain"); - IApplication as7Application = domain.createApplication("myApplication", LatestVersionOf.jbossAs().get(user)); - IEmbeddedCartridge mySqlCartridge = as7Application.addEmbeddableCartridge(LatestVersionOf.mySQL().get(user)); - String unstructuredCredentials = mySqlCartridge.getCreationLog(); - String mySqlConnectionUrl = mySqlCartridge.getUrl(); - -There are also 2 blog posts on jboss.org which discuss the API in more details: - -* [show-domain-info: openshift-java-client in a nutshell](http://planet.jboss.org/post/show_domain_info_openshift_java_client_in_a_nutshell) -* [enable-openshift-ci: full example using openshift-java-client](https://community.jboss.org/wiki/Enable-openshift-ciFullExampleUsingOpenshift-java-client) - -Most insightful are the integration tests within the library which pretty much use the API in all details: - -* ApplicationResourceIntegrationTest -* DomainResourceIntegrationTest -* EmbeddedCartridgeResourceIntegrationTest -* etc. - -Download --------- -You may either build from source using maven (mvn clean package) or get the prebuilt artifact from the maven central. +To run this site locally, install the "Jekyll" gem, checkout this gh-pages branch, and run "jekyll serve --watch" diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..2a7d0b91 --- /dev/null +++ b/Rakefile @@ -0,0 +1,200 @@ +# This file is a rake build file. The purpose of this file is to simplify +# setting up and using Awestruct. It's not required to use Awestruct, though it +# does save you time (hopefully). If you don't want to use rake, just ignore or +# delete this file. +# +# If you're just getting started, execute this command to install Awestruct and +# the libraries on which it depends: +# +# rake setup +# +# The setup task installs the necessary libraries according to which Ruby +# environment you are using. If you want the libraries kept inside the project, +# execute this command instead: +# +# rake setup[local] +# +# IMPORTANT: To install gems, you'll need development tools on your machine, +# which include a C compiler, the Ruby development libraries and some other +# development libraries as well. +# +# There are also tasks for running Awestruct. The build will auto-detect +# whether you are using Bundler and, if you are, wrap calls to awestruct in +# `bundle exec`. +# +# To run in Awestruct in development mode, execute: +# +# rake +# +# To clean the generated site before you build, execute: +# +# rake clean preview +# +# To deploy using the production profile, execute: +# +# rake deploy +# +# To get a list of all tasks, execute: +# +# rake -T +# +# Now you're Awestruct with rake! + +$use_bundle_exec = true +$install_gems = ['awestruct -v "~> 0.5.0"', 'rb-inotify -v "~> 0.9.0"'] +$awestruct_cmd = nil +task :default => :preview + +desc 'Setup the environment to run Awestruct' +task :setup, [:env] => :init do |task, args| + next if !which('awestruct').nil? + + if File.exist? 'Gemfile' + if args[:env] == 'local' + require 'fileutils' + FileUtils.remove_file 'Gemfile.lock', true + FileUtils.remove_dir '.bundle', true + system 'bundle install --binstubs=_bin --path=.bundle' + else + system 'bundle install' + end + else + if args[:env] == 'local' + $install_gems.each do |gem| + msg "Installing #{gem}..." + system "gem install --bindir=_bin --install-dir=.bundle #{gem}" + end + else + $install_gems.each do |gem| + msg "Installing #{gem}..." + system "gem install #{gem}" + end + end + end + msg 'Run awestruct using `awestruct` or `rake`' + # Don't execute any more tasks, need to reset env + exit 0 +end + +desc 'Update the environment to run Awestruct' +task :update => :init do + if File.exist? 'Gemfile' + system 'bundle update' + else + system 'gem update awestruct' + end + # Don't execute any more tasks, need to reset env + exit 0 +end + +desc 'Build and preview the site locally in development mode' +task :preview => :check do + run_awestruct '-d' +end + +# provide a serve task for those used to Jekyll commands +desc 'An alias to the preview task' +task :serve => :preview + +desc 'Generate the site using the specified profile (default: development)' +task :gen, [:profile] => :check do |task, args| + profile = args[:profile] || 'development' + profile = 'production' if profile == 'prod' + run_awestruct "-P #{profile} -g --force" +end + +desc 'Generate the site and deploy to production' +task :deploy => :check do + run_awestruct '-P production -g --force --deploy' +end + +desc 'Clean out generated site and temporary files' +task :clean, :spec do |task, args| + require 'fileutils' + dirs = ['.awestruct', '.sass-cache', '_site'] + if args[:spec] == 'all' + dirs << '_tmp' + end + dirs.each do |dir| + FileUtils.remove_dir dir unless !File.directory? dir + end +end + +# Perform initialization steps, such as setting up the PATH +task :init do + # Detect using gems local to project + if File.exist? '_bin' + ENV['PATH'] = "_bin#{File::PATH_SEPARATOR}#{ENV['PATH']}" + ENV['GEM_HOME'] = '.bundle' + end +end + +desc 'Check to ensure the environment is properly configured' +task :check => :init do + if !File.exist? 'Gemfile' + if which('awestruct').nil? + msg 'Could not find awestruct.', :warn + msg 'Run `rake setup` or `rake setup[local]` to install from RubyGems.' + # Enable once the rubygem-awestruct RPM is available + #msg 'Run `sudo yum install rubygem-awestruct` to install via RPM. (Fedora >= 18)' + exit 1 + else + $use_bundle_exec = false + next + end + end + + begin + require 'bundler' + Bundler.setup + rescue LoadError + $use_bundle_exec = false + rescue StandardError => e + msg e.message, :warn + if which('awestruct').nil? + msg 'Run `rake setup` or `rake setup[local]` to install required gems from RubyGems.' + else + msg 'Run `rake update` to install additional required gems from RubyGems.' + end + exit e.status_code + end +end + +# Execute Awestruct +def run_awestruct(args) + system "#{$use_bundle_exec ? 'bundle exec ' : ''}awestruct #{args}" +end + +# A cross-platform means of finding an executable in the $PATH. +# Respects $PATHEXT, which lists valid file extensions for executables on Windows +# +# which 'awestruct' +# => /usr/bin/awestruct +def which(cmd, opts = {}) + unless $awestruct_cmd.nil? || opts[:clear_cache] + return $awestruct_cmd + end + + $awestruct_cmd = nil + exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] + ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| + exts.each do |ext| + candidate = File.join path, "#{cmd}#{ext}" + if File.executable? candidate + $awestruct_cmd = candidate + return $awestruct_cmd + end + end + end + return $awestruct_cmd +end + +# Print a message to STDOUT +def msg(text, level = :info) + case level + when :warn + puts "\e[31m#{text}\e[0m" + else + puts "\e[33m#{text}\e[0m" + end +end diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..dfa30df7 --- /dev/null +++ b/_config.yml @@ -0,0 +1,3 @@ +name: OpenShift Java Client +markdown: redcarpet +pygments: true diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 00000000..e79250a9 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,79 @@ +