- Branch synchronizer app
- Artifact deployment app
- Slave safeguard app
- Integrity check for environmnent slaves
- Inactive check for Domain Controllers
Our developers have an ability to deploy feature branches to many our environments. But with great power comes great responsibility so we have to automatically clean that and remove branches we don't need anymore.
To solve that issue we have a few Java apps that work together
This one does:
- scan specified folders searching for WAR files
- get a list of Wildfly domain controllers for specified environment and stability from AWS and get a list of deployed applications
- compare two lists, ecking of checksum, creating lists of WAR files to be deployed and undeployed
- deploy/undeploy things for all domain controllers for that environment/stability
How to run:
java -jar wildfly-sync.jar \
-Djavax.net.ssl.trustStore="C:\whatever\cacerts" \
-DwildflyPassword=seG^&R(a \
-DwildflyLogin=wildflyadmin \
-Denvironment=uat \
-Dstability=stable \
-DlocalLibraryPath=C:\tmp\wars,C:\tmp\wars\release \
-DawsAccessKeyId=AAAAAABBBJJ999AA000AA \
-DawsSecretAccessKey=111111122233344444/aaa444XXXQQQT33311111 \
-DdryRun=true \
-DignoreArtifacts=activemq-rar-5.13.0.rar
This app deploys artifact to multiple Wildfly domain controllers. You don't need to specify exact IP addresses of those things but AWS environment/stability tags
Since version 2.0 it's trying to start Wildfly Domain controllers if they are offline
How to run:
java -jar wildfly-deploy.jar \
-Djavax.net.ssl.trustStore="C:\whatever\cacerts" \
-DwildflyPassword=seG^&R(a \
-DwildflyLogin=wildflyadmin \
-Denvironment=uat \
-Dstability=stable \
-Ddeployment=C:\tmp\wars\life-express.war \
-DawsAccessKeyId=AAAAAABBBJJ999AA000AA \
-DawsSecretAccessKey=111111122233344444/aaa444XXXQQQT33311111 \
-DdryRun=true
Sometimes we have situation when both slaves are alive and visible but Wildfly domain controller reports that deployments aren't running anywhere for some reasons
This app is a workaround that checking if slaves are actually active and ready to serve content and if they aren't - restarts them
How to run:
java -jar wildfly-safeguard.jar \
-Djavax.net.ssl.trustStore="C:\whatever\cacerts" \
-DwildflyPassword=seG^&R(a \
-DwildflyLogin=wildflyadmin \
-Denvironment=uat \
-Dstability=stable
This application queries all the slaves across all domain controllers for specified environment/colour and checks that all deployments are identical across all the slaves
How to run:
java -jar wildfly-integrity-check.jar \
-Djavax.net.ssl.trustStore="/home/certificates" \
-DwildflyPassword=seG^&R(a \
-DwildflyLogin=wildflyadmin \
-Denvironment=uat \
-Dstability=stable \
-Dtimeout=10
Imagine you have a traditional Domain-Slave setup for Wildfly cluster. Most of the time your domain controllers will be idle and waste your money doing nothing. This application checks if controllers were inactive for some time and attempts to shut those EC2 instances in case we don't need them anymore
java -jar wildfly-inactive-check.jar \
-Djavax.net.ssl.trustStore="/home/certificates" \
-DwildflyPassword=seG^&R(a \
-DwildflyLogin=wildflyadmin \
-Denvironment=uat \
-Dstability=stable \
-DinactiveTimeout=60 \
-Dtimeout=10
You may need to pass javax.net.ssl.trustStore
property with the path to a certificate store
if you have self-signed sertificates in your Wildfly servers
Password for Wildfly domain controller management user
Login for Wildfly domain controller management user
Default: agwildflyadmin
AWS credentials to use for discovery of Wildfly domain controllers. Application will use default credentials provided in .aws/credentials if those params were not specified
Do nothing if this parameter set to true
and just produce output about operations
Default: false
AWS environment to use during apps' sync. Default implementation uses Environment
tag
Default: int
AWS stability name to use during apps' sync. We use colours tags in AWS and there is a builtin colour resolver
(static for now) which resolves stable
to Color:green
and unstable
to Color:blue
tags:values
Default: unstable
Time limit in seconds for application to run. Application will be terminated when time limit exceeded
Default: 300
Path to local folder with .war files (applications)
Default: ./tmp
List of ignored artifacts divided by ","
Default: activemq-rar-5.13.0.rar
, services.war
Boolean value. Syncronizer will not deploy artifacts to remote hosts if flag set to true
Default: false
Boolean value. Syncronizer will not undeploy artifacts from remote hosts if flag set to true
Default: false
Path to local artifact. Can be a folder - in this case first file found in that folder and its subfolders
mathing pattern .war|.ear will be deployed
Default: ./
Time in seconds since the last deployment to domain controllers after which they are going to be
considered as 'inactive'
Default: 20 * 60
Read CONTRIBUTING.md to learn more about contributing to this project.
AWS parts requires credentials. Here is a short guide from Amazon how to do that: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/set-up-creds.html
This application uses some AWS EC2 tags to find Wildfly domain controller instances:
Environment
andColor
tags to find environment for syncronizationRole
tag with valuewildfly-domain
to find instances with domain controllers within environments
To build an app run:
./gradlew clean check shadowJar
Core package can be published using those command:
./gradlew.bat core:publish -Pusername=user -Ppassword=passw -Pnexus=path-to-local-nexus:8081
The MIT License (MIT)
Copyright (c) 2016 Auto & General Insurance Company Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.