├── .project ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── NOTICE ├── README.md ├── build.xml ├── core ├── conf │ └── core.properties └── resources │ └── ant │ ├── config_buildcallbacks.xml │ ├── lib │ └── ant-contrib-1.0b3.jar │ ├── macros.xml │ ├── tasks.xml │ └── util.xml ├── custom ├── conf │ ├── env │ │ ├── dev │ │ │ ├── dev.properties │ │ │ ├── dev01.properties │ │ │ └── dev02.properties │ │ ├── global.properties │ │ └── qa │ │ │ └── qa.properties │ └── ydeploy.properties └── resources │ └── ant │ └── custom.xml └── template └── hybris └── config ├── buildcallbacks.xml └── ydeploy └── localproperties ├── dev ├── dev.properties └── dev01.properties ├── global.properties └── qa ├── qa.properties └── qa01.properties /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ydeploy 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of ydeploy authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization (website-url) 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Avatria, Inc. (http://www.avatria.com) -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who have contributed 2 | # to the code of the ydeploy repository. 3 | # 4 | # The AUTHORS file lists the copyright holders; this file 5 | # lists people. For example, Avatria, Inc. employees are listed here 6 | # but not in AUTHORS, because Avatria, Inc. holds the copyright. 7 | # 8 | 9 | # Names should be added to this file like so: 10 | # Name (organization) 11 | # 12 | 13 | # Please keep the list sorted in alphabetical order (last name, first name) 14 | 15 | Brian Ballard (Avatria, Inc.) 16 | Zach McMahon (Avatria, Inc.) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | ydeploy 2 | Copyright 2014-2015 The ydeploy Authors 3 | 4 | This product includes software developed by various authors and 5 | made possible by various contributors. See the included AUTHORS and 6 | CONTRIBUTORS for details. 7 | 8 | ydeploy also includes a number of subcomponents with separate copyright 9 | notices and license terms. The product that includes this file 10 | does not necessarily use all the open source subcomponents referred 11 | to below. Your use of the source code for the these subcomponents 12 | is subject to the terms and conditions of the following licenses. 13 | 14 | ======================================================================= 15 | 16 | SECTION 1: APACHE-STYLE LICENSES 17 | 18 | >>> Ant-Contrib 19 | 20 | --------------- SECTION 1: APACHE-STYLE LICENSES ---------- 21 | 22 | APACHE-STYLE LICENSES are applicable to the following component(s). 23 | 24 | >>> Ant-Contrib 25 | 26 | Copyright (c) 2001-2003 Ant-Contrib project. All rights reserved. 27 | Licensed under the Apache 1.1 License Agreement, a copy of which is reproduced below. 28 | 29 | The Apache Software License, Version 1.1 30 | 31 | Copyright (c) 2001-2003 Ant-Contrib project. All rights reserved. 32 | 33 | Redistribution and use in source and binary forms, with or without 34 | modification, are permitted provided that the following conditions 35 | are met: 36 | 37 | 1. Redistributions of source code must retain the above copyright 38 | notice, this list of conditions and the following disclaimer. 39 | 40 | 2. Redistributions in binary form must reproduce the above copyright 41 | notice, this list of conditions and the following disclaimer in 42 | the documentation and/or other materials provided with the 43 | distribution. 44 | 45 | 3. The end-user documentation included with the redistribution, if 46 | any, must include the following acknowlegement: 47 | "This product includes software developed by the 48 | Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)." 49 | Alternately, this acknowlegement may appear in the software itself, 50 | if and wherever such third-party acknowlegements normally appear. 51 | 52 | 4. The name Ant-Contrib must not be used to endorse or promote 53 | products derived from this software without prior written 54 | permission. For written permission, please contact 55 | ant-contrib-developers@lists.sourceforge.net. 56 | 57 | 5. Products derived from this software may not be called "Ant-Contrib" 58 | nor may "Ant-Contrib" appear in their names without prior written 59 | permission of the Ant-Contrib project. 60 | 61 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 62 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 63 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 64 | DISCLAIMED. IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS 65 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 66 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 67 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 68 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 69 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 70 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 71 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 72 | SUCH DAMAGE. 73 | 74 | -------------------- END SECTION 1 ------------------------ 75 | 76 | ======================================================================= -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ydeploy 2 | *A hybris® build and deployment framework* 3 | 4 | ## Introduction 5 | ydeploy is a continuous build and deployment framework for the hybris commerce suite. 6 | 7 | ydeploy integrates with the hybris platform build framework and attempts to reduce the amount of effort necessary to implement automated build and deployment tasks for hybris software across your environment landscape. Like the hybris build framework, ydeploy is built on Apache Ant and should be easy to pickup for most Java developers. 8 | 9 | ydeploy is intended to be a simple, yet extensible tool. 10 | 11 | The standard distribution provides a set of configurable build targets intended to address the most common build and deployment requirements. When necessary, the framework can be customized and extended to meet various other operational tasks related to administering hybris software. 12 | 13 | ## Why ydeploy? 14 | At the most basic level, the ydeploy framework provides you a simple way to perform the following tasks: 15 | 16 | 1. Build and generate "build once, deploy everywhere" hybris release packages 17 | 2. Deploy your hybris release packages out to any number of servers or environments 18 | 3. Perform standard hybris server administrative (e.g. start, stop, restart) tasks from your build server. 19 | 20 | However, if you dig in a bit deeper you will find that ydeploy actually provides you with quite a bit more. 21 | 22 | ### Features & Benefits 23 | 24 | #### Build & Deployment 25 | * Quick and easy setup of hybris build & deployment jobs from your continuous integration server 26 | * Support for starting, stopping, and restarting your hybris servers from your build server 27 | * Ability to execute multiple build, release, and deployment jobs concurrently from a single build server 28 | * Support for automated deployment and installation of the hybris platform software on new servers 29 | * Support for automated deployment of hybris platform upgrades on existing servers 30 | * Ability to utilize different hybris platform release versions across your development branches and environments 31 | * Framework is platform agnostic and works across most Windows, Linux, and Unix variants 32 | 33 | #### Configuration Management 34 | * An optimal approach to manage and deploy your global, environment specific, and application instance specific hybris property configurations. 35 | * Ability to dynamically derive or discover your hybris configuration values at build or deploy time. 36 | * Automatic packaging and deployment of your custom server configuration files (tomcat, tcServer, solr), hybris License files, or platform customization files. 37 | 38 | #### Extending ydeploy 39 | * Many other similar administrative & operational tasks can be simplified by implementing them on the ydeploy framework. 40 | 41 | ### ydeploy is NOT... 42 | ydeploy is not a comprehensive all-in-one solution intended to address all of your hybris continuous deployment needs. There are many very capable general-purpose tools available which can be used to address individual parts of your deployment strategy. ydeploy is intended to be an open tool that you can use to fill the functional gap between these general-purpose tools and the limited continuous deployment capabilites that the hybris plaform provides out of the box. 43 | 44 | Below is a sampling of capabilities that ydpeloy does not provide natively. We leave it up to you to decide the best tool to meet these needs for your organization. 45 | * **Continuous Integration Server**: While ydeploy orchestrates a lot of the activities that happen after kicking of a build task, we highly recommend using a CI server such as Jenkins, AntHill, or Bamboo (to name a few) to provide a simple interface for kicking off your ydeploy builds, managing build lifecycles, addressing authentication & access control needs, etc. 46 | * **Source Control**: ydeploy is not a source control tool and does not itself checkout code, tag releases, or perform any other source control related operations. Most CI servers have very strong capabilities releated to source control needs, so we recommend using these capabilites when available. 47 | * **Artifact Repository**: ydeploy does not itself manage or archive your build artifacts. CI server typically provides these capabilities or will have integration with such solutions. 48 | * **File transfer**: When performing deployments, ydeploy does not actually distribute (i.e. copy) release artifacts out to target server. Again, most CI servers typically have very strong capabilities to copy files and invokes processes on remote servers in your environment landscape. 49 | 50 | ## Usage Example 51 | 52 | Before diving into the low level details regarding how to setup ydeploy, you may be wanting to see a more concrete example regarding what the ydeploy tool can do for you. In this section we'll show you the standard capabilities of the solution, but gloss over the fine print regarding how you can customize and configure the tool to meet your needs. For detailed information regarding integrating ydeploy into your hybris solution, please see the "Using ydeploy" section. 53 | 54 | ### The build command 55 | 56 | ydeploy is designed to be checked into your source control repository along with your hybris custom extensions and configuration directories. 57 | 58 | ``` 59 | hybris-repo 60 | /config 61 | /localextensions.xml 62 | [ . . . ] 63 | /custom 64 | /custext1 65 | /custext2 66 | [ . . . ] 67 | /ydeploy 68 | ``` 69 | 70 | After checking out the contents of your repo, we can use ydeploy to perform a full build of your custom hybris extension using the `build` command. 71 | 72 | ``` 73 | $ ls 74 | config custom ydeploy 75 | $ cd ydeploy 76 | $ ant build 77 | Buildfile: /opt/build/workspace/ydeploy/build.xml 78 | [echo] Initializing ydeploy 79 | 80 | [ . . . ] 81 | 82 | BUILD SUCCESSFUL 83 | Total time: 49 seconds 84 | ``` 85 | 86 | That's it! ydeploy has successfully performed a full build of your hybris solution for you. 87 | 88 | You can see the built solution by looking into the `ydeploy/temp/build` directory. 89 | 90 | ``` 91 | $ cd ydeploy/temp/build/hybris 92 | $ ls 93 | bin config data log sampleconfigurations temp 94 | ``` 95 | 96 | At this point you may be scratching your head and asking *"why not just invoke the hybris build directly from the hybris/bin/platform directory?"* 97 | 98 | Great question! To answer, lets think through all of the steps we would have had to perform to achieve the same thing without ydeploy. 99 | 100 | 1. First, we would need to have the hybris software setup on the machine beforehand. In the example above, hybris was not even setup on the machine prior to running the ydeploy `build` command. ydeploy automatically set everything up 101 | 2. After setting up hybris we would need to deploy the custom extensions and config directories from the checkout location to the proper locations within the hybris install 102 | 3. Next, we would likely need to update the local.properties, localextensions.xml and other configuration files within the hybris/config directory to ensure the build process runs correctly on this particular machine. 103 | 4. Almost ready to build. But first, we would need to go into the hybris/bin/platform directory and setup the environment using that `setantenv.sh` script 104 | 5. At this point we *should* be able to run the standard hybris build process 105 | 106 | Clearly ydeploy has helped simplify the process. Next, lets look at how to generate a release using ydeploy. 107 | 108 | ### The genrelease command 109 | 110 | In this section we'll look at how to build and generate a hybris release package using ydeploy. The release packages generated by the `genrelease` command encapsulate all of the software and configuration required to deploy hybris across your environment landscape. This includes the hybris platform software, any custom extensions, and the hybris server configuration. 111 | 112 | Similar to the `build` task, `genrelease` can be done in a single command 113 | 114 | ``` 115 | $ cd ydeploy 116 | $ ant genrelease 117 | Buildfile: /opt/build/workspace/ydeploy/build.xml 118 | [echo] Initializing ydeploy 119 | [ . . . ] 120 | BUILD SUCCESSFUL 121 | Total time: 1 minute 18 second 122 | ``` 123 | 124 | Just as with the `build` command, the `genrelease` command has setup hybris on the fly, performed the build, and generated a release package which can be used to deploy hybris to any of our environments. 125 | You can see the generated release package by looking into the ydeploy/temp/genrelease directory. 126 | 127 | ``` 128 | $ cd ydeploy/temp/genrelease 129 | $ ls 130 | hybrisServer-Release-0.zip 131 | ``` 132 | 133 | ### The deployrelease command 134 | 135 | The `deployrelease` command is used to deploy the hybris release package which is generated by the `genrelease` command to servers in your environment landscape. Specifically, ydeploy performs the following steps: 136 | 137 | 1. Detects the location of the hybris platform on the target server (if installed) and stops the server (if running). 138 | 2. Extracts the contents of the hybris release packages and deploys them to proper hybris installation location. 139 | 3. Deploys the proper server specific configuration for the target server and invokes the hybris build. 140 | 4. Starts the hybris build server on the new release. 141 | 142 | > **Note:** hybris does not actually need to already been installed. ydeploy will automatically install and configure the hybris platform as part of the deployrelease task. 143 | 144 | One thing to note is that ydeploy isn't designed to actually copy the hybris release package from your build server to the target server, but once the package is copied to the destination server, ydeploy can handle the rest. 145 | 146 | > **Note:** To copy the hybris release package from your build server to your target server, we recommend using the capabilities of your continuous integration server. Further discussions regarding how to integrate ydeploy into Jenkins can be found in the Integrating ydeploy with Jenkins section. 147 | 148 | For the example below, I've copied the hybrisServer-Release-0.zip which we generated above to the target server. As the ydeploy package is embedded into the hybris release package, we first need to extract the zip before we can invoke ydeploy. 149 | 150 | ``` 151 | $ cd /opt/build/releases 152 | $ ls 153 | hybrisServer-Release-0.zip 154 | $ unzip hybrisServer-Release-0.zip & cd ydeploy & ant deployrelease 155 | Buildfile: /opt/build/releases/ydeploy/build.xml 156 | [echo] Initializing ydeploy 157 | [ . . . ] 158 | BUILD SUCCESSFUL 159 | Total time: 2 minutes 25 second 160 | ``` 161 | 162 | At this point our new release has been deployed to the target server. 163 | 164 | ## Setting up ydeploy 165 | In this section we will provide a quick walk through of how to integrate ydeploy into your hybris solution. 166 | 167 | ### Downloading the release 168 | 169 | You can download a copy of the current ydeploy release using the `master` branch of the Git repository. You can either clone the repo using your Git client of choice or you can download a zip of the repo content using the link below. 170 | 171 | https://github.com/avatria/ydeploy/archive/master.zip 172 | 173 | ### Integration into your solution 174 | 175 | Before we get started with integrating ydeploy into your hybris solution, lets do a quick review of the contents of the distribution. 176 | 177 | #### ydeploy Directory Structure 178 | 179 | Below is the basic directory structure of the ydeploy software. 180 | 181 | ``` 182 | ydeploy/ 183 | /core 184 | /conf 185 | /core.properties 186 | /resources 187 | /custom 188 | /conf 189 | /ydeploy.properties 190 | /env 191 | /resources 192 | 193 | /template 194 | /hybris 195 | /config 196 | /buildcallbacks.xml 197 | /ydeploy 198 | 199 | ``` 200 | 201 | The `ydeploy/core` directory contains configuration and resources which are integral to the framework and typically should not be edited. 202 | 203 | The `ydeploy/custom` directory should contain all user specific configurations and customizations. The intent is to keep user specific customizations separate from core framework code and configuration. `ydeploy.properties` and the `env` directory will be where most of your configuration customizations will reside. 204 | 205 | The `ydeploy/template` directory contains files and sample configurations that are intended to copied in your standard hybris install structure. Currently all template files should be placed under your `hybris/config` directory (i.e. `${HYBRIS_CONFIG_DIR}`). 206 | 207 | #### Checking ydeploy into source control 208 | 209 | It is recommended that you add the full contents of the ydeploy distribution to your source code repository right along side your hybris customizations directory (e.g. `custom`) and your `hybris/config` directory. 210 | 211 | Additionally, you should copy the contents of the `ydeploy/template/hybris/config` into your `hybris/config` directory. This step is necessary to allow ydeploy to hook into certain behaviors of the hybris build framework. 212 | 213 | Below is an example of how your source control repo contents may look after integrating ydeploy. 214 | 215 | ``` 216 | hybris-repo 217 | /config 218 | /buildcallbacks.xml [from ydeploy distribution template dir] 219 | /ydeploy [from ydeploy distribution template dir] 220 | 221 | /custom 222 | /custext1 223 | /custext2 224 | [ . . . ] 225 | /ydeploy [full ydeploy distribution] 226 | ``` 227 | 228 | ### ydeploy Configuration 229 | Once you have copied ydeploy into your source control repository, you will need to review and edit some of the common configurations. Below are the primary configuration you should review and edit. 230 | 231 | #### ydeploy/custom/conf/ydeploy.properties 232 | These are the ydeploy framework configurations that likely may need editing. 233 | 234 | ``` 235 | # Where your hybris 'custom' extensions and 'config' folders are stored in source control in relation 236 | # to the ydeploy directory. 237 | yd.hybris.custom.ext.dir=${yd.root.dir}/../custom 238 | yd.hybris.custom.config.dir=${yd.root.dir}/../config 239 | 240 | # hybris build tasks to perform when the ydeploy 'build' target is invoked 241 | yd.tasks.build.hybrisbuildtargets=customize all 242 | 243 | # hybris build tasks to perform when the ydeploy 'genrelease' target is invoked 244 | yd.tasks.genrelease.hybrisbuildtargets=customize all production 245 | 246 | # hybris build tasks to perform when the ydeploy 'deployrelease' target is invoked on the target server 247 | yd.tasks.deployrelease.hybrisbuildtargets=all 248 | ``` 249 | 250 | #### ydeploy/custom/conf/env/global.properties 251 | This file contains your global ydeploy framework configurations. 252 | 253 | ``` 254 | # Where hybris platform zip releases are stored 255 | yd.hybris.platform.releases.dir=/opt/build/hybris/releases 256 | 257 | # The hybris platform zip file to use for 'build' and 'genrelease' targets. 258 | # Must exist in the ${yd.hybris.platform.releases.dir} location 259 | yd.hybris.platform.release.file=hybris-commerce-suite-5.4.0.1.min.zip 260 | 261 | # Location at which the 'deployrelease' and server related targets will operate. 262 | yd.hybris.platform.deploy.dir=/opt/hybriscs 263 | ``` 264 | 265 | The first two settings described above (`yd.hybris.platform.releases.dir`, `yd.hybris.platform.release.file`) are very important and tell ydeploy where to find the standard hybris platform release zip to use to setup hybris 'on the fly' for the build and genrelease commands. You must configure these properties to point to the hybris release ZIP file you would like to use. 266 | 267 | > **Note:** For hybris releases prior to 5.5, the release ZIP file can be the vanilla hybris install which you downloaded from the hybris/SAP site. If you are using hybris 5.6 or later it is recommended that you combine the hybris commerce suite ZIP with the hybris Maven dependencies ZIP (e.g. hybris-dependencies), as these dependencies may be required if you are using archetypes or modules leveraging Core+. 268 | 269 | The last setting (`yd.hybris.platform.deploy.dir`) tells ydeploy where to install hybris on your server when the deploy command is executed. 270 | 271 | The configuration values set in global.properties will be used unless you choose to provide different configurations to be used at an environment or server specific level. 272 | 273 | ``` 274 | ydeploy 275 | /custom 276 | /conf 277 | /env 278 | /global.properties 279 | /dev 280 | /dev.properties 281 | /dev01.properties 282 | /dev02.properties 283 | /qa 284 | /qa.properties 285 | ``` 286 | 287 | When you invoke ydeploy it will determine what configurations to use based upon any environment or server specific configurations you provide. This is described more in the next section. 288 | 289 | ### Running ydeploy 290 | When you invoke ydeploy, it will first look to detect any environment or server specific configuration values which you may have provided via environmental variables or passed in via command line parameters. 291 | * Environmental Variables 292 | * `HYBRIS_ENV` 293 | * `HYBRIS_SERVER_ID` 294 | * Command Line Parameters 295 | * `-Dhybris_env` 296 | * `-Dhybris_server_id` 297 | 298 | Typically, we recommended only using the command line parameter approach for initial testing and debugging purposes. 299 | 300 | Below is an example of running ydeploy using the command line argument approach. 301 | 302 | ``` 303 | $ cd ydeploy 304 | $ ant build -Dhybris_env=dev -Dhybris_server_id=dev01 305 | ``` 306 | 307 | In this example, the effective ydeploy framework configuration will be loaded in the following order with later configuration values taking precedence. 308 | 309 | 1. ydeploy/custom/conf/env/global.properties 310 | 2. ydeploy/custom/conf/env/dev/dev.properties 311 | 3. ydeploy/custom/conf/env/dev/dev01.properties 312 | 313 | Once you have all of the configuration layers setup properly, we recommend setting up the environmental variables across all of the build and target hybris application servers that ydeploy will run. This will allow for the ydeploy framework to infer the proper configurations to use from the environment itself such that the command line parameters can be omitted. 314 | 315 | ### Managing hybris Property Configuration 316 | 317 | One of the key benefits of ydeploy is that it provides the ability to manage hybris Configuration Properties in an optimal manner by allow you to define your configuration values at at any one of three levels. 318 | 319 | 1. Global Configuration Properties 320 | 2. Environment-specific Configuration Properties 321 | 3. Application Instance-specific Configuration Properties 322 | 323 | These configuration levels should reside within the `${HYBRIS_CONFIG_DIR}/ydeploy/localproperties` directory. An example structure is provided below but is also available in the ydeploy distribution at the `ydeploy/template/hybris/config` location. 324 | 325 | ``` 326 | /config [ ${HYBRIS_CONFIG_DIR} ] 327 | /ydeploy 328 | /localproperties 329 | /global.properties 330 | /dev 331 | /dev.properties 332 | /dev01.properties 333 | /dev02.properties 334 | /qa 335 | /qa.properties 336 | /qa01.properties 337 | /qa02.properties 338 | [... etc ...] 339 | ``` 340 | 341 | Whenever a hybris build is invoked, ydepoy will merge the three levels of properties files together in the order specified above to generate the effective local.properties at the `${HYBRIS_CONFIG_DIR}/local.properties` location. When a property value is is defined at multiple levels, later levels override earlier, more global levels. 342 | 343 | You will find that this flexible structure allows for you to greatly reduce duplication of local.properties configurations which ultimately helps reduce maintenance and risk of errors or omissions. 344 | 345 | #### global.properties 346 | global.properties refers to the properties file that contains configuration that will apply to every environment and every node in every environment unless that property is overridden at a lower level (i.e. environment or environment node). 347 | 348 | #### \.properties 349 | \.properties refers to a Properties file that contains the configuration specific to an entire environment. The file must be named using the convention /.properties name where is the Environment ID that is supplied to the ydeploy framework via an environment variable (`${HYBRIS_ENV_ID}`) or passed to ydeploy via a command line parameter (`-Dhybris_env_id=`). This Environment ID must be the name of the folder that the Environment-specific Configuration Properties reside in and must also be the name of the file that contains the Environment-specific Configuration Properties. e.g. Given an Environment ID of dev, the following must exist in the config directory. 350 | 351 | #### \.properties 352 | \.properties refers to a Properties file that contains the configuration instance-specific configuration for an individual hybris JVM. The file must be named using the convention /.properties name where is the Environment ID which the server belongs, and represents the unique identifier for the hybris JVM process. These variables are supplied to the ydeploy framework via environment variables (`${HYBRIS_ENV_ID}` and `${HYBRIS_SERVER_ID}`) or passed to ydeploy via a command line parameters (`-Dhybris_env_id=`, `-Dhybris_server_id=`). 353 | 354 | ## Other 355 | 356 | ### Speeding Up Builds 357 | If you are performing clean hybris installs often using ydeploy, you may find that a significant amount of the time is actually spent just extracting the hybris release ZIP file prior to running the build. If you find the extraction of the full hybris release ZIP is consuming a lot of time, you can typically speed things up significantly by stripping out files or directories from the ZIP which you are not using. Unused hybris extensions, such as accelerator templates and sampledata, and the hybris-Mobile-Apps-SDK are usually pretty good candidates for removal. Basically, make the ZIP file as small so that the unzip goes quicker. 358 | 359 | ## History 360 | ydeploy was originally developed by Avatria, Inc. (http://www.avatria.com) and donated to the community as an Open Source project under the Apache 2.0 License. The project continues to be maintained by the Avatria team, however, contributions and involvement by all organizations and individuals is welcome. 361 | 362 | ## Support and Contact 363 | For issues, suggestions, or feature requests, please post an issue (https://github.com/avatria/ydeploy/issues). 364 | 365 | For comments, questions, or feedback please send a message to [@zmcmahon-avatria](https://github.com/zmcmahon-avatria). 366 | 367 | ## Disclaimers 368 | hybris is the trademark of SAP SE in Germany and in several other countries. 369 | ydeploy is an independently developed open source software solution which is maintained and supported by the ydeploy community and distributed under the Apache 2.0 License. ydeploy was not developed by hybris or SAP. 370 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | ydeploy: A continuous build and deployment framework for hybris 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /core/conf/core.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 The ydeploy Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | yd.root.dir=${basedir} 16 | yd.core.dir=${yd.root.dir}/core 17 | yd.core.conf.dir=${yd.core.dir}/conf 18 | yd.core.resources.ant.dir=${yd.core.dir}/resources/ant 19 | 20 | yd.temp.dir=${yd.root.dir}/temp 21 | yd.build.dir=${yd.temp.dir}/build 22 | 23 | yd.custom.dir=${yd.root.dir}/custom 24 | yd.custom.conf.dir=${yd.custom.dir}/conf 25 | yd.custom.resources.ant.dir=${yd.custom.dir}/resources/ant 26 | 27 | yd.custom.conf.env.dir=${yd.custom.conf.dir}/env -------------------------------------------------------------------------------- /core/resources/ant/config_buildcallbacks.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 75 | 77 | 79 | 81 | 82 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /core/resources/ant/lib/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avatria/ydeploy/0492c42c1d6a10e7f497f468eb832e1061776678/core/resources/ant/lib/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /core/resources/ant/macros.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /core/resources/ant/tasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /core/resources/ant/util.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /custom/conf/env/dev/dev.properties: -------------------------------------------------------------------------------- 1 | # Environment specific overrides 2 | yd.hybris.platform.deploy.dir=C:\\apps\\hybriscs -------------------------------------------------------------------------------- /custom/conf/env/dev/dev01.properties: -------------------------------------------------------------------------------- 1 | # Instance specific overrides -------------------------------------------------------------------------------- /custom/conf/env/dev/dev02.properties: -------------------------------------------------------------------------------- 1 | # Instance specific overrides -------------------------------------------------------------------------------- /custom/conf/env/global.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 The ydeploy Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Where hybris platform zip releases are stored 16 | yd.hybris.platform.releases.dir=/opt/build/hybris/releases 17 | 18 | # The hybris platform zip file to use for 'build' and 'genrelease' targets. 19 | # Must exist in the ${yd.hybris.platform.releases.dir} location 20 | yd.hybris.platform.release.file=hybris-commerce-suite-5.4.0.1.min.zip 21 | 22 | # Location at which the 'deployrelease' and server related targets will operate. 23 | yd.hybris.platform.deploy.dir=/opt/hybriscs -------------------------------------------------------------------------------- /custom/conf/env/qa/qa.properties: -------------------------------------------------------------------------------- 1 | # Environment specific overrides -------------------------------------------------------------------------------- /custom/conf/ydeploy.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 The ydeploy Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Where your hybris 'custom' extensions and 'config' folders are stored in source control in relation 16 | # to the ydeploy directory. 17 | yd.hybris.custom.ext.dir=${yd.root.dir}/../custom 18 | yd.hybris.custom.config.dir=${yd.root.dir}/../config 19 | 20 | # hybris build tasks to perform when the ydeploy 'build' target is invoked 21 | yd.tasks.build.hybrisbuildtargets=customize all 22 | 23 | # hybris build tasks to perform when the ydeploy 'genrelease' target is invoked 24 | yd.tasks.genrelease.hybrisbuildtargets=customize all production 25 | yd.tasks.genrelease.output.dir=${yd.temp.dir}/genrelease 26 | yd.tasks.genrelease.releasefileprefix=hybrisServer-Release 27 | 28 | # hybris build tasks to perform when the ydeploy 'deployrelease' target is invoked on the target server 29 | yd.tasks.deployrelease.hybrisbuildtargets=all 30 | -------------------------------------------------------------------------------- /custom/resources/ant/custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /template/hybris/config/buildcallbacks.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /template/hybris/config/ydeploy/localproperties/dev/dev.properties: -------------------------------------------------------------------------------- 1 | # Environment specific properties -------------------------------------------------------------------------------- /template/hybris/config/ydeploy/localproperties/dev/dev01.properties: -------------------------------------------------------------------------------- 1 | # Instance specific properties -------------------------------------------------------------------------------- /template/hybris/config/ydeploy/localproperties/global.properties: -------------------------------------------------------------------------------- 1 | # Global properties used across all environments and instances -------------------------------------------------------------------------------- /template/hybris/config/ydeploy/localproperties/qa/qa.properties: -------------------------------------------------------------------------------- 1 | # Environment specific properties -------------------------------------------------------------------------------- /template/hybris/config/ydeploy/localproperties/qa/qa01.properties: -------------------------------------------------------------------------------- 1 | # Instance specific properties --------------------------------------------------------------------------------