Configuring FortiWeb Cloud with Jenkins
The following example demonstrates how to use Jenkins to perform simple configuration changes on FortiWeb Cloud. It requires the following:
- FortiWeb Cloud 20.2.d or later
- Jekins: This example uses Jekins 2.222.3+.
To onboard an application with Jenkins, follow the steps below:
- Log in to your Jenkins account.
- Click New Item.
-
Name the item and select Pipeline, then click OK.
-
Select This project is parameterized.
-
In String Parameter, enter user in Name, then enter your FortiWeb Cloud's account name in Default Value. The account should have write privilege on FortiWeb Cloud.
-
In Password Parameter, enter password in Name, then enter the password of the specified account in Default Value.
-
In String Parameter, enter application_name in Name, then enter a name for your application. It will be displayed on FortiWeb Cloud's GUI to identify your application.
-
In String Parameter, enter domain_name in Name, then enter your application's domain name in Default Value.
-
In Multi-line String Parameter, enter extra_domains in Name, then enter the domain names if your application has multiple domains.
-
In String Parameter, enter origin_server_ip in Name, then enter your origin server's IP address in Default Value.
-
In String Parameter, enter HTTP in Name, then enter the port number used for HTTP service in Default Value.You must enter 80 as the default value.
-
In String Parameter, enter HTTPS in Name, then enter the port number used for HTTPS service in Default Value. You must enter 443 as the default value.
-
In String Parameter, enter origin_server_service in Name, then enter your origin server's service type in Default Value. You must input HTTP or HTTPS as the default value.
-
In String Parameter, enter origin_server_port in Name, then enter your origin server's listening port in Default Value. You can input 80 for HTTP or 443 for HTTPS as the default value.
-
In Boolean Parameter, enter cdn in Name, then enable this option if you want your application to be accelerated in the global network.
-
In Boolean Parameter, enter block in Name, then enable this option if you want FortiWeb Cloud to block the attacks and abnormal traffic.
-
In String Parameter, enter template in Name, then enter the name of the template if you want your application to inherit configuration from the template.
-
Specify the repositories in the pipeline. The repository URL is https://github.com/fortinet/fortiwebcloud-jenkins and the script path is "jenkins/CreateApp". Click Save to finish the setup.
-
Now you can schedule the build.
-
Review the configuration before running the build. Click Build.
-
If nothing is wrong, you will see the successful operation via Console Output.
To delete app via Jenkins, follow the steps below:
-
Click New Item to add a new item.
-
Name the item and select Pipeline, then click OK.
-
Select This project is parameterized.
-
In String Parameter, enter user in Name, then enter your FortiWeb Cloud's account name as its default value.
-
In Password Parameter, enter password in Name, then enter the password of the specified account in Default Value.
-
In String Parameter, enter application_name in Name, then enter the name of your application to be deleted.
-
Specify the repositories in the pipeline. The repository URL is https://github.com/fortiweb/FortiwebCloudJenkins and the script path is "jenkins/DelApp". Then click Save to finish the setup.
-
Run the build. If nothing is wrong, then the delete process will be output and your application will be deleted from FortiWeb Cloud.