Skip to content

Commit

Permalink
Merge pull request #134 from electric-cloud/FLOWPLUGIN-7818
Browse files Browse the repository at this point in the history
Using extract and classifier
  • Loading branch information
imago-storm authored Oct 15, 2020
2 parents dcfdc1e + f7bcc78 commit e792a54
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 171 deletions.
2 changes: 1 addition & 1 deletion META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>EC-Docker</key>
<configure>ec_config</configure>
<label>EC-Docker</label>
<version>1.6.3</version>
<version>1.6.4</version>
<hasAdoc>true</hasAdoc>

<detailedDescription>Docker is an open platform for developing, shipping, and running applications. Docker is designed to deliver your applications faster: you can separate your applications from your infrastructure and treat your infrastructure like a managed application. Docker helps you ship code faster, test faster, deploy faster, and shorten the cycle between writing code and deploying it.
Expand Down
16 changes: 16 additions & 0 deletions dsl/procedures/artifact2image/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@
<documentation>Artifact extension, e.g. jar or war. Required if retrieving from Artifactory.</documentation>
<required>0</required>
</formElement>
<formElement>
<type>entry</type>
<label>Artifactory Classifier:</label>
<property>ecp_docker_artifactoryClassifier</property>
<documentation>Classifier to use with Artifactory, e.g. sources.</documentation>
<required>0</required>
</formElement>
<formElement>
<type>checkbox</type>
<label>Artifactory Extract Archive:</label>
<property>ecp_docker_artifactoryExtract</property>
<documentation>Check to extract archive downloaded from Artifactory.</documentation>
<required>0</required>
<checkedValue>1</checkedValue>
<uncheckedValue>0</uncheckedValue>
</formElement>
<formElement>
<type>entry</type>
<required>1</required>
Expand Down
2 changes: 2 additions & 0 deletions dsl/procedures/artifact2image/steps/artifact2image.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ String env = '''$[ecp_docker_env]'''.trim()
String artifactFileLocation = '''$[ecp_docker_artifactLocation]'''.trim()
boolean removeAfterPush = '$[ecp_docker_removeAfterPush]'.trim() == "true"



ElectricFlow ef = new ElectricFlow()
EFClient efClient = new EFClient()

Expand Down
17 changes: 14 additions & 3 deletions dsl/procedures/artifact2image/steps/downloadArtifact.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
my $artifactName = getParam('artifactName');
my $location = getParam('artifactLocation');
my $artifactoryConfig = getParam('artifactoryConfigName');
my $classifier = getParam('artifactoryClassifier');
my $extract = getParam('artifactoryExtract');

