├── .gitallowed ├── CONTRIBUTING ├── Jenkinsfile ├── LICENSE ├── README.md ├── appian ├── applications │ └── README.md └── properties │ └── README.md ├── configurePipelineFiles.sh ├── devops ├── README.md ├── adm │ ├── import-manager.prod.properties │ ├── import-manager.stag.properties │ ├── import-manager.test.properties │ ├── version-manager.local.properties │ └── version-manager.properties ├── deploymentmanagement.prod.properties ├── deploymentmanagement.stag.properties ├── deploymentmanagement.test.properties └── f4a │ ├── README.md │ ├── fitnesse-automation.acceptance.properties │ ├── fitnesse-automation.integrate.properties │ ├── test_suites │ ├── QuickStartAcceptanceTest │ │ ├── content.txt │ │ └── properties.xml │ └── QuickStartIntegrationTest │ │ ├── content.txt │ │ └── properties.xml │ └── users.properties ├── docker └── docker-compose.yml └── groovy ├── GitHubUtils.groovy └── JenkinsUtils.groovy /.gitallowed: -------------------------------------------------------------------------------- 1 | \.gitallowed:.* 2 | ^.*REPOPASSWORD.*$ 3 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | By contributing to this Open Source project, you provide Appian Corporation a non-exclusive, perpetual, royalty-free license to use your contribution for any purpose. 2 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | environment { 4 | 5 | SITEBASEURL = null 6 | APIKEY = null 7 | PACKAGEFILENAME = null 8 | initiateInspectionJson = null 9 | deploymentResponseJson = null 10 | response = null 11 | warnings = null 12 | errors = null 13 | DEPLOYMENTNAME = null 14 | DEPLOYMENTDESCRIPTION = null 15 | } 16 | stages { 17 | 18 | 19 | stage("Install AVM and FitNesse for Appian") { 20 | steps { 21 | script { 22 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 23 | 24 | // Retrieve and setup ADM 25 | sh "rm -rf adm f4a" 26 | jenkinsUtils.shNoTrace("curl -H X-JFrog-Art-Api:$ARTIFACTORYAPIKEY -O $ARTIFACTORYURL/appian-devops/adm.zip") 27 | sh "unzip devops/adm.zip -d adm" 28 | sh "unzip adm/appian-adm-versioning-client-2.5.17.zip -d adm/appian-version-client" 29 | jenkinsUtils.setProperty("adm/appian-version-client/metrics.properties", "pipelineUsage", "true") 30 | // Retrieve and setup F4A 31 | jenkinsUtils.shNoTrace("curl -H X-JFrog-Art-Api:$ARTIFACTORYAPIKEY -O $ARTIFACTORYURL/appian-devops/f4a.zip") 32 | sh "unzip f4a.zip -d f4a" 33 | jenkinsUtils.setProperty("f4a/FitNesseForAppian/configs/metrics.properties", "pipeline.usage", "true") 34 | sh "cp -a devops/f4a/test_suites/. f4a/FitNesseForAppian/FitNesseRoot/FitNesseForAppian/Examples/" 35 | sh "cp devops/f4a/users.properties f4a/FitNesseForAppian/configs/users.properties" 36 | 37 | } 38 | } 39 | } 40 | stage("Build Package") { 41 | steps { 42 | script { 43 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 44 | jenkinsUtils.buildPackage("version-manager.properties") 45 | } 46 | } 47 | } 48 | 49 | stage("Inspect Package - Test") { 50 | steps { 51 | script { 52 | def properties = readProperties file: "devops\\deploymentmanagement.test.properties" 53 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 54 | DEPLOYMENTNAME = properties['deploymentName'] 55 | SITEBASEURL = properties['url'] 56 | APIKEY = properties['siteApiKey'] 57 | PACKAGEFILENAME = properties['packageFileName'] 58 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 59 | jenkinsUtils.inspectPackage("${APPLICATIONNAME}.test.properties") 60 | } 61 | } 62 | } 63 | 64 | stage("Create Deployment Request - Test") { 65 | steps { 66 | script { 67 | def properties = readProperties file: "devops\\deploymentmanagement.test.properties" 68 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 69 | DEPLOYMENTNAME = properties['deploymentName'] 70 | SITEBASEURL = properties['url'] 71 | APIKEY = properties['siteApiKey'] 72 | PACKAGEFILENAME = properties['packageFileName'] 73 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 74 | jenkinsUtils.createDeployment("${APPLICATIONNAME}.test.properties") 75 | 76 | 77 | 78 | } 79 | } 80 | } 81 | stage("Check Deployment Status - Test") { 82 | steps { 83 | script { 84 | def properties = readProperties file: "devops\\deploymentmanagement.test.properties" 85 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 86 | DEPLOYMENTNAME = properties['deploymentName'] 87 | SITEBASEURL = properties['url'] 88 | APIKEY = properties['siteApiKey'] 89 | PACKAGEFILENAME = properties['packageFileName'] 90 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 91 | jenkinsUtils.checkDeploymentStatus() 92 | } 93 | } 94 | } 95 | stage("Tag Successful Import into Test") { 96 | steps { 97 | script { 98 | def githubUtils = load "groovy/GitHubUtils.groovy" 99 | githubUtils.tagSuccessfulImport("TEST") 100 | } 101 | } 102 | } 103 | stage("Run Integration Tests") { 104 | steps { 105 | script { 106 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 107 | jenkinsUtils.runTestsDocker("fitnesse-automation.integrate.properties") 108 | } 109 | } 110 | post { 111 | always { 112 | sh script: "docker-compose -f docker/docker-compose.yml down", returnStatus: true 113 | dir("f4a/FitNesseForAppian"){ junit "fitnesse-results.xml" } 114 | } 115 | failure { 116 | script { 117 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 118 | archiveArtifacts artifacts: jenkinsUtils.retrieveLogs("fitnesse-automation.integrate.properties"), fingerprint: true 119 | } 120 | } 121 | } 122 | } 123 | stage("Inspect Package - Stag") { 124 | steps { 125 | script { 126 | def properties = readProperties file: "devops\\deploymentmanagement.stag.properties" 127 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 128 | DEPLOYMENTNAME = properties['deploymentName'] 129 | SITEBASEURL = properties['url'] 130 | APIKEY = properties['siteApiKey'] 131 | PACKAGEFILENAME = properties['packageFileName'] 132 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 133 | jenkinsUtils.inspectPackage("${APPLICATIONNAME}.stag.properties") 134 | } 135 | } 136 | } 137 | 138 | stage("Create Deployment Request - Stag") { 139 | steps { 140 | script { 141 | def properties = readProperties file: "devops\\deploymentmanagement.stag.properties" 142 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 143 | DEPLOYMENTNAME = properties['deploymentName'] 144 | SITEBASEURL = properties['url'] 145 | APIKEY = properties['siteApiKey'] 146 | PACKAGEFILENAME = properties['packageFileName'] 147 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 148 | jenkinsUtils.createDeployment("${APPLICATIONNAME}.stag.properties") 149 | 150 | 151 | 152 | } 153 | } 154 | } 155 | stage("Check Deployment Status - Stag") { 156 | steps { 157 | script { 158 | def properties = readProperties file: "devops\\deploymentmanagement.stag.properties" 159 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 160 | DEPLOYMENTNAME = properties['deploymentName'] 161 | SITEBASEURL = properties['url'] 162 | APIKEY = properties['siteApiKey'] 163 | PACKAGEFILENAME = properties['packageFileName'] 164 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 165 | jenkinsUtils.checkDeploymentStatus() 166 | } 167 | } 168 | } 169 | stage("Tag Successful Import into Stag") { 170 | steps { 171 | script { 172 | def githubUtils = load "groovy/GitHubUtils.groovy" 173 | githubUtils.tagSuccessfulImport("STAG") 174 | } 175 | } 176 | } 177 | stage("Run Acceptance Tests") { 178 | steps { 179 | script { 180 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 181 | jenkinsUtils.runTestsDocker("fitnesse-automation.acceptance.properties") 182 | } 183 | } 184 | post { 185 | always { 186 | sh script: "docker-compose -f docker/docker-compose.yml down", returnStatus: true 187 | dir("f4a/FitNesseForAppian"){ junit "fitnesse-results.xml" } 188 | } 189 | failure { 190 | script { 191 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 192 | archiveArtifacts artifacts: jenkinsUtils.retrieveLogs("fitnesse-automation.acceptance.properties"), fingerprint: true 193 | } 194 | } 195 | } 196 | } 197 | stage("Create Application Release") { 198 | steps { 199 | script { 200 | def githubUtils = load "groovy/GitHubUtils.groovy" 201 | githubUtils.releaseApplication("RELEASE", "${APPLICATIONNAME}.properties") 202 | } 203 | } 204 | } 205 | stage("Promotion Decision") { 206 | steps { 207 | input "Deploy to Production?" 208 | } 209 | } 210 | stage("Inspect Package - Prod") { 211 | steps { 212 | script { 213 | def properties = readProperties file: "devops\\deploymentmanagement.prod.properties" 214 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 215 | DEPLOYMENTNAME = properties['deploymentName'] 216 | SITEBASEURL = properties['url'] 217 | APIKEY = properties['siteApiKey'] 218 | PACKAGEFILENAME = properties['packageFileName'] 219 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 220 | jenkinsUtils.inspectPackage("${APPLICATIONNAME}.prod.properties") 221 | } 222 | } 223 | } 224 | 225 | stage("Create Deployment Request - Prod") { 226 | steps { 227 | script { 228 | def properties = readProperties file: "devops\\deploymentmanagement.prod.properties" 229 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 230 | DEPLOYMENTNAME = properties['deploymentName'] 231 | SITEBASEURL = properties['url'] 232 | APIKEY = properties['siteApiKey'] 233 | PACKAGEFILENAME = properties['packageFileName'] 234 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 235 | jenkinsUtils.createDeployment("${APPLICATIONNAME}.prod.properties") 236 | 237 | 238 | 239 | } 240 | } 241 | } 242 | stage("Check Deployment Status - Prod") { 243 | steps { 244 | script { 245 | def properties = readProperties file: "devops\\deploymentmanagement.prod.properties" 246 | DEPLOYMENTDESCRIPTION = properties['deploymentDescription'] 247 | DEPLOYMENTNAME = properties['deploymentName'] 248 | SITEBASEURL = properties['url'] 249 | APIKEY = properties['siteApiKey'] 250 | PACKAGEFILENAME = properties['packageFileName'] 251 | def jenkinsUtils = load "groovy/JenkinsUtils.groovy" 252 | jenkinsUtils.checkDeploymentStatus() 253 | } 254 | } 255 | } 256 | stage("Tag Successful Import into Prod") { 257 | steps { 258 | script { 259 | def githubUtils = load "groovy/GitHubUtils.groovy" 260 | githubUtils.tagSuccessfulImport("PROD") 261 | } 262 | } 263 | } 264 | } 265 | } 266 | 267 | 268 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Appian DevOps Quick Start - Overview 2 | 3 | This repository is intended to serve as a model for Appian developers looking to construct a CI/CD pipeline in order to version and test their applications. It contains all configuration files required for setting up a fully functioning pipeline using the out-of-the-box [Automated Deployment Manager](https://community.appian.com/w/the-appian-playbook/198/deployment-automation) and [FitNesse For Appian](https://community.appian.com/w/the-appian-playbook/97/automated-testing-with-fitnesse-for-appian), as well as an example pipeline, Jenkinsfile. While the Jenkinsfile is intended to be run in the CI/CD tool, Jenkins, the same structure can be used to setup a pipeline in other CI/CD tools, such as GitLab. 4 | 5 | Repository Components: 6 | 7 | ## Jenkinsfile 8 | 9 | A sample pipeline for use in Jenkins, or as a model for other CI/CD tools. 10 | 11 | ## appian 12 | 13 | This folder is the outermost folder to house all Appian applications and their corresponding custom properties. 14 | 15 | All Appian applications are located in appian/applications. View this [README.md](appian/applications/README.md) for more information. 16 | 17 | All corresponding custom properties files are located in appian/properties. View this [README.md](appian/properties/README.md) for more information. 18 | 19 | ## devops 20 | 21 | This folder houses all configuration properties for both the Automated Deployment Manager (adm) and FitNesse for Appian (f4a), as well as the custom test suites for f4a. For more information about this folder, view this [README.md](devops/README.md). 22 | 23 | All property files relevant for the ADM are located in devops/adm. This folder includes the properties files for the Automated Import Manager for each environment included in the pipeline, as well as the property files for the Automated Versioning Manager for both local developement and pipeline usage. 24 | 25 | All property files and test_suites relevant for F4A are located in devops/f4m. This folder contains the properties files for FitNesse For Appian in both staging and test environments. In addition, this folder also contains test_suites folder, which houses all of the test suites for FitNesse For Appian. More information about the test_suites folder can be found in this [README.md](devops/f4a/README.md). 26 | -------------------------------------------------------------------------------- /appian/applications/README.md: -------------------------------------------------------------------------------- 1 | # Appian DevOps Quick Start - Applications 2 | 3 | The Appian DevOps Quick Start is designed to be organized in single or groups of non-shared applications. There should be only one folder for every application or group of applications that are intended to function as one single application. 4 | 5 | The applications within the group should not be shared across other applications. In the case of shared applications, they should have their own folder and should not be apart of another application's folder. 6 | -------------------------------------------------------------------------------- /appian/properties/README.md: -------------------------------------------------------------------------------- 1 | # Appian DevOps Quick Start - Application Customization Files 2 | 3 | Any customization files generated for Appian applictions should be contained here. 4 | 5 | Within the folder , there should be 4 files: 6 | 7 | .properties 8 | 9 | .prod.properties 10 | 11 | .stag.properties 12 | 13 | .test.properties 14 | 15 | The .properties file should be the commented-out file obtained on application export. The environment files should have appropriate values. 16 | 17 | **Example**: 18 | 19 | * appian/properties 20 | * HelloAppianWorld 21 | * HelloAppianWorld.prod.properties 22 | * HelloAppianWorld.stag.properties 23 | * HelloAppianWorld.test.properties 24 | * HelloAppianWorld.properties 25 | -------------------------------------------------------------------------------- /configurePipelineFiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR=`dirname $0` 4 | 5 | # Colors and styling for the command line 6 | DIM='\033[2m' 7 | BOLD='\033[1m' 8 | GREEN='\033[0;32m' 9 | RED='\033[0;31m' 10 | WHITE='\033[1;37m' 11 | CHECK='\xE2\x9C\x94' 12 | BLACK_ON_GREY='\033[30;47m' 13 | RESET='\033[0m' 14 | 15 | WELCOME_MSG=" 16 | This is an Appian-provided macOS command line tool that will help configure a sample pipeline for use" 17 | 18 | ADM_MSG=" 19 | ┌------------------- ADM Configuration ---------------------┐ 20 | | Let's configure the ADM tools for use (AIM and AVM). | 21 | | In addition to the configurations that are being set | 22 | | up, you'll need to version an application using the | 23 | | AVM client to the appian/applications folder in the | 24 | | current repo for the pipeline to be fully functional | 25 | └-----------------------------------------------------------┘ 26 | " 27 | 28 | FITNESSE_MSG=" 29 | ┌------------------- FitNesse Configuration ----------------┐ 30 | | Let's configure the FitNesse properties and tests. | 31 | | Before executing the pipeline, ensure that all the | 32 | | sites specified here are up and running. Also ensure | 33 | | that the user/password pair you'll configure here have | 34 | | access to these sites. | 35 | └-----------------------------------------------------------┘ 36 | " 37 | 38 | Integration_stage=" 39 | ┌-----------------------------------------------------------┐ 40 | | INTEGRATION TEST CONFIGURATION | 41 | └-----------------------------------------------------------┘ 42 | " 43 | 44 | Acceptance_stage=" 45 | ┌-----------------------------------------------------------┐ 46 | | ACCEPTANCE TEST CONFIGURATION | 47 | └-----------------------------------------------------------┘ 48 | " 49 | 50 | main() { 51 | setup_window 52 | 53 | echo -e "\\n${BOLD}${ADM_MSG}${RESET}\\n" 54 | import_manager_prompts 55 | version_manager_prompts 56 | echo -e "\\n${BOLD}${FITNESSE_MSG}${RESET}" 57 | fitnesse_prompts 58 | goodbye_message 59 | echo -e "\\n" 60 | exit 0; 61 | } 62 | 63 | # Print ASCII art 64 | base64_print() { 65 | printf "%s" "$@" | base64 --decode 66 | } 67 | 68 | setup_window() { 69 | # Resize the window and clear the screen 70 | printf '\e[8;50;125t'; printf "\\033c" 71 | # some ascii art 72 | printf "\\e[38;5;196m"; base64_print CiAgICAgICAgICAgICAgICAgICAgICAgXyAgICAgICAgICAgICAgIF9fX19fICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgIC9cICAgICAgICAgICAgICAgKF8pICAgICAgICAgICAgIHwgIF9fIFwgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgIC8gIFwgICBfIF9fICBfIF9fICBfICBfXyBfIF8gX18gICB8IHwgIHwgfCBfX19fXyAgIF9fX19fICBfIF9fICBfX18gCiAgIC8gL1wgXCB8ICdfIFx8ICdfIFx8IHwvIF9gIHwgJ18gXCAgfCB8ICB8IHwvIF8gXCBcIC8gLyBfIFx8ICdfIFwvIF9ffAogIC8gX19fXyBcfCB8XykgfCB8XykgfCB8IChffCB8IHwgfCB8IHwgfF9ffCB8ICBfXy9cIFYgLyAoXykgfCB8XykgXF9fIFwKIC9fLyAgICBcX1wgLl9fL3wgLl9fL3xffFxfXyxffF98IHxffCB8X19fX18vIFxfX198IFxfLyBcX19fL3wgLl9fL3xfX18vCiAgICAgICAgICB8IHwgICB8IHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IHwgICAgICAgIAogICAgICAgICAgfF98ICAgfF98ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF98ICAgICAgICAK 73 | printf "\\e[38;5;27m"; base64_print CiAgICBfX18gXyAgICAgICAgICAgIF8gXyAgICAgICAgICAgICAgX19fX18gICAgICAgICAgICBfIAogICAvIF8gKF8pXyBfXyAgIF9fX3wgKF8pXyBfXyAgIF9fXyAgL19fICAgXF9fXyAgIF9fXyB8IHwKICAvIC9fKS8gfCAnXyBcIC8gXyBcIHwgfCAnXyBcIC8gXyBcICAgLyAvXC8gXyBcIC8gXyBcfCB8CiAvIF9fXy98IHwgfF8pIHwgIF9fLyB8IHwgfCB8IHwgIF9fLyAgLyAvIHwgKF8pIHwgKF8pIHwgfAogXC8gICAgfF98IC5fXy8gXF9fX3xffF98X3wgfF98XF9fX3wgIFwvICAgXF9fXy8gXF9fXy98X3wKICAgICAgICAgfF98ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCg== 74 | printf "\\e[0m"; printf '\n' 75 | echo -e "${BOLD}${WELCOME_MSG}${RESET}\\n" 76 | } 77 | 78 | import_manager_prompts() { 79 | local test_import_properties=$CURRENT_DIR/devops/adm/import-manager.test.properties 80 | local stag_import_properties=$CURRENT_DIR/devops/adm/import-manager.stag.properties 81 | local prod_import_properties=$CURRENT_DIR/devops/adm/import-manager.prod.properties 82 | 83 | # Read in the URL's of all the environments and modify the import manager properties files if input is non-empty 84 | read -p "$(echo -e $WHITE)Enter URL of your test environment:$(echo -e $RESET) " TEST_URL 85 | echo -e "\\n${BLACK_ON_GREY}Modified $test_import_properties with the given url${RESET}\\n" 86 | if [[ $TEST_URL ]]; then 87 | TEST_URL=$(parse_URL $TEST_URL) 88 | sed-populate-field "url" "$TEST_URL" $test_import_properties 89 | fi 90 | read -p "$(echo -e $WHITE)Enter URL of your staging environment:$(echo -e $RESET) " STAG_URL 91 | echo -e "\\n${BLACK_ON_GREY}Modified $stag_import_properties with the given url${RESET}\\n" 92 | if [[ $STAG_URL ]]; then 93 | STAG_URL=$(parse_URL $STAG_URL) 94 | sed-populate-field "url" "$STAG_URL" $stag_import_properties 95 | fi 96 | read -p "$(echo -e $WHITE)Enter URL of your production environment:$(echo -e $RESET) " PROD_URL 97 | echo -e "\\n${BLACK_ON_GREY}Modified $prod_import_properties with the given url${RESET}\\n" 98 | if [[ $PROD_URL ]]; then 99 | PROD_URL=$(parse_URL $PROD_URL) 100 | sed-populate-field "url" "$PROD_URL" $prod_import_properties 101 | fi 102 | } 103 | 104 | version_manager_prompts() { 105 | local version_manager_properties=$CURRENT_DIR/devops/adm/version-manager.properties 106 | 107 | echo -e "\\n${BLACK_ON_GREY}Modifying $version_manager_properties with the following prompt${RESET}\\n" 108 | read -p "$(echo -e $WHITE)Enter your repo URL (repo where you want to version your applications):$(echo -e $RESET) " REPO_URL 109 | 110 | # Configure version manager properties file with the given input (only if non-empty) 111 | if [[ $REPO_URL ]]; then 112 | sed-populate-field "repoUrl" "$REPO_URL" $version_manager_properties 113 | fi 114 | } 115 | 116 | fitnesse_prompts() { 117 | local users_properties=$CURRENT_DIR/devops/f4a/users.properties 118 | local acceptance_test=$CURRENT_DIR/devops/f4a/test_suites/QuickStartAcceptanceTest/content.txt 119 | local integration_test=$CURRENT_DIR/devops/f4a/test_suites/QuickStartIntegrationTest/content.txt 120 | 121 | # Two prompts. One for Integration test configuration and one for Acceptance test configuration 122 | for i in 1 2; do 123 | if [ $i -eq 1 ]; then 124 | current_test=$integration_test 125 | in_echoes="Integration" 126 | stage_msg="${Integration_stage}" 127 | modification_msg="Modified $integration_test with the given configurations" 128 | TST_SITE_URL=$TEST_URL 129 | else 130 | current_test=$acceptance_test 131 | in_echoes="Acceptance" 132 | stage_msg="${Acceptance_stage}" 133 | modification_msg="Modified $acceptance_test with the given configurations" 134 | TST_SITE_URL=$STAG_URL 135 | fi 136 | echo -e "${BOLD}${stage_msg}${RESET}\\n" 137 | read -p "$(echo -e $RED)Press enter to edit the ${in_echoes} Test:$(echo -e $RESET) " 138 | cat $current_test 139 | 140 | echo -e "${WHITE}We support running the test suites on one of these browser options\\n 141 | 1. CHROME\\n 142 | 2. FIREFOX\\n 143 | 3. REMOTE_CHROME\\n 144 | 4. REMOTE_FIREFOX\\n${RESET}" 145 | 146 | # Continously prompt user until they select an option between 1-4 147 | while true; do 148 | read -p "$(echo -e $WHITE)Select desired browser number (1-4):$(echo -e $RESET) " TST_BROWSER 149 | case $TST_BROWSER in 150 | 1) 151 | TST_BROWSER="CHROME" 152 | break 153 | ;; 154 | 2) 155 | TST_BROWSER="FIREFOX" 156 | break 157 | ;; 158 | 3) 159 | TST_BROWSER="REMOTE_CHROME" 160 | break 161 | ;; 162 | 4) 163 | TST_BROWSER="REMOTE_FIREFOX" 164 | break 165 | ;; 166 | esac 167 | done 168 | 169 | read -p "$(echo -e $WHITE)Enter the url for the Appian site you want to test (Press Enter if you want $TST_SITE_URL):$(echo -e $RESET) " USER_SITE_INPUT 170 | # If an actual input is provided use this new input 171 | if [[ $USER_SITE_INPUT ]]; then 172 | TST_SITE_URL=$(parse_URL $USER_SITE_INPUT) 173 | else # Enter was pressed so use the previously provided test site URL from the import manager configuration 174 | TST_SITE_URL=$TST_SITE_URL 175 | fi 176 | read -p "$(echo -e $WHITE)Enter the version of this Appian site (e.g 18.4):$(echo -e $RESET) " TST_SITE_VERSION 177 | read -p "$(echo -e $WHITE)Enter the locale of this Appian site (en_US or en_GB):$(echo -e $RESET) " TST_SITE_LOCALE 178 | read -p "$(echo -e $WHITE)Enter the username for this Appian site:$(echo -e $RESET) " TST_SITE_USR 179 | 180 | # Check if the specified user already has an entry in the users.properties file 181 | if grep -Fq "$TST_SITE_USR=" $users_properties; then 182 | : # Do nothing if user has entry in the users.properties file 183 | else # User isn't defined in users.properties so add this user/password pair to the file 184 | read -s -p "$(echo -e $WHITE)Enter the password for this user:$(echo -e $RESET) " TST_USR_PASSWORD 185 | echo $TST_SITE_USR=$TST_USR_PASSWORD >> $users_properties 186 | fi 187 | 188 | # Only update the files if the input isn't empty 189 | if [[ $TST_SITE_USR ]]; then 190 | sed-replace-in-FitNesse "APPIAN_USERNAME" $TST_SITE_USR $current_test 191 | fi 192 | if [[ $TST_BROWSER ]]; then 193 | sed-replace-in-FitNesse "BROWSER" $TST_BROWSER $current_test 194 | fi 195 | if [[ $TST_SITE_URL ]]; then 196 | TST_SITE_URL=$(parse_URL $TST_SITE_URL) 197 | sed-replace-in-FitNesse "APPIAN_URL" $TST_SITE_URL $current_test 198 | fi 199 | if [[ $TST_SITE_VERSION ]]; then 200 | sed-replace-in-FitNesse "APPIAN_VERSION" $TST_SITE_VERSION $current_test 201 | fi 202 | if [[ $TST_SITE_LOCALE ]]; then 203 | sed-replace-in-FitNesse "APPIAN_LOCALE" $TST_SITE_LOCALE $current_test 204 | fi 205 | 206 | echo -e "\\n\\n${BLACK_ON_GREY}$modification_msg${RESET}" 207 | echo -e "\\n${GREEN}This is what your FitNesse ${in_echoes} test configuration looks like now${RESET}\\n" 208 | cat $current_test 209 | done 210 | } 211 | 212 | sed-populate-field() { 213 | sed -i '' "s|$1=.*|$1=$2|" $3 214 | # If the field is commented 215 | sed -i '' "s|#$1=.*|$1=$2|" $3 216 | } 217 | 218 | sed-replace() { 219 | sed -i '' "s#$1#$2#" $3 220 | } 221 | 222 | sed-replace-in-FitNesse() { 223 | case "$1" in 224 | "BROWSER") 225 | sed-replace "|setup with |.*" "|setup with |$2|browser|" $3 226 | ;; 227 | "APPIAN_URL") 228 | sed-replace "|set appian url to |.*" "|set appian url to |$2|" $3 229 | ;; 230 | 231 | "APPIAN_VERSION") 232 | sed-replace "|set appian version to|.*" "|set appian version to|$2|" $3 233 | ;; 234 | 235 | "APPIAN_LOCALE") 236 | sed-replace "|set appian locale to |.*" "|set appian locale to |$2|" $3 237 | ;; 238 | 239 | "APPIAN_USERNAME") 240 | sed-replace "|login with username |.*" "|login with username |$2|" $3 241 | ;; 242 | *) 243 | echo $"INVALID USAGE" 244 | exit 1 245 | esac 246 | } 247 | 248 | parse_URL() { 249 | local TST=$1 250 | # If URL already ends with /suite or /suite followed by something else then just replace it all with /suite 251 | if [[ $1 == */suite* ]]; then 252 | TST=${TST/suite*/suite} 253 | else 254 | # If URL doesn't end with /suite but ends with a /, append a suite at the end 255 | if [[ ${TST: -1} == / ]]; then 256 | TST="${TST}suite" 257 | else 258 | # If URL doesn't end with /, then append a /suite at the end 259 | TST="${TST}/suite" 260 | fi 261 | fi 262 | # Final parsed URL should be https:///suite 263 | echo $TST 264 | } 265 | 266 | goodbye_message() { 267 | printf "\\e[38;5;196m"; base64_print ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLgogICAgICAgICAgICAgIC4gLiAgICAgICAgICAgICAgICAgICAgIC06LSAgICAgICAgICAgICAuICAuICAuCiAgICAgICAgICAgIC4nLjosJy4gICAgICAgIC4gIC4gIC4gICAgICcgLiAgICAgICAgICAgLiBcIHwgLyAuCiAgICAgICAgICAgIC4nLjsuYC4gICAgICAgLl8uICEgLl8uICAgICAgIFwgICAgICAgICAgLl9fXDovX18uCiAgICAgICAgICAgICBgLDouJyAgICAgICAgIC5fXCEvXy4gICAgICAgICAgICAgICAgICAgICAuJztgLiAgICAgIC4gJyAuCiAgICAgICAgICAgICAsJyAgICAgICAgICAgICAuICEgLiAgICAgICAgLC4sICAgICAgLi49PT09PT0uLiAgICAgICAuOi4KICAgICAgICAgICAgLCAgICAgICAgICAgICAgICAgLiAgICAgICAgIC5fIV8uICAgICB8fDo6OiA6IHwgLiAgICAgICAgJywKICAgICAuPT09PS4sICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgOyAgLn4uPT09OiA6IDogOnwgICAuLj09PS4KICAgICB8Ljo6J3x8ICAgICAgLj09PT09LiwgICAgLi49PT09PT09Ln4sICAgfCJ8OiA6fDo6Ojo6OnwgICB8fDo6Onw9PT09PXwKICBfX198IDo6OnwhX18uLCAgfDo6Ojo6fCFfLCAgIHw6IDo6IDo6fCJ8bF9sfCJ8OjogfDo7Ozo6OnxfX18hfCA6Onw6IDogOnwKIHw6IDp8Ojo6IHw6OiB8IV9ffDsgOjogfDogfD09PTo6OiA6OiA6fCJ8fF98fCJ8IDogfDogOjogOnw6IDogfDo6IHw6Ojo6OnwKIHw6Ojp8IF86Onw6IDp8Ojo6fDo9PT06fDo6fDo6Onw6PT09Rj06fCIhL3xcISJ8OjpGfDo9PT09Onw6Ol86fDogOnw6Ol9fOnwKICFfW10hW19dXyFfW10hW11fIV9bX19dIVtdIVtfXSFbX11bSV9dIS8vXzpfXFwhW11JIVtfXVtfXSFfW19dIVtdXyFfW19fXSEKIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIi0tLScnJydgYGAtLS0iLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIF8gXyBfIF8gXyBfIF8gXyBfIF8gXyBfIF8gXyBfIF8gXyBfIHw9IF8gXzpfIF8gPXwgXyBfIF8gXyBfIF8gXyBfIF8gXyBfIF8KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHw9ICAgIDogICAgPXwgICAgICAgICAgICAgICAgU3VjY2VzcyEKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX0xfX19fX19fX19fX0pfX19fX19fX19fX19fX19fX19fX19fX18KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0= 268 | printf "\\n\\n${GREEN}"; base64_print ICAgIFlvdSBoYXZlIHN1Y2Nlc3NmdWxseSBzZXQgdXAgYWxsIHlvdXIgY29uZmlndXJhdGlvbiBmaWxlcyEKICAgICAgICAgICBZb3VyIHBpcGVsaW5lIGlzIHJlYWR5IHRvIGJlIGtpY2tlZCBvZmYhIAo= 269 | printf "${RESET}" 270 | } 271 | 272 | # Starting point of the script. Redirect to main function 273 | if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then 274 | main "$@" 275 | fi 276 | -------------------------------------------------------------------------------- /devops/README.md: -------------------------------------------------------------------------------- 1 | # Appian DevOps Quick Start - DevOps Setup 2 | 3 | This folder contains the configuration properties for the Automated Deployment Manager (ADM) and FitNesse For Appian (F4A). Within each folder are the respective property files needed for the Quick Start pipeline. In addition, the F4A folder also contains the whole set of customer test_suites needed to run the appropriate FitNesse tests. 4 | -------------------------------------------------------------------------------- /devops/adm/import-manager.prod.properties: -------------------------------------------------------------------------------- 1 | ## All parameters can be set here or passed in as command-line arguments 2 | 3 | ### Environment-specific properties 4 | 5 | ## REQUIRED. Username of the Appian user account 6 | #username= 7 | 8 | ## REQUIRED. Password of the Appian user account 9 | #password= 10 | 11 | ## REQUIRED. URL of the environment 12 | url=https:///suite 13 | 14 | ## Optional. URL of the proxy to use to connect to Appian 15 | #proxyUrl= 16 | 17 | ## Optional. Port of the proxy server to use to connect to Appian. This parameter is only used if the parameter proxyUrl is defined. The default value is 8080. 18 | #proxyPort= 19 | 20 | 21 | 22 | ### Import-specific properties 23 | 24 | ## Path for the application ZIP file to import 25 | #applicationPath=C:\\Users\\acme.corp\\Documents\\application.zip 26 | 27 | ## UUID of the application to which patch contents will be added 28 | #uuid= 29 | 30 | ## List of comma-separated paths for the DDL files to execute 31 | #ddlPath=C:\\Users\\acme.corp\\Documents\\script1.sql,C:\\Users\\acme.corp\\Documents\\script2.sql 32 | 33 | ## List of comma-separated paths for the directories to execute DB migrations via Flyway 34 | #flywayPath=C:\\Users\\acme.corp\\Documents\\db\\migration1,C:\\Users\\acme.corp\\Documents\\db\\migration2 35 | 36 | ## List of comma-separated datasources associated with the provided DDL files. Required if using ddlPath or flywayPath. 37 | #ddlDs=jdbc/businessds1,jdbc/businessds2 38 | 39 | ## Indicates the path to the import customization file 40 | #importCustomizationPath= 41 | 42 | ## Path for the admin console ZIP file to import 43 | #adminConsolePath=C:\\Users\\acme.corp\\Documents\\adminConsoleSettings.zip 44 | 45 | ## Optional. A boolean flag to indicate that the package should not be imported but inspected only 46 | #inspectOnly=false 47 | 48 | ## Optional. A boolean flag which specifies whether or not the import ignores impact analysis results. If true, the import will occur even if objects with CDT references are missing. 49 | #forceImport=false 50 | -------------------------------------------------------------------------------- /devops/adm/import-manager.stag.properties: -------------------------------------------------------------------------------- 1 | ## All parameters can be set here or passed in as command-line arguments 2 | 3 | ### Environment-specific properties 4 | 5 | ## REQUIRED. Username of the Appian user account 6 | #username= 7 | 8 | ## REQUIRED. Password of the Appian user account 9 | #password= 10 | 11 | ## REQUIRED. URL of the environment 12 | url=https:///suite 13 | 14 | ## Optional. URL of the proxy to use to connect to Appian 15 | #proxyUrl= 16 | 17 | ## Optional. Port of the proxy server to use to connect to Appian. This parameter is only used if the parameter proxyUrl is defined. The default value is 8080. 18 | #proxyPort= 19 | 20 | 21 | 22 | ### Import-specific properties 23 | 24 | ## Path for the application ZIP file to import 25 | #applicationPath=C:\\Users\\acme.corp\\Documents\\application.zip 26 | 27 | ## UUID of the application to which patch contents will be added 28 | #uuid= 29 | 30 | ## List of comma-separated paths for the DDL files to execute 31 | #ddlPath=C:\\Users\\acme.corp\\Documents\\script1.sql,C:\\Users\\acme.corp\\Documents\\script2.sql 32 | 33 | ## List of comma-separated paths for the directories to execute DB migrations via Flyway 34 | #flywayPath=C:\\Users\\acme.corp\\Documents\\db\\migration1,C:\\Users\\acme.corp\\Documents\\db\\migration2 35 | 36 | ## List of comma-separated datasources associated with the provided DDL files. Required if using ddlPath or flywayPath. 37 | #ddlDs=jdbc/businessds1,jdbc/businessds2 38 | 39 | ## Indicates the path to the import customization file 40 | #importCustomizationPath= 41 | 42 | ## Path for the admin console ZIP file to import 43 | #adminConsolePath=C:\\Users\\acme.corp\\Documents\\adminConsoleSettings.zip 44 | 45 | ## Optional. A boolean flag to indicate that the package should not be imported but inspected only 46 | #inspectOnly=false 47 | 48 | ## Optional. A boolean flag which specifies whether or not the import ignores impact analysis results. If true, the import will occur even if objects with CDT references are missing. 49 | #forceImport=false 50 | -------------------------------------------------------------------------------- /devops/adm/import-manager.test.properties: -------------------------------------------------------------------------------- 1 | ## All parameters can be set here or passed in as command-line arguments 2 | 3 | ### Environment-specific properties 4 | 5 | ## REQUIRED. Username of the Appian user account 6 | #username= 7 | 8 | ## REQUIRED. Password of the Appian user account 9 | #password= 10 | 11 | ## REQUIRED. URL of the environment 12 | url=https:///suite 13 | 14 | ## Optional. URL of the proxy to use to connect to Appian 15 | #proxyUrl= 16 | 17 | ## Optional. Port of the proxy server to use to connect to Appian. This parameter is only used if the parameter proxyUrl is defined. The default value is 8080. 18 | #proxyPort= 19 | 20 | 21 | 22 | ### Import-specific properties 23 | 24 | ## Path for the application ZIP file to import 25 | #applicationPath=C:\\Users\\acme.corp\\Documents\\application.zip 26 | 27 | ## UUID of the application to which patch contents will be added 28 | #uuid= 29 | 30 | ## List of comma-separated paths for the DDL files to execute 31 | #ddlPath=C:\\Users\\acme.corp\\Documents\\script1.sql,C:\\Users\\acme.corp\\Documents\\script2.sql 32 | 33 | ## List of comma-separated paths for the directories to execute DB migrations via Flyway 34 | #flywayPath=C:\\Users\\acme.corp\\Documents\\db\\migration1,C:\\Users\\acme.corp\\Documents\\db\\migration2 35 | 36 | ## List of comma-separated datasources associated with the provided DDL files. Required if using ddlPath or flywayPath. 37 | #ddlDs=jdbc/businessds1,jdbc/businessds2 38 | 39 | ## Indicates the path to the import customization file 40 | #importCustomizationPath= 41 | 42 | ## Path for the admin console ZIP file to import 43 | #adminConsolePath=C:\\Users\\acme.corp\\Documents\\adminConsoleSettings.zip 44 | 45 | ## Optional. A boolean flag to indicate that the package should not be imported but inspected only 46 | #inspectOnly=false 47 | 48 | ## Optional. A boolean flag which specifies whether or not the import ignores impact analysis results. If true, the import will occur even if objects with CDT references are missing. 49 | #forceImport=false 50 | -------------------------------------------------------------------------------- /devops/adm/version-manager.local.properties: -------------------------------------------------------------------------------- 1 | ## All parameters can be set here or passed in as command-line arguments 2 | 3 | ### Environment-specific properties 4 | 5 | ## REQUIRED. Type of repository (GIT or SVN). SVN functionality is deprecated. 6 | versionControlType=GIT 7 | 8 | ## REQUIRED. Username of the version control account 9 | vcUsername= 10 | 11 | ## REQUIRED. Password of the version control account 12 | vcPassword= 13 | 14 | ## REQUIRED. URL to access the remote repository 15 | repoUrl= 16 | 17 | ## REQUIRED. Path to the folder containing the local repository 18 | localRepoPath= 19 | 20 | ## Branch name of the repository to check out and commit to. Default is master. 21 | #branchName=branch123 22 | 23 | ## Path to the folder containing the Appian objects in the repository. This path is relative to the path of the local repository. If not specified, the Appian objects are checked out to and commited from the root of the local repository path. 24 | ## Assure that the path does not contain any preceding or trailing forward slashes. Example: appian/applications/Hello_World 25 | appianObjectsRepoPath=appian/applications/ 26 | 27 | 28 | 29 | ### Action-specific properties 30 | 31 | ## REQUIRED. Valid choices are addContents, buildAllApps, buildSingleApp, or updateLocalRepo 32 | action=addContents 33 | 34 | ## Message that will be associated with the commit. Used for the addContents action. If no message is specified, the default message is "Committed by @username" 35 | #commitMessage= 36 | 37 | ## Path for the application ZIP file to add to version control. Used for the addContents action. 38 | applicationPath=C:\\Users\\acme.corp\\Documents\\application.zip 39 | 40 | ## UUID of the Appian application 41 | ## Used for addContents action. Indicates the app to which the contents of the Appian patch will be added. This does not need to be set for a package containing multiple patches. 42 | ## Used for the buildAllApps, buildSingleApp, and buildMultipleApps actions. Indicates the app(s) to be extracted from the repository. 43 | #uuid= 44 | 45 | ## Name of the Appian application 46 | ## Used for addContents action. Indicates the app to which the contents of the Appian patch will be added. This does not need to be set for a package containing multiple patches. 47 | ## Used for the buildAllApps, buildSingleApp, and buildMultipleApps actions. Indicates the app(s) to be extracted from the repository. 48 | #application_name= 49 | 50 | ## List of comma-separated paths for the DDL files to execute. Used for the addContents action. 51 | #ddlPath=C:\\Users\\acme.corp\\Documents\\script1.sql,C:\\Users\\acme.corp\\Documents\\script2.sql 52 | 53 | ## List of comma-separated paths for the directories to execute DB migrations via Flyway. Used for the addContents action. 54 | #flywayPath=C:\\Users\\acme.corp\\Documents\\db\\migration1,C:\\Users\\acme.corp\\Documents\\db\\migration2 55 | 56 | ## List of comma-separated datasources associated with the provided DDL files. Used for the addContents action. Required if using ddlPath or flywayPath. 57 | #ddlDs=jdbc/businessds1,jdbc/businessds2 58 | 59 | ## Path for the admin console ZIP file to add to version control. Used for the addContents action. 60 | #adminConsolePath=C:\\Users\\acme.corp\\Documents\\adminConsoleSettings.zip 61 | 62 | ## REQUIRED for the buildAllApps and buildSingleApp actions. Path and name of the generated package ZIP file. 63 | #packagePath=C:\\Users\\acme.corp\\Documents\\package.zip 64 | 65 | ## Start hash of the commit you want to start building the package. If not populated, everything in the local repository will be included up to the end commit (if specified). Used for the buildAllApps and buildSingleApp actions. 66 | #startHash= 67 | 68 | ## End hash of the commit you want to start building the package. If not populated, will get all files to the latest commit. Used for the buildAllApps and buildSingleApp actions. 69 | #endHash= 70 | 71 | ## Optional. A boolean flag to skip repository update and checkout. Used for the buildAllApps and buildSingleApp actions. 72 | #noUpdate=true -------------------------------------------------------------------------------- /devops/adm/version-manager.properties: -------------------------------------------------------------------------------- 1 | ## All parameters can be set here or passed in as command-line arguments 2 | 3 | ### Environment-specific properties 4 | 5 | ## REQUIRED. Type of repository (GIT or SVN). SVN functionality is deprecated. 6 | versionControlType= 7 | 8 | ## REQUIRED. Username of the version control account 9 | #vcUsername= 10 | 11 | ## REQUIRED. Password of the version control account 12 | #vcPassword= 13 | 14 | ## REQUIRED. URL to access the remote repository 15 | repoUrl= 16 | 17 | ## REQUIRED. Path to the folder containing the local repository 18 | #localRepoPath= 19 | 20 | ## Branch name of the repository to check out and commit to. Default is master. 21 | branchName=main 22 | 23 | ## Path to the folder containing the Appian objects in the repository. This path is relative to the path of the local repository. If not specified, the Appian objects are checked out to and commited from the root of the local repository path. 24 | #appianObjectsRepoPath= 25 | 26 | 27 | 28 | ### Action-specific properties 29 | 30 | ## REQUIRED. Valid choices are addContents, buildAllApps, buildSingleApp, or updateLocalRepo 31 | action=buildPackage 32 | 33 | ## Message that will be associated with the commit. Used for the addContents action. If no message is specified, the default message is "Committed by @username" 34 | #commitMessage= 35 | 36 | ## Path for the application ZIP file to add to version control. Used for the addContents action. 37 | #applicationPath=C:\\Users\\acme.corp\\Documents\\application.zip 38 | 39 | ## UUID of the Appian application 40 | ## Used for addContents action. Indicates the app to which the contents of the Appian patch will be added. This does not need to be set for a package containing multiple patches. 41 | ## Used for the buildAllApps, buildSingleApp, and buildMultipleApps actions. Indicates the app(s) to be extracted from the repository. 42 | #uuid= 43 | 44 | ## Name of the Appian application 45 | ## Used for addContents action. Indicates the app to which the contents of the Appian patch will be added. This does not need to be set for a package containing multiple patches. 46 | ## Used for the buildAllApps, buildSingleApp, and buildMultipleApps actions. Indicates the app(s) to be extracted from the repository. 47 | #application_name= 48 | 49 | ## List of comma-separated paths for the DDL files to execute. Used for the addContents action. 50 | #ddlPath=C:\\Users\\acme.corp\\Documents\\script1.sql,C:\\Users\\acme.corp\\Documents\\script2.sql 51 | 52 | ## List of comma-separated paths for the directories to execute DB migrations via Flyway. Used for the addContents action. 53 | #flywayPath=C:\\Users\\acme.corp\\Documents\\db\\migration1,C:\\Users\\acme.corp\\Documents\\db\\migration2 54 | 55 | ## List of comma-separated datasources associated with the provided DDL files. Used for the addContents action. Required if using ddlPath or flywayPath. 56 | #ddlDs=jdbc/businessds1,jdbc/businessds2 57 | 58 | ## Path for the admin console ZIP file to add to version control. Used for the addContents action. 59 | #adminConsolePath=C:\\Users\\acme.corp\\Documents\\adminConsoleSettings.zip 60 | 61 | ## REQUIRED for the buildAllApps and buildSingleApp actions. Path and name of the generated package ZIP file. 62 | #packagePath=C:\\Users\\acme.corp\\Documents\\package.zip 63 | 64 | ## Start hash of the commit you want to start building the package. If not populated, everything in the local repository will be included up to the end commit (if specified). Used for the buildAllApps and buildSingleApp actions. 65 | #startHash= 66 | 67 | ## End hash of the commit you want to start building the package. If not populated, will get all files to the latest commit. Used for the buildAllApps and buildSingleApp actions. 68 | #endHash= 69 | 70 | ## Optional. A boolean flag to skip repository update and checkout. Used for the buildAllApps and buildSingleApp actions. 71 | #noUpdate=true -------------------------------------------------------------------------------- /devops/deploymentmanagement.prod.properties: -------------------------------------------------------------------------------- 1 | ### Environment-specific properties 2 | ## REQUIRED. URL of the environment 3 | url=[Enter URL of the appian site e.g. https://yourCloudSite.appiancloud.com/suite] 4 | siteApiKey=[Enter the API key for the deployment service account created in Appian] 5 | packageFileName=app-package.zip 6 | ### Import-specific properties 7 | ## REQUIRED Name for the deployment 8 | deploymentName=[ Enter a name for the deployment, to appear in the deployment tab within Appian] 9 | ## REQUIRED Description for the deployment 10 | deploymentDescription=[ Enter a description for the deployment, to appear in the deployment tab within Appian] 11 | 12 | 13 | -------------------------------------------------------------------------------- /devops/deploymentmanagement.stag.properties: -------------------------------------------------------------------------------- 1 | ### Environment-specific properties 2 | ## REQUIRED. URL of the environment 3 | url=[Enter URL of the appian site e.g. https://yourCloudSite.appiancloud.com/suite] 4 | siteApiKey=[Enter the API key for the deployment service account created in Appian] 5 | packageFileName=app-package.zip 6 | ### Import-specific properties 7 | ## REQUIRED Name for the deployment 8 | deploymentName=[ Enter a name for the deployment, to appear in the deployment tab within Appian] 9 | ## REQUIRED Description for the deployment 10 | deploymentDescription=[ Enter a description for the deployment, to appear in the deployment tab within Appian] 11 | 12 | 13 | -------------------------------------------------------------------------------- /devops/deploymentmanagement.test.properties: -------------------------------------------------------------------------------- 1 | ### Environment-specific properties 2 | ## REQUIRED. URL of the environment 3 | url=[Enter URL of the appian site e.g. https://yourCloudSite.appiancloud.com/suite] 4 | siteApiKey=[Enter the API key for the deployment service account created in Appian] 5 | packageFileName=app-package.zip 6 | ### Import-specific properties 7 | ## REQUIRED Name for the deployment 8 | deploymentName=[ Enter a name for the deployment, to appear in the deployment tab within Appian] 9 | ## REQUIRED Description for the deployment 10 | deploymentDescription=[ Enter a description for the deployment, to appear in the deployment tab within Appian] 11 | 12 | 13 | -------------------------------------------------------------------------------- /devops/f4a/README.md: -------------------------------------------------------------------------------- 1 | # Appian DevOps Quick Start - Custom Test Suites 2 | 3 | This folder should contain the integration/acceptance test suites that are developed within the FitNesseForAppian tool. 4 | 5 | ## Quickstart Example 6 | 7 | The provided QuickStartIntegrationTest and QuickStartAcceptanceTest serve as a quick walkthrough of how a FitNesse test script can be used in the pipeline. To set up use of this example in the default quickstart pipeline, make sure to first have a fully functional Appian environment and then follow the directions below: 8 | 9 | 1. Edit the QuickStartIntegrationTest/content.txt and QuickStartAcceptanceTest/content.txt files: 10 | * Replace 'APPIAN_URL' with your Appian URL, beginning with https:// and including /suite at the end (e.g. https://forum.appian.com/suite) 11 | * Replace 'APPIAN_VERSION' with the version of Appian your test site is running (17.1, 17.2, 17.3, 17.4, 18.1, 18.2, 18.3 or 18.4) 12 | * Replace 'APPIAN_LOCALE' with (en_US or en_GB) to handle differences in how dates are displayed 13 | * Replace 'APPIAN_USERNAME' with an authorized username for Appian URL above 14 | 2. The 'APPIAN_USERNAME' provided needs to be configured with the corresponding password so the script can login to the test site. To do this: 15 | * Open the "users.properties" file found in devops/f4a 16 | * Add a line in the file that is of the form *APPIAN_USERNAME=PASSWORD* where the *APPIAN_USERNAME* is the username provided above and the *PASSWORD* is the corresponding password for that username 17 | * Save this file 18 | 3. The pipeline is now ready to execute with this Quickstart example serving as the integration/acceptance test used to progress the pipeline 19 | 20 | ## Custom Integration/Acceptance Tests with FitNesseForAppian 21 | 22 | To create your own integration/acceptance FitNesse tests, you can use the FitNesseForAppian tool to develop custom tests. You can read all about this tool [here](https://community.appian.com/w/the-appian-playbook/97/automated-testing-with-fitnesse-for-appian). 23 | 24 | As you create standalone tests and bigger test suites within your FitNesseForAppian installation, your local filesystem will reflect the changes made within the tool. For example, adding a new test under the "Examples" heading will create a new directory corresponding to that test page in your filesystem (e.g. FitNesseForAppian/FitNesseRoot/FitNesseForAppian/Examples/NewTest). 25 | 26 | ## Pipeline Integration 27 | 28 | To integrate all your newly created test suites into this pipeline example: 29 | 30 | 1. Copy all the corresponding test folders from the FitNesseForAppian installation directory 31 | 1. Paste all those folders into this directory (devops/f4a/test_suites) 32 | 1. Navigate to the parent directory (devops/f4a) and edit the following files: 33 | * "fitnesse-automation.acceptance.properties" 34 | * "fitnesse-automation.integrate.properties" 35 | 1. Edit the "testPath" field to include the name of a particular test folder that was copied into this directory.(e.g. testPath=FitNesseForAppian.Examples.**QuickStartF4AExample**?suite). Only edit the **bolded** part 36 | 1. The properties files are used in the pipeline to kick-off desired integration/acceptance test suites 37 | * The pasted folders now serve as integration/acceptance tests instead of the default QuickStartF4AExample 38 | -------------------------------------------------------------------------------- /devops/f4a/fitnesse-automation.acceptance.properties: -------------------------------------------------------------------------------- 1 | ### This is the properties file corresponds with the properties needed for 2 | ### runFitNesseTest.sh, which runs the FitNesse suite specified in examplePath. 3 | 4 | ## REQUIRED. Port to run FitNesse on. Default is 8980. 5 | port=8980 6 | 7 | ## REQUIRED. Relative path to custom.properties file. ONLY change if user is 8 | ## providing their own properties file. DO NOT edit or change the default 9 | ## configs/custom.properties file. 10 | customProperties=configs/custom.properties 11 | 12 | ## REQUIRED. Standalone test or test suite to run in ClassPath form. ONLY 13 | ## replace the test or suite name (e.g. QuickStartF4AExample). 14 | testPath=FitNesseForAppian.Examples.QuickStartAcceptanceTest?suite 15 | 16 | ## REQUIRED. File format of the FitNesse test results. Possible options 17 | ## (case sensitive): junit, text, or leave blank. For Pipeline progression, 18 | ## junit recommended. 19 | format=junit 20 | 21 | ## REQUIRED. Filename and format of the saved FitNesse test results. Possible 22 | ## options: file_path.html or file_path.xml. Suggested format: xml. 23 | returnFile=fitnesse-results.xml 24 | -------------------------------------------------------------------------------- /devops/f4a/fitnesse-automation.integrate.properties: -------------------------------------------------------------------------------- 1 | ### This is the properties file corresponds with the properties needed for 2 | ### runFitNesseTest.sh, which runs the FitNesse suite specified in examplePath. 3 | 4 | ## REQUIRED. Port to run FitNesse on. Default is 8980. 5 | port=8980 6 | 7 | ## REQUIRED. Relative path to custom.properties file. ONLY change if user is 8 | ## providing their own properties file. DO NOT edit or change the default 9 | ## configs/custom.properties file. 10 | customProperties=configs/custom.properties 11 | 12 | ## REQUIRED. Standalone test or test suite to run in ClassPath form. ONLY 13 | ## replace the test or suite name (e.g. QuickStartF4AExample). 14 | testPath=FitNesseForAppian.Examples.QuickStartIntegrationTest?suite 15 | 16 | ## REQUIRED. File format of the FitNesse test results. Possible options 17 | ## (case sensitive): junit, text, or leave blank. For Pipeline progression, 18 | ## junit recommended. 19 | format=junit 20 | 21 | ## REQUIRED. Filename and format of the saved FitNesse test results. Possible 22 | ## options: file_path.html or file_path.xml. Suggested format: xml. 23 | returnFile=fitnesse-results.xml 24 | -------------------------------------------------------------------------------- /devops/f4a/test_suites/QuickStartAcceptanceTest/content.txt: -------------------------------------------------------------------------------- 1 | !***> FitNesse Configurations 2 | 3 | !define TEST_SYSTEM {slim} 4 | !define COMMAND_PATTERN {java -Dlog4j.configuration=file:///${automated.testing.home}/log4j.properties -cp %p %m} 5 | !path ${automated.testing.home}/**.jar 6 | *! 7 | ---- 8 | !*** Initialization and Login to Tempo 9 | 10 | !| script |com.appiancorp.ps.automatedtest.fixture.TempoFixture| 11 | |setup with |FIREFOX |browser | 12 | |set appian url to |APPIAN_URL | 13 | |set appian version to|APPIAN_VERSION | 14 | |set appian locale to |APPIAN_LOCALE | 15 | |login with username |APPIAN_USERNAME | 16 | ***! 17 | !*** Click on all the tabs 18 | 19 | !| script | 20 | |click on menu|News | 21 | |click on menu|Tasks | 22 | |click on menu|Records| 23 | |click on menu|Reports| 24 | |click on menu|Actions| 25 | ***! 26 | !*** Log out and tear down 27 | 28 | !| script | 29 | |logout | 30 | |tear down| 31 | ***! 32 | -------------------------------------------------------------------------------- /devops/f4a/test_suites/QuickStartAcceptanceTest/properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | Simple login and navigation test example 6 | true 7 | true 8 | true 9 | true 10 | true 11 | true 12 | true 13 | 14 | -------------------------------------------------------------------------------- /devops/f4a/test_suites/QuickStartIntegrationTest/content.txt: -------------------------------------------------------------------------------- 1 | !***> FitNesse Configurations 2 | 3 | !define TEST_SYSTEM {slim} 4 | !define COMMAND_PATTERN {java -Dlog4j.configuration=file:///${automated.testing.home}/log4j.properties -cp %p %m} 5 | !path ${automated.testing.home}/**.jar 6 | *! 7 | ---- 8 | !*** Initialization and Login to Tempo 9 | 10 | !| script |com.appiancorp.ps.automatedtest.fixture.TempoFixture| 11 | |setup with |FIREFOX |browser | 12 | |set appian url to |APPIAN_URL | 13 | |set appian version to|APPIAN_VERSION | 14 | |set appian locale to |APPIAN_LOCALE | 15 | |login with username |APPIAN_USERNAME | 16 | ***! 17 | !*** Click on all the tabs 18 | 19 | !| script | 20 | |click on menu|News | 21 | |click on menu|Tasks | 22 | |click on menu|Records| 23 | |click on menu|Reports| 24 | |click on menu|Actions| 25 | ***! 26 | !*** Log out and tear down 27 | 28 | !| script | 29 | |logout | 30 | |tear down| 31 | ***! 32 | -------------------------------------------------------------------------------- /devops/f4a/test_suites/QuickStartIntegrationTest/properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | true 5 | Simple login and navigation test example 6 | true 7 | true 8 | true 9 | true 10 | true 11 | true 12 | true 13 | 14 | -------------------------------------------------------------------------------- /devops/f4a/users.properties: -------------------------------------------------------------------------------- 1 | # List of username/password combination with access to Appian environment 2 | # Example: test.user=password 3 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2.1" 2 | 3 | services: 4 | 5 | firefox: 6 | container_name: fitnesse-firefox 7 | image: selenium/standalone-firefox 8 | ports: 9 | - "4444:4444" 10 | volumes: 11 | # The /dev/shm volume fixes an issue in "geckodriver" where it crashes without it 12 | # For more documentation, see 13 | # https://github.com/SeleniumHQ/docker-selenium#running-the-images 14 | # https://github.com/mozilla/geckodriver/issues/1193#issuecomment-369696152 15 | - /dev/shm:/dev/shm 16 | networks: 17 | - fitnesse-webdrivers 18 | 19 | chrome: 20 | container_name: fitnesse-chrome 21 | image: selenium/standalone-chrome 22 | ports: 23 | - "4445:4444" 24 | volumes: 25 | - /dev/shm:/dev/shm 26 | networks: 27 | - fitnesse-webdrivers 28 | 29 | networks: 30 | fitnesse-webdrivers: 31 | driver: bridge -------------------------------------------------------------------------------- /groovy/GitHubUtils.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | 3 | void releaseApplication(tag, customProperties) { 4 | def releaseName = tagSuccessfulImport(tag) 5 | def remoteURL = getRemoteRepo("appian/applications/${APPLICATIONNAME}").split("/") 6 | def remoteRepo = remoteURL[-1].trim().minus(".git") 7 | def remoteOwner = remoteURL[-2].trim() 8 | 9 | shNoTrace("curl --user \"${REPOUSERNAME}:${REPOPASSWORD}\" -X GET https://api.github.com/repos/${remoteOwner}/${remoteRepo}/releases/tags/${releaseName} > releaseGetResponse.json") 10 | def previousURL = sh script: "jq \'.url\' releaseGetResponse.json", returnStdout: true 11 | previousURL = previousURL.trim() 12 | if (previousURL != "null") { 13 | shNoTrace("curl --user \"${REPOUSERNAME}:${REPOPASSWORD}\" -X DELETE ${previousURL}") 14 | } 15 | 16 | def body = "${APPLICATIONNAME} has passed integration and acceptance tests and is being released." 17 | shNoTrace("curl --user \"${REPOUSERNAME}:${REPOPASSWORD}\" -d \'{\"tag_name\":\"${releaseName}\", \"name\":\"${releaseName}\", \"body\":\"${body}\", \"draft\":false, \"prerelease\":false}\' -X POST https://api.github.com/repos/${remoteOwner}/${remoteRepo}/releases > releasePostResponse.json") 18 | 19 | def uploadURL = sh script: "jq \'.upload_url\' releasePostResponse.json", returnStdout: true 20 | uploadURL = uploadURL.trim().minus("{?name,label}") 21 | shNoTrace("curl -s --user \"${REPOUSERNAME}:${REPOPASSWORD}\" --header \"Content-Type:application/zip\" --data-binary \"@adm/app-package.zip\" -X POST ${uploadURL}?name=${releaseName}.zip") 22 | if (fileExists("appian/properties/${APPLICATIONNAME}/" + customProperties)) { 23 | shNoTrace("curl -s --user \"${REPOUSERNAME}:${REPOPASSWORD}\" --header \"Content-Type:application/text\" --data-binary \"@appian/properties/${APPLICATIONNAME}/${customProperties}\" -X POST ${uploadURL}?name=${releaseName}.properties") 24 | } 25 | } 26 | 27 | void tagSuccessfulImport(tag) { 28 | def releaseName = "${APPLICATIONNAME}_${tag}" 29 | dir("appian/applications/${APPLICATIONNAME}") { 30 | def currentCommit = sh script: "git log -n 1 --format='%h' ./", returnStdout: true 31 | def remoteURL = sh script: "git config --get remote.origin.url", returnStdout: true 32 | remoteURL = "https://${REPOUSERNAME}:${REPOPASSWORD}@" + remoteURL.split("https://")[1] 33 | sh "git checkout master" 34 | sh "git tag -af ${releaseName} -m 'The application ${APPLICATIONNAME} has successfully been imported into ${tag}' ${currentCommit}" 35 | shNoTrace("git push -f --follow-tags --repo=${remoteURL}") 36 | } 37 | return releaseName 38 | } 39 | 40 | void getRemoteRepo(path) { 41 | dir("${path}") { 42 | def remoteURL = sh script: "git config --get remote.origin.url", returnStdout: true 43 | return remoteURL 44 | } 45 | } 46 | 47 | def shNoTrace(cmd) { 48 | sh '#!/bin/sh -e\n' + cmd 49 | } 50 | 51 | return this 52 | -------------------------------------------------------------------------------- /groovy/JenkinsUtils.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | 3 | void runTestsVNC(propertyFile) { 4 | sh "cp devops/f4a/" + propertyFile + " f4a/FitNesseForAppian/fitnesse-automation.properties" 5 | dir("f4a/FitNesseForAppian") { 6 | wrap([$class:'Xvnc', useXauthority: true]) { 7 | sh script: "bash ./runFitNesseTest.sh" 8 | } 9 | } 10 | } 11 | 12 | void runTestsDocker(propertyFile) { 13 | sh "cp devops/f4a/" + propertyFile + " f4a/FitNesseForAppian/fitnesse-automation.properties" 14 | sh "docker-compose -f docker/docker-compose.yml up &" 15 | timeout(2) { //timeout is in minutes 16 | waitUntil { 17 | def numExpectedContainers = "2" 18 | def runningContainers = sh script: "docker ps --format {{.Names}} | grep \"fitnesse-\\(chrome\\|firefox\\)\" | wc -l", returnStdout: true 19 | runningContainers = runningContainers.trim() 20 | return (runningContainers == numExpectedContainers) 21 | } 22 | } 23 | sleep(10) 24 | dir("f4a/FitNesseForAppian") { 25 | sh script: "bash ./runFitNesseTest.sh" 26 | } 27 | } 28 | 29 | void retrieveLogs(propertyFile) { 30 | def test = sh script: "cat \"devops/f4a/${propertyFile}\" | grep \"testPath=\" | cut -d'=' -f2", returnStdout: true 31 | test = test.trim().minus(~"\\?.*") 32 | def zipName = "${test}_Results.zip" 33 | dir("f4a/FitNesseForAppian/FitNesseRoot/files/testResults") { 34 | sh "zip -r ${zipName} ${test}/**" 35 | } 36 | return "f4a/FitNesseForAppian/FitNesseRoot/files/testResults/${zipName}" 37 | } 38 | 39 | void buildPackage(versionPropertyFile) { 40 | sh "cp devops/adm/" + versionPropertyFile + " adm/appian-version-client/version-manager.properties" 41 | dir("adm/appian-version-client") { 42 | setProperty("version-manager.properties", "vcUsername", "${REPOUSERNAME}") 43 | setProperty("version-manager.properties", "vcPassword", "${REPOPASSWORD}") 44 | setProperty("version-manager.properties", "appianObjectsRepoPath", "appian/applications/${APPLICATIONNAME}") 45 | sh "./version-application.sh -package_path ./app-package.zip -local_repo_path ./local-repo" 46 | sh "unzip ./app-package.zip" 47 | sh "mv application* ../deploy-package.zip" 48 | sh "rm -rf newBundle" 49 | sh "mkdir newBundle" 50 | sh "unzip ../deploy-package.zip -d newBundle" 51 | sh "rm -rf newBundle/appian" 52 | zip zipFile: '../finalPackage.zip', archive: false, dir: 'newBundle' 53 | } 54 | } 55 | void inspectPackage(customProperties) { 56 | inspectionUrl = SITEBASEURL +"/deployment-management/v1/inspections" 57 | String response = null 58 | if (fileExists("appian/properties/${APPLICATIONNAME}/" + customProperties)) { 59 | println "Properties Exist" 60 | response=sh( script:"curl --location --request POST \"$inspectionUrl\" --header \"Appian-API-Key: $APIKEY\" --form \"zipFile=@\"adm/finalPackage.zip\"\" --form \"ICF=@\"appian/properties/${APPLICATIONNAME}/${customProperties}\"\" --form \"json={\"packageFileName\":\"finalPackage.zip\",\"customizationFileName\":\"$customProperties\"}\"", returnStdout: true).trim() 61 | } else{ 62 | response=sh( script:"curl --location --request POST \"$inspectionUrl\" --header \"Appian-API-Key: $APIKEY\" --form \"zipFile=@\"adm/finalPackage.zip\"\" --form \"json={\"packageFileName\":\"finalPackage.zip\"}\"", returnStdout: true).trim() 63 | } 64 | println response 65 | //.readLines().drop(1).join(" ") 66 | initiateInspectionJson = new groovy.json.JsonSlurperClassic().parseText(response) 67 | println "Inspection Started" 68 | sleep 5 69 | String newUrl = SITEBASEURL + "/deployment-management/v1/inspections" + "/" + initiateInspectionJson.uuid +"/" 70 | String inspectionResponse = sh(script: "curl --silent --location --request GET \"$newUrl\" --header \"Appian-API-Key: $APIKEY\"" , returnStdout: true).trim() 71 | inspectionResponse = inspectionResponse 72 | //.readLines().drop(1).join(" ") 73 | inspectionResponseJson = new groovy.json.JsonSlurperClassic().parseText(inspectionResponse) 74 | inspectionStatus = inspectionResponseJson.status 75 | while(inspectionStatus.equals("IN_PROGRESS")) { 76 | sleep 30 77 | inspectionResponse = sh(script: "curl --silent --location --request GET \"$newUrl\" --header \"Appian-API-Key: $APIKEY\"" , returnStdout: true).trim() 78 | inspectionResponse = inspectionResponse.readLines().drop(1).join(" ") 79 | inspectionResponseJson = new groovy.json.JsonSlurperClassic().parseText(inspectionResponse) 80 | inspectionStatus = inspectionResponseJson.status 81 | } 82 | println inspectionResponseJson 83 | warnings = inspectionResponseJson.summary.problems.totalWarnings 84 | errors = inspectionResponseJson.summary.problems.totalErrors 85 | if(warnings.equals(0) && errors.equals(0)) { 86 | println "Inspection Success" 87 | } else{ 88 | error "Inspection Failed, Pipeline Stopped" 89 | } 90 | 91 | } 92 | 93 | void createDeployment(customProperties) { 94 | deploymentUrl = SITEBASEURL + "/deployment-management/v1/deployments" 95 | if (fileExists("appian/properties/${APPLICATIONNAME}/" + customProperties)) { 96 | print "fileExists" 97 | response=sh( script:"curl --silent --location --request POST \'$deploymentUrl\' --header \'Appian-API-Key: $APIKEY\' --form \'zipFile=@\"adm/finalPackage.zip\"\' --form \'ICF=@\"appian/properties/${APPLICATIONNAME}/${customProperties}\"\' --form \'json={\"name\":\"newDeploymentUnix\",\"packageFileName\":\"finalPackage.zip\",\"customizationFileName\":\"$customProperties\"}\'", returnStdout: true).trim() 98 | } else{ 99 | response=sh( script:"curl --silent --location --request POST \"$deploymentUrl\" --header \"Appian-API-Key: $APIKEY\" --form \"zipFile=@\"adm/finalPackage.zip\"\" --form \"json={\"packagFileName\":\"finalPackage.zip\",\"name\":\"$DEPLOYMENTNAME\"}\"", returnStdout: true).trim() 100 | 101 | } 102 | println response 103 | //.readLines().drop(1).join(" ") 104 | deploymentResponseJson = new groovy.json.JsonSlurperClassic().parseText(response) 105 | println "Deployment Requested" 106 | } 107 | 108 | void checkDeploymentStatus() { 109 | sleep 15 110 | String newUrl = SITEBASEURL + "/deployment-management/v1/deployments" + "/" + deploymentResponseJson.uuid +"/" 111 | String deploymentStatus = sh(script: "curl --silent --location --request GET \"$newUrl\" --header \"Appian-API-Key: $APIKEY\"" , returnStdout: true).trim() 112 | deploymentStatus = deploymentStatus 113 | //.readLines().drop(1).join(" ") 114 | deploymentStatusJson = new groovy.json.JsonSlurperClassic().parseText(deploymentStatus) 115 | statusVar = deploymentStatusJson.status 116 | while (statusVar.equals("IN_PROGRESS")) { 117 | sleep 30 118 | deploymentStatus = sh(script: "curl --silent --location --request GET \"$newUrl\" --header \"Appian-API-Key: $APIKEY\"" , returnStdout: true).trim() 119 | deploymentStatus = deploymentStatus.readLines().drop(1).join(" ") 120 | deploymentStatusJson = new groovy.json.JsonSlurperClassic().parseText(deploymentStatus) 121 | statusVar = deploymentStatusJson.status 122 | } 123 | println "Deployment Finished and Status is " + statusVar 124 | 125 | } 126 | 127 | void setProperty(filePath, property, propertyValue) { 128 | shNoTrace("sed -i -e 's|.\\?${property}=.*|${property}=${propertyValue}|' ${filePath}") 129 | } 130 | 131 | def shNoTrace(cmd) { 132 | sh '#!/bin/sh -e\n' + cmd 133 | } 134 | 135 | return this 136 | --------------------------------------------------------------------------------