Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

At the completion of this section, you will:

...

  • Utilized for building a project.   Building a project requires retrieving the source files from the GIT repository using the cloneProjectSources operation of the installed GIT plugin and compiling and creating a WAR artifact using the runMaven operation of the installed Maven plugin.  The cloneProjectSources operation allows the GIT repository information for the project to be defined once on the project and then retrieved from the project on execution.

...

  • Utilized for deploying a project.   Deploying a project requires retrieving the WAR artifact created by the build workflow and deploying the artifact using the deploy operation of the installed Tomcat plugin.

...

Now that we have a general understanding of why we need a build and deploy workflow, we can start to define the build workflow. Select Workflows from the main menu or from the Home page. Workflows are versioned and there is always a single active version that can be executed, this allows changes to be staged until ready to be activated. Select the + to create a new workflow.

Image Modified

The workflow details screen will allow for the configuration of the build workflow. 

  1. Providing the workflow with a functional name will help find the correct workflow when the project is being created in a later section of the tutorial.
  2. Select Build as the Workflow Type
  3. The Workflow Group and Workflow Subgroup are organizational folders for the workflows and the values are completely controlled by the workflow developer, so use functional names that will help find the correct workflow easier.

Image RemovedImage Added

Save the Main configuration and the Definition tab will activate. The Definition is where the orchestration steps for the build will be configured. Configuration is accomplished by dragging the appropriate components from the Workflow Operations and/or the Plugin Operations pane into the center pane between the start arrow and end block (a drop zone will appear as you get close). There are several other features such an Workflow Inputs and Workflow Variables that will not be used in this tutorial.

Configure the GITGit cloneProjectSources operation by adding it to the center pane and the plugin will open for additional configuration.   Since this is the cloneProjectSources operation, there is no configuration required and all information will be retrieved from the project.  Select OK.  Clicking on any component in the workflow will open up the configuration screen for that component, if a change is needed.

Image RemovedImage Added

Info

GIT was chosen as the Source Code Management tool for this tutorial, however, FlexDeploy supports many other  Source Code Management tools and any one can be used in place of GIT.

Configure the Maven runMaven operation by adding it to the center pane and the plugin will open for additional configuration. The runMaven operation requires one or more Run Phases to be specified. Since we want to compile and generate a WAR, we will use the default package phase. The plugin allows us to save artifacts directly to the Artifacts Repository by checking the Save Artifacts option. Checking this will cause the plugin to save all files in the Artifacts Subfolder into the Artifact Repository. The Artifacts Subfolder is the folder where Maven will put the packaged WAR, so we're keeping the default value of target. The Arguments input is where we can specify any extra arguments we want passed to the mvn command. Our endpoint is running Java 7 so we now need to tell Java to use TLS version 1.2, or we won't be allowed to access the Maven Central Repository. To do this we have to add -Dhttps.protocols=TLSv1.2 to the Arguments.

The runMaven operation knows where the project was cloned, so the developer doesn't have to worry about the details. At the successful completion of the runMaven operation, a WAR file will be generated as an artifact and will automatically be pulled back to the artifact repository.  Select OK.

Image Modified

The plugins are intelligent and eliminate as much development work as possible from the developers. Once the components are added, the workflow needs to be saved and/or activated. Saving the workflow changes will only save the current configuration to the database and is used when the developer may not be quite ready to activate these changes.  When the developer wants the changes to be executed by projects, the Activate button must be selected.  Once the current version of the workflow is activated, the workflow will be marked as read-only and have a green check mark next to it.  Active versions can't be modified and require the developer to select Make Copy. This will create a new version and open that version up for editing, the active version will not be changed.

Image Modified

Create Deploy Workflow

...

  1. Providing the workflow with a functional name will help find the correct workflow when the project is being created in a later section of the tutorial.
  2. Selecting Deploy for the Workflow type.
  3. The Workflow Group and Workflow Subgroup are organizational folders for the workflows and the values are completely controlled by the workflow developer, so use functional names that will help find the correct workflow easier.

Image RemovedImage Added

Add the deploy operation of the Tomcat plugin by adding it to the center pane and the plugin will open for additional configuration. This operation requires no configuration on the workflow operation, it will get all of the necessary information from either the Environment Instance (configured later in this tutorial), or by looking it up on the Tomcat server. The operation will automatically have access to the artifact created by the build workflow.

Image Modified

Select OK and Activate the workflow.

...