README.md in dtc_rake-0.2.0 vs README.md in dtc_rake-1.0.0.pre.beta.1

- old
+ new

@@ -5,39 +5,37 @@ ## Installation Add this line to your application's `Gemfile`: ```ruby -gem "dtc_rake", git: ""ssh://git@codebase.plus4u.net:9422/dtc.rake.git +gem "dtc_rake" ``` And then execute: $ bundle -Or build it yourself from source as: +Or install it yourself as: - $ git clone ssh://git@codebase.plus4u.net:9422/dtc.rake.git - $ cd dtc.rake/dtc_rake - $ rake install + $ gem install dtc_rake # Quick Start For a quick start just add to your appbox project's `Rakefile`: ```ruby require "dtc_rake" DtcRake.configure do |config| - config.appbox_uarchive = "<uarchive_path>" + config.product_code = "<product_code>" + config.product_name = "<product_name>" config.appbox_territory_code = "<territory_code>" - config.appbox_meta_artifact_code = "<meta_artifact_code>" config.appbox_location_code = "<folder_code>" end ``` -*Note: The appbox project name should be `<vendor>_<app>-appbox` and it must contain a uuApp deployment descriptor with default name `<vendor>_<app>-uuapp.json`.* +*Note: The appbox project name should be `<vendor>_<app>-appbox`. If not, you must specify `config.vendor` and `config.app` within `DtcRake.configure` in `Rakefile`.* All shared tasks will be found and loaded automatically, you can verify it with `rake -T` command. It is recommended to check whether the defaults fit your needs and change the configuration if needed. @@ -59,20 +57,19 @@ ## Configuration The following example shows all configuration options: - ```ruby require "dtc_rake" DtcRake.configure do |config| # Code of application. Guessed from root_dir name if not set. config.app = "<app_code>" # Code of appbox artifact. Guessed from vendor, app and version in uuApp - # deployment descriptor if not set. + # deployment descriptor if not set. Since 0.2.0. config.appbox_artifact_code = "<artifact_code>" # Code of appbox location (folder or organization unit). Required. config.appbox_location_code = "<folder_code>" @@ -84,32 +81,80 @@ # Path to uarchive with contents of appbox artifact. Default value: nil. # If not set, appbox is created with empty content. # Relative path is relative to root_dir. config.appbox_uarchive = "<uarchive_path>" + + # Appbox version. Read from VERSION file located in the same directory + # as Rakefile if not set. + config.appbox_version = "1.2.3-dev" - # Path to uuApp deployment descriptor. Guessed from vendor and app if not set. - config.app_descriptor_path = "<deployment_descriptor_path>" - # Print messages in colors. Default value: true. config.colorize = true # Name of folder with build products. Default value: target. # Relative path is relative to root_dir. config.output_dir = "target" + # Code of product the appbox belongs to. Required. + config.product_code = "UU-CLOUDG01-C3" + + # Name of product the appbox belongs to. Required. + config.product_name = "uuCloudg01C3" + # Appbox project root folder. Default value: current working directory. config.root_dir = Dir.pwd - # Upload uuApp deployment descriptor to appbox artifact. Default value: false. - config.upload_app_descriptor = true + # Upload README.md or README.txt to appbox artifact. Default value: false. + config.upload_readme = true + # Upload uuCloud deployment descriptor to appbox artifact. Default value: false. + config.upload_uucloud_descriptor = true + + # Path to uuCloud deployment descriptor. Default value: uucloud_descriptor.json. + config.uucloud_descriptor_path = "<uucloud_descriptor_path>" + # Code of vendor. Guessed from root_dir name if not set. config.vendor = "<vendor_code>" + + # List of files (or glob patterns) determining which files get updated by + # version:sync task. Default: none. + config.version_sync_files = ["../uu_c3/lib/uu_c3/version.rb"] end ``` +`VERSION` file contents example: + +``` +1.2.3-dev +``` + +*Note: Leading and trailing whitespace (incl. line breaks) does not matter - it gets stripped/trimmed. Only the version itself is important.* + +### Environment Variables + +Configuration can also be specified in environment variables. Environment variables take precedence over configuration in `Rakefile`. + +``` + DTC_RAKE_APP=<app_code> + DTC_RAKE_APPBOX_ARTIFACT_CODE=<artifact_code> + DTC_RAKE_APPBOX_LOCATION_CODE=<folder_code> + DTC_RAKE_APPBOX_META_ARTIFACT_CODE=<meta_artifact_code> + DTC_RAKE_APPBOX_TERRITORY_CODE=<territory_code> + DTC_RAKE_APPBOX_UARCHIVE=<uarchive_path> + DTC_RAKE_APPBOX_VERSION=1.2.3-dev + DTC_RAKE_COLORIZE=false + DTC_RAKE_OUTPUT_DIR=target + DTC_RAKE_PRODUCT_CODE=UU-CLOUDG01-C3 + DTC_RAKE_PRODUCT_NAME=uuCloudg01C3 + DTC_RAKE_ROOT_DIR=<root_dir> + DTC_RAKE_UPLOAD_README=true + DTC_RAKE_UPLOAD_UUCLOUD_DESCRIPTOR=true + DTC_RAKE_UUCLOUD_DESCRIPTOR_PATH=<uucloud_descriptor_path> + DTC_RAKE_VENDOR=<vendor_code> +``` + ## Explanation of Provided Tasks ### appbox Creates new appbox artifact. @@ -134,11 +179,11 @@ Builds pack with command server. Available if project `<vendor>_<app>-cmd` exists. ### build:dockerfiles -Builds pack with `Dockerfile`s. Available if project `<vendor>_<app>-dockerfiles` exists. +Builds pack with `Dockerfile`s. Available if project `docker` exists. ### build:gem Builds pack with command client Ruby gem. Available if project `<vendor>_<app>` exists. @@ -146,11 +191,11 @@ Builds pack with visual use cases. Available if project `<vendor>_<app>-vuc` exists. ### build:yardoc -Builds pach with command client yardoc. Available if project `<vendor>_<app>` exists. +Builds pack with command client yardoc. Available if project `<vendor>_<app>` exists. ### upload:all Uploads all available packs to appbox artifact. Which packs get uploaded depends on which projects exist for the app being built. See example for the `build:all` task. @@ -160,17 +205,17 @@ Requires `DTC_RAKE_PASSWD` to be set. ### upload:descriptor -Uploads uuApp deployment descriptor to appbox artifact. Available if `config.upload_app_descriptor` is set to `true`. +Uploads uuApp deployment descriptor to appbox artifact. Available if `config.upload_uucloud_descriptor` is set to `true`. Requires `DTC_RAKE_PASSWD` to be set. ### upload:dockerfiles -Uploads pack with `Dockerfile`s to appbox artifact. Available if project `<vendor>_<app>-dockerfiles` exists. +Uploads pack with `Dockerfile`s to appbox artifact. Available if project `docker` exists. Requires `DTC_RAKE_PASSWD` to be set. ### upload:gem @@ -184,14 +229,34 @@ Requires `DTC_RAKE_PASSWD` to be set. ### upload:yardoc -Uploads pach with command client yardoc to appbox artifact. Available if project `<vendor>_<app>` exists. +Uploads pack with command client yardoc to appbox artifact. Available if project `<vendor>_<app>` exists. Requires `DTC_RAKE_PASSWD` to be set. +### version + +Shows the current version stored in `VERSION` file located in the same directory as `Rakefile`. + +### version:bump:major + +Bumps the major version. Updates `VERSION` file located in the same directory as `Rakefile` and files specified in `config.version_files`. + +### version:bump:minor + +Bumps the minor version. Updates `VERSION` file located in the same directory as `Rakefile` and files specified in `config.version_files`. + +### version:bump:patch + +Bumps the patch version. Updates `VERSION` file located in the same directory as `Rakefile` and files specified in `config.version_files`. + +### version:set + +Sets the version. The version may contain *prerelease* and/or *build metadata* parts (see [Semantic Versioning](http://semver.org)). Updates `VERSION` file located in the same directory as `Rakefile` and files specified in `config.version_files`. + # How-to ## How to Add Custom Task When a project requires a specific Rake task then implement it and add it to a shared task as dependency: @@ -215,16 +280,9 @@ ```ruby require "dtc_rake" ``` with - -```ruby -require "dtc_rake/tasks" -DtcRake::Tasks.load_tasks(exclude: ["upload_dockerfiles.rake"]) -``` - -To remove check that is used also as dependency for e.g. `upload:all`, it is needed to remove it also from prerequisites of task. Example how to remove `upload:dockerfiles` and do not call it when building all packs. ```ruby require "dtc_rake/tasks" DtcRake::Tasks.load_tasks(exclude: ["upload_dockerfiles.rake"]) Rake::Task["upload:all"].prerequisites.delete("dockerfiles")