From commits-return-51418-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Tue Nov 12 14:28:37 2019 Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id EB73819FA5 for ; Tue, 12 Nov 2019 14:28:36 +0000 (UTC) Received: (qmail 84195 invoked by uid 500); 12 Nov 2019 14:28:36 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 84142 invoked by uid 500); 12 Nov 2019 14:28:36 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 84131 invoked by uid 99); 12 Nov 2019 14:28:36 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2019 14:28:36 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 0789F851DB; Tue, 12 Nov 2019 14:28:36 +0000 (UTC) Date: Tue, 12 Nov 2019 14:28:35 +0000 To: "commits@directory.apache.org" Subject: [directory-fortress-core] branch master updated: Add example of interpolation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <157356891597.5291.15059451407759942976@gitbox.apache.org> From: smckinney@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: directory-fortress-core X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 7e5b1362ded829cf0cddbf8539aabd20f0861d90 X-Git-Newrev: 4a27cbfc647abf8def4fe23b50b95e48aab536b8 X-Git-Rev: 4a27cbfc647abf8def4fe23b50b95e48aab536b8 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. smckinney pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/directory-fortress-core.git The following commit(s) were added to refs/heads/master by this push: new 4a27cbf Add example of interpolation 4a27cbf is described below commit 4a27cbfc647abf8def4fe23b50b95e48aab536b8 Author: smckinney AuthorDate: Tue Nov 12 08:28:30 2019 -0600 Add example of interpolation --- README-CONFIG.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/README-CONFIG.md b/README-CONFIG.md index d3b07ab..cc291b9 100644 --- a/README-CONFIG.md +++ b/README-CONFIG.md @@ -31,24 +31,64 @@ ------------------------------------------------------------------------------- ## SECTION 1. Fortress Configuration Subsystem Overview -Fortress uses interpolation to weave values found in the following source property files into its bootstrap configuration: +Fortress uses interpolation to weave values located in source property files into target configuration files. -1. Apache Ant Property Files (source of substitution parameters): +A. Option files containing environment specific values: * user.properties * [slapd.properties](./slapd.properties.example) * [build.properties](./build.properties.example) -2. Apache Ant script: + +B. Source files containing substitution expressions : + * [fortress.properties.src](./config/fortress.properties.src) + * [refreshLDAPData.xml.src](./ldap/setup/refreshLDAPData-src.xml) + * [slapd.conf.src](./ldap/slapd.conf.src) (if using openldap) + +C. Target files generated by Fortress: + * [fortress.properties](./config/fortress.properties) + * [refreshLDAPData.xml](./ldap/setup/refreshLDAPData.xml) + * [slapd.conf](./ldap/slapd.conf) (if using openldap) + +D. Apache Ant script with the mapping rules: A -> B = C: * [build-config.xml](./build-config.xml) -Which are used to produce new artifacts used by Fortress runtime (target files of substitution): + The substitution parameters found in B, as **@name@**, are placeholders for the actual values found in A. + These are used by an Ant config task (D) to replace values into the actual files (C) needed by Fortress runtime. + This interpolation process seeds implementation specific variables into configuration targets. + For example, host names, ports, pw's (ldap server coordinates) are loaded into the target, fortress.properties. + +For Example: + +A. Snip from [fortress.properties.src](./config/fortress.properties.src) +``` +# Host name and port of LDAP DIT: +host=@LDAP_HOST@ +port=@LDAP_PORT@ + +# Options are openldap or apacheds (default): +ldap.server.type=@SERVER_TYPE@ +``` + +B. Snip from [build.properties](./build.properties.example) +``` +# These parameters point fortress to LDAP host: +ldap.host=ldapvip.net +ldap.port=389 + +# This is default, tells fortress what type of ldap server in use: +ldap.server.type=openldap +``` -1. [fortress.properties](./config/fortress.properties.src) -2. [refreshLDAPData.xml](./ldap/setup/refreshLDAPData-src.xml) -3. [slapd.conf](./ldap/slapd.conf.src) (if using openldap) +C. Becomes snip from [fortress.properties](./config/fortress.properties): +``` +# Host name and port of LDAP DIT: +host=ldapvip.net +port=389 + +# Options are openldap or apacheds (default): +ldap.server.type=openldap +``` - Notice the substitution parameters, **@name@**, contained within the above config artifacts. These are used by an Ant config task - to replace values into the actual target artifact using values found inside the source property files. Thus Fortress uses simple Apache Ant - substitution to seed implementation specific variables, e.g. host names, ports, pw's, into its config artifacts used at runtime. +*Note: Files from category C are generated during Fortress build and not checked into source.* ------------------------------------------------------------------------------- ## SECTION 2. Fortress Ant Property Files