if ($artifactName) {
my $versionRange = getParam('versionRange');
Expand Down Expand Up @@ -54,7 +56,7 @@ sub retrieveArtifactFromArtifactory {
my $actualParameters = [];
for my $artifactoryParamName (keys %$parameters) {
my $value = getParam($parameters->{$artifactoryParamName});
if (!$value && $artifactoryParamName != 'version') {
if (!$value && $artifactoryParamName ne 'version') {
print qq{Parameter "$parameters->{$artifactoryParamName}" is required\n};
exit -1;
}
Expand All @@ -73,13 +75,19 @@ sub retrieveArtifactFromArtifactory {
actualParameterName => 'destination',
value => $destination,
};
push @$actualParameters, {
actualParameterName => 'classifier',
value => $classifier,
};

my $repoType = getParam("artifactoryRepoType");
if ($repoType eq 'NuGet' || $repoType eq 'Generic') {
if ($repoType eq 'NuGet' || $repoType eq 'Generic' || $extract eq '1') {

push @$actualParameters, {
value => '1',
actualParameterName => 'extract'
};

}

my $version = getParam('artifactoryVersion');
Expand All @@ -103,6 +111,9 @@ sub retrieveArtifactFromArtifactory {
actualParameterName => 'resultPropertySheet',
value => $destinationProperty,
};

print "Running Retrieve with\n";
print Dumper $actualParameters;
my $xpath = $ec->createJobStep({
subprocedure => 'Retrieve Artifact from Artifactory',
subproject => '/plugins/EC-Artifactory/project',
Expand Down Expand Up @@ -177,4 +188,4 @@ sub getParam {

my $xpath = $ec->getProperty("ecp_docker_$paramName");
return $xpath->findvalue('//value')->string_value;
}
}
54 changes: 28 additions & 26 deletions help/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@
1.2.0:
- |
Added support for deploying micro-services modeled in ElectricFlow to Docker. Deploying micro-services to the following Docker environments are supported:
<ul>
<li>Stand-alone Docker instances</li>
<li>Docker Swarm</li>
<li>Docker Enterprise Edition</li>
<li>Windows Docker containers on Windows 2016</li>
<li>Docker Swarm</li>
<li>Docker Enterprise Edition</li>
<li>Windows Docker containers on Windows 2016</li>
</ul>
* Stand-alone Docker instances
* Docker Swarm
* Docker Enterprise Edition
* Windows Docker containers on Windows 2016
* Docker Swarm
* Docker Enterprise Edition
* Windows Docker containers on Windows 2016
- Added procedure <i>Undeploy Service</i> to undeploy a previously deployed service.
- Added procedure <i>Remove Docker Service</i> to remove a service running on a stand-alone Docker host or a Docker Swarm cluster.
- Added procedure _Undeploy Service_ to undeploy a previously deployed service.
- Added procedure _Remove Docker Service_ to remove a service running on a stand-alone Docker host or a Docker Swarm cluster.
- Removed support for using EC-Docker as a 'component' plugin. Micro-services based applications should be modeled as applications with services. The services can then be deployed using the native ElectricFlow services deployment capability.
1.2.1:
- |
Added support for Docker network creation.
<ul>
<li>For Stand-alone Docker instances, <i>Deploy Service</i> procedure creates a user defined bridge network if network name given in service mapping page. Procedure uses this network to deploy containers.</li>
<li>For Docker Swarm instances, <i>Deploy Service</i> procedure creates a user defined overlay network if network name given in service mapping page. Procedure uses this network to deploy Docker Swarm services.</li>
</ul>
* For Stand-alone Docker instances, _Deploy Service_ procedure creates a user defined bridge network if network name given in service mapping page. Procedure uses this network to deploy containers.
* For Docker Swarm instances, _Deploy Service_ procedure creates a user defined overlay network if network name given in service mapping page. Procedure uses this network to deploy Docker Swarm services.
1.2.2:
- Registered the <i>Undeploy Service</i> procedure as an <i>Undeploy Service</i> operation to enable undeploying micro-services modeled in ElectricFlow from Docker using the service process.
- Added <i>Create Ingress</i> and <i>Delete Network</i> procedures.
- Registered the _Undeploy Service_ procedure as an _Undeploy Service_ operation to enable undeploying micro-services modeled in ElectricFlow from Docker using the service process.
- Added _Create Ingress_ and _Delete Network_ procedures.
- Added support for container update on standalone docker engine.
- Added support for attaching additional networks during container update.
1.3.0:
- Added <i>Import Microservices</i> procedure which can be used through the <i>Import Docker Compose file</i> catalog item in the <i>Containers</i> service catalog for creating microservice models in ElectricFlow.
- Added <i>Artifact2Image</i> procedure.
- Discover procedure is <i>Deprecated</i>. Use the <i>Import Microservices</i> procedure to create microservice models based on the given Docker Compose file contents
- Added support for retrieving and creating the plugin configurations through the <i>Configurations</i> option on the application process step and the pipeline stage task editors.
- Added _Import Microservices_ procedure which can be used through the _Import Docker Compose file_ catalog item in the _Containers_ service catalog for creating microservice models in ElectricFlow.
- Added _Artifact2Image_ procedure.
- Discover procedure is _Deprecated_. Use the _Import Microservices_ procedure to create microservice models based on the given Docker Compose file contents
- Added support for retrieving and creating the plugin configurations through the _Configurations_ option on the application process step and the pipeline stage task editors.
1.4.0:
- Previously deprecated <i>Discover</i> procedure has been removed. Use the <i>Import Microservices</i> procedure to create microservice models based on the given Docker Compose file contents.
- Fixed the report link for unsupported tags that were not processed by the <i>Import Microservices</i>.
- Previously deprecated _Discover_ procedure has been removed. Use the _Import Microservices_ procedure to create microservice models based on the given Docker Compose file contents.
- Fixed the report link for unsupported tags that were not processed by the _Import Microservices_.
- Configured the plugin to allow the ElectricFlow UI to create configs inline of procedure form.
1.5.0:
- Plugin promotion time has been improved.
Expand All @@ -46,13 +46,15 @@
1.5.2:
- Images in the help file have been fixed.
1.5.3:
- Renaming from "Electric Cloud" to "CloudBees".
- Renaming to "CloudBees".
1.6.0:
- Provisioning of Binary Dependencies (for example Grape jars) in the agent resource, required by this plugin, is now delivered through a newly introduced mechanism called Plugin Dependency Management. Binary dependencies will now be seamlessly delivered to the agent resource from the Flow Server, any time a new version of a plugin is invoked the first time. Flow Repository set up is no longer required for this plugin.
- Add checking connection while creating/editing a configuration.
1.6.1:
- Renaming from "CloudBees Flow" to "CloudBees CD"
- Renaming to "CloudBees CD"
1.6.2:
- Upgrading dependecies to address security issues.
1.6.3:
- The documentation has been migrated to the main site.
- The documentation has been migrated to the main site.
1.6.4:
- Support for "Artifactory Classifier" and "Artifactory Extract" fields was added to the Artifact2Image procedure
Loading

0 comments on commit e792a54

Please sign in to comment.