xebialabs-community/xld-azure-app-services-plugin

View on GitHub
src/main/resources/xl-rules.xml

Summary

Maintainability
Test Coverage
<!--

    Copyright 2019 XEBIALABS

    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.

-->
<!--

    THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
    FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.

-->
<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.xebialabs.com/xl-deploy/xl-rules">

    <rule name="azure_app_service.CreateOrUpdatePlan" scope="deployed">
        <conditions>
            <type>azure.AppServicePlan</type>
            <operation>CREATE</operation>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Define App Service Plan [%s] in resource [%s] ' % (deployed.servicePlanName, deployed.container.resourceName)</description>
                <script>azure_app_services/define_app_service_plan.py</script>
            </jython>
            <checkpoint/>
        </steps>
    </rule>

    <rule name="azure_app_service.RemovePlan" scope="deployed">
        <conditions>
            <type>azure.AppServicePlan</type>
            <operation>DESTROY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Remove App Service Plan [%s] from resource [%s] ' % (previousDeployed.servicePlanName, previousDeployed.container.resourceName)</description>
                <script>azure_app_services/remove_app_service_plan.py</script>
            </jython>
            <checkpoint/>
        </steps>
    </rule>

    <rule name="azure_app_service.CreateOrUpdateWebApp" scope="deployed">
        <conditions>
            <type>azure.WebAppModule</type>
            <operation>CREATE</operation>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Define Web App [%s] in resource [%s] ' % (deployed.appName, deployed.container.resourceName)</description>
                <script>azure_app_services/define_web_app.py</script>
            </jython>
            <checkpoint/>
            <jython>
                <description expression="true">'Upload Web App [%s] data in resource [%s] ' % (deployed.appName, deployed.container.resourceName)</description>
                <script>azure_app_services/upload_web_app_artifact.py</script>
                <order>75</order>
            </jython>
            <jython>
                <description expression="true">'Start Web App [%s] in resource [%s] ' % (deployed.appName, deployed.container.resourceName)</description>
                <script>azure_app_services/start_web_app.py</script>
                <order>90</order>
            </jython>
        </steps>
    </rule>

    <rule name="azure_app_service.StopWebAppOnModify" scope="deployed">
        <conditions>
            <type>azure.WebAppModule</type>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Stop Web App [%s] in resource [%s] ' % (deployed.appName, deployed.container.resourceName)</description>
                <script>azure_app_services/stop_web_app.py</script>
                <order>15</order>
            </jython>
        </steps>
    </rule>

    <rule name="azure_app_service.RemoveWebApp" scope="deployed">
        <conditions>
            <type>azure.WebAppModule</type>
            <operation>DESTROY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Stop Web App [%s] in resource [%s] ' % (previousDeployed.appName, previousDeployed.container.resourceName)</description>
                <script>azure_app_services/stop_web_app.py</script>
                <order>10</order>
                <jython-context>
                    <deployed expression="true">previousDeployed</deployed>
                </jython-context>
            </jython>
            <jython>
                <description expression="true">'Remove Web App [%s] from resource [%s] ' % (previousDeployed.appName, previousDeployed.container.resourceName)</description>
                <script>azure_app_services/remove_web_app.py</script>
                <order>35</order>
            </jython>
            <checkpoint/>
        </steps>
    </rule>

    <rule name="azure_app_service.CreateOrUpdateTriggeredWebJob" scope="deployed">
        <conditions>
            <type>azure.TriggeredWebJobModule</type>
            <operation>CREATE</operation>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Deploy triggered web job [%s] to web app [%s] ' % (deployed.webJobName, deployed.appName)</description>
                <script>azure_app_services/deploy_triggered_web_job.py</script>
                <order>76</order>
            </jython>
            <checkpoint/>
        </steps>
    </rule>
    <rule name="azure_app_service.RemoveTriggeredWebJob" scope="deployed">
        <conditions>
            <type>azure.TriggeredWebJobModule</type>
            <operation>DESTROY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Remove triggered web job [%s] from web app [%s] ' % (previousDeployed.webJobName, previousDeployed.appName)</description>
                <script>azure_app_services/remove_triggered_web_job.py</script>
            </jython>
            <checkpoint/>
        </steps>
    </rule>

    <rule name="azure_app_service.CreateOrUpdateContinuousWebJob" scope="deployed">
        <conditions>
            <type>azure.ContinuousWebJobModule</type>
            <operation>CREATE</operation>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Deploy continuous web job [%s] to web app [%s] ' % (deployed.webJobName, deployed.appName)</description>
                <script>azure_app_services/deploy_continuous_web_job.py</script>
                <order>76</order>
            </jython>
            <checkpoint/>
        </steps>
    </rule>

    <rule name="azure_app_service.StopContinuousWebJobOnModify" scope="deployed">
        <conditions>
            <type>azure.ContinuousWebJobModule</type>
            <operation>MODIFY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Stop continuous web job [%s] in web app [%s] ' % (deployed.webJobName, deployed.appName)</description>
                <script>azure_app_services/stop_continuous_web_job.py</script>
                <order>10</order>
            </jython>
        </steps>
    </rule>

    <rule name="azure_app_service.RemoveContinuousWebJob" scope="deployed">
        <conditions>
            <type>azure.ContinuousWebJobModule</type>
            <operation>DESTROY</operation>
        </conditions>
        <steps>
            <jython>
                <description expression="true">'Stop continuous web job [%s] in web app [%s] ' % (previousDeployed.webJobName, previousDeployed.appName)</description>
                <script>azure_app_services/stop_continuous_web_job.py</script>
                <order>10</order>
            </jython>
            <jython>
                <description expression="true">'Remove continuous web job [%s] from web app [%s] ' % (previousDeployed.webJobName, previousDeployed.appName)</description>
                <script>azure_app_services/remove_continuous_web_job.py</script>
            </jython>
            <checkpoint/>
        </steps>
    </rule>
</rules>