Extract files from EBS and Save to SCM
This can be used for AOL and various other types of files that support download option from EBS.
In this example, we will talk about committing LDT files to Git, but this option would apply to other Source Control as well, just plugin operations used to commit files will change.
Let's first create Git (or any other SCM) instance in Topology - Integrations section. If you already have SCM Integration Instance created, you can skip this step. Here is an example of Git instance, we will call it EBSDemo.
Ā
Next Step is to create Workflow. We will call it Extract LDT. This will be of Build Type.
There will be 5 steps in this workflow for Extracting files and commit to Git. If you are using Git, you can just paste Source shown below in Source popup of your workflow.
Make sure to change GIT1 instance code to your Instance Code if you are using different Instance code for Git. That would need to be updated in Git Clone, Add any new Files, Commit to Git, Push to Central Repository operations.
If you are using other SCM, then you will need to use proper operations for commit of files. Basic steps will be to checkout code, copy files in it and commit.
You can download workflow source from ExtractLDT_Workflow_Source.xml and update Source of your workflow.
Extract LDT workflow source
<?xml version="1.0" encoding="UTF-8"?>
<ns0:WorkFlow xmlns:ns1="http://flexagon.com/flexdeploy/workflow/common" xmlns:ns0="http://flexagon.com/flexdeploy/workflow">
<ns1:Name>Extract LDT</ns1:Name>
<ns1:Description></ns1:Description>
<ns0:Steps>
<ns0:Step>
<ns1:Name>Extract LDT Files from EBS</ns1:Name>
<ns1:StepId>1</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonEBSPlugin</ns0:PluginName>
<ns0:PluginOperation>build</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDEBS_INP_INCLUDE_FILES</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
<ns0:Step>
<ns1:Name>Git Clone</ns1:Name>
<ns1:StepId>2</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonGITPlugin</ns0:PluginName>
<ns0:PluginOperation>clone</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_INSTANCE_CODE</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>GIT1</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_DEST_SUBFOLDER</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>../ebsldtfiles</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_BRANCH</ns0:Name>
<ns0:ValueType>Expression</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Value>
<ns0:Expression>FDBLD_STREAM_NAME</ns0:Expression>
</ns0:Value>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_DEPTH</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>Integer</ns1:Type>
<ns0:Text>1</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_SPARSE_CHECKOUT_FOLDERS</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
<ns0:Step>
<ns1:Name>Copy downloaded files to Git Repository</ns1:Name>
<ns1:StepId>3</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonFilePlugin</ns0:PluginName>
<ns0:PluginOperation>copy</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:EndpointSelection>
<ns0:EndpointSelectionChoice>All</ns0:EndpointSelectionChoice>
</ns0:EndpointSelection>
<ns0:EndpointExecutionChoice>Any</ns0:EndpointExecutionChoice>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDFILE_INP_FILE_FILTER</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>*.ldt</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDFILE_INP_FILE_FILTER_EXCLUDED</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDFILE_INP_SOURCE_PATH</ns0:Name>
<ns0:ValueType>Expression</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Value>
<ns0:Expression>FD_TEMP_DIR</ns0:Expression>
</ns0:Value>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDFILE_INP_TARGET_PATH</ns0:Name>
<ns0:ValueType>Expression</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Value>
<ns0:Expression>FD_TEMP_DIR + '/../ebsldtfiles'</ns0:Expression>
</ns0:Value>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDFILE_INP_CLEAN_DIRECTORY</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>Boolean</ns1:Type>
<ns0:Text>false</ns0:Text>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
<ns0:Step>
<ns1:Name>Add any new Files</ns1:Name>
<ns1:StepId>4</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonGITPlugin</ns0:PluginName>
<ns0:PluginOperation>add</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_INSTANCE_CODE</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>GIT1</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_DEST_SUBFOLDER</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>../ebsldtfiles</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_FILELIST</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>--all .</ns0:Text>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
<ns0:Step>
<ns1:Name>Commit to Git</ns1:Name>
<ns1:StepId>5</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonGITPlugin</ns0:PluginName>
<ns0:PluginOperation>commit</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_INSTANCE_CODE</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>GIT1</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_DEST_SUBFOLDER</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>../ebsldtfiles</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_NAME</ns0:Name>
<ns0:ValueType>Expression</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Value>
<ns0:Expression>FD_WF_USER</ns0:Expression>
</ns0:Value>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_EMAIL</ns0:Name>
<ns0:ValueType>Expression</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Value>
<ns0:Expression>FD_WF_USER_EMAIL</ns0:Expression>
</ns0:Value>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_REVISION_MESSAGE</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>new ldt files</ns0:Text>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
<ns0:Step>
<ns1:Name>Push to Central Repository</ns1:Name>
<ns1:StepId>6</ns1:StepId>
<ns0:InvokePlugin>
<ns0:PluginName>FlexagonGITPlugin</ns0:PluginName>
<ns0:PluginOperation>push</ns0:PluginOperation>
<ns0:consumesArtifacts>false</ns0:consumesArtifacts>
<ns0:producesArtifacts>false</ns0:producesArtifacts>
<ns0:PluginInputs>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_INSTANCE_CODE</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>GIT1</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_DEST_SUBFOLDER</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>String</ns1:Type>
<ns0:Text>../ebsldtfiles</ns0:Text>
</ns0:PluginInput>
<ns0:PluginInput>
<ns0:Name>FDGIT_INP_FOLLOW_TAGS</ns0:Name>
<ns0:ValueType>Text</ns0:ValueType>
<ns0:Encrypted>false</ns0:Encrypted>
<ns1:Type>Boolean</ns1:Type>
<ns0:Text>false</ns0:Text>
</ns0:PluginInput>
</ns0:PluginInputs>
<ns0:UserInputs/>
<ns0:PluginOutputs/>
<ns0:UserOutputs/>
</ns0:InvokePlugin>
</ns0:Step>
</ns0:Steps>
</ns0:WorkFlow>
Next step is to setup Topology. If you have not yet created EBS instance, you should follow FlexDeploy EBS Getting Started guide to create EBS Instance. Then make sure to associate Extract LDT workflow with your EBS Instance and Save it. See below. This step will happen on Topology page. (Topology - Instances - select EBS Instance - click Workflows).
Now that we have Workflow and Topology setup completed, last step is create Project for execution. We will create Extract LDT to GIT project. You can create this project in any application of your choice. Make sure to give name that makes sense to you, select Partial Deployments, and select EBS as Project Type.
When you create Project, it will automatically open. Click on Configurations tab and configure as shown in below screen shot.
SCM Type - None
Build Workflow - Extract LDT
Build Instance - EBS (can be different in your setup)
Streams - create more streams as necessary to indicate Git (or other SCM) branches. In this case we will go ahead with master for now.
Click Save.
Ā
Now go to Project Properties. Filter for application and enter Custom Top code and click Save at the bottom of the page.
Ā
Now we can create AOL object definition. This step will repeat for each AOL object that you want to extract from EBS environment. In this example, we are showing LDT files, but you can download other types of files as well.
Select packages tab in the project.
Click File Catalog on the right side.
Click Create
Select Application Object Library for type.
Enter path for output file name for extracted LDT. This path should match with location in Git repository. Otherwise you need to adjust copy in Extract LDT workflow accordingly. Path name will generally end with .ldt.
Click Evaluate.
Change Type and Name as appropriate.
Change any other attributes if necessary.
Click Evaluate.
Click Save.
Ā
You can add more files later if necessary. Now let's execute Build for this project. In this example, I am showing only one file extract but you can run All Files or selectively run for one or more files. Let's start by clicking the Packages tab - Create.
Now,
Select environment where you want to Extract files from. You must make sure that Environment is marked as Build Environment on Topology, otherwise it will not show up here in Environment list.
Select specific Stream (branch) where you want to commit files.
Click Force Build
Click Submit.
You can review execution details as well. Alternatively, you can just download the zip file from Artifacts tab and commit the files yourself after reviewing it, if that makes sense to do so. This guide just provides one example with Git, but you can follow this to commit files to your choice of SCM or rely on developers to commit files to SCM.
- style