Skip to content

Commit 6f768d6

Browse files
committed
ID-11: support gateway deployment
1 parent 79e479f commit 6f768d6

17 files changed

+945
-221
lines changed

CHANGELOG.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
= Changelog
22

3+
== Version 0.8.0
4+
[cols="1,2,<10a", options="header"]
5+
|===
6+
|ID|Type|Description
7+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/11[#11]
8+
|Enhancement
9+
|Deployment to gateway via plugin.
10+
11+
The plugin now supports to deploy a project directly via the plugin goal `apigw:deploy`. Only the standard deployment is supported. The deployment of static files and JARs are not supported.
12+
13+
New properties:
14+
15+
* `axway.anm.host`: Host of the Admin Node Manager.
16+
* `axway.anm.port`: Port of the Admin Node Manager (default: 8090).
17+
* `axway.anm.user`: User to connect to the Admin Node Manager (default: admin).
18+
* `axway.anm.password`: Password of the user.
19+
* `axway.deploy.group`: Name of the group the project is deployed to.
20+
* `axway.passphrase.pol`: Passphrase for `.pol` and `.env` packages.
21+
* `axway.passphrase.fed`: Passphrase for `.fed` packages.
22+
* `axway.passphrase.deploy`: Passphrase for deployment group.
23+
* `axway.config.envs`: Path to environmentalized fields configuration file.
24+
* `axway.config.certs`: Path to certificates configuration file.
25+
* `axway.config.props`: Path to properties configuration file.
26+
27+
Deleted properties:
28+
29+
* `axway.passphrase.in`: replaced by `axway.passphrase.pol`
30+
* `axway.passphrase.out`: replaced by `axway.passphrase.out`
31+
* `propertyFile`: replaced by `axway.config.props`
32+
* `certsFile`: replaced by `axway.config.certs`
33+
34+
|===
35+
336
== Version 0.7.0
437

538
[cols="1,2,<10a", options="header"]

README.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ The plugin supports three kind of API Gateway projects:
115115
== Known Limitations
116116

117117
* Documentation is not complete.
118-
* Deployment to API Gateway is currently not supported (on the road map).
119118
* Automatic adding of dependent JARs to PolicyStudio is currently not supported (on the road map).
120119
* Environmentalized fields containing references are not supported.
121120
* Unconfigured envSettings are not detected.

doc/getting-started/getting-started.adoc

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:sectnums:
66
:source-highlighter: prettify
77

8-
:mvn-plugin-ver: 0.7.0
8+
:mvn-plugin-ver: 0.8.0-SNAPSHOT
99

1010
Here you get a simple introduction on how to use the _Maven Plugin for Axway API Gateway_.
1111
It assumes that you are familiar with https://maven.apache.org[Apache Maven] and that you are familiar with PolicyStudio and the API Gateway.
@@ -259,8 +259,17 @@ For building an environment specific API Gateway instance create a separate fold
259259
260260
<name>Hello World (DEV)</name>
261261
262+
<properties>
263+
<!--3-->
264+
<!--
265+
<axway.config.certs>${basedir}/src/main/axwgw/gateway-cert.json</axway.config.certs>
266+
<axway.config.props>${basedir}/src/main/axwgw/gateway-prop.json</axway.config.props
267+
-->
268+
</properties>
269+
270+
262271
<dependencies>
263-
<dependency> <!--3-->
272+
<dependency> <!--4-->
264273
<groupId>com.example</groupId>
265274
<artifactId>hello-world-gw</artifactId>
266275
<version>0.1.0-SNAPSHOT</version>
@@ -270,36 +279,30 @@ For building an environment specific API Gateway instance create a separate fold
270279
271280
<build>
272281
<plugins>
273-
<plugin> <!--4-->
282+
<plugin> <!--5-->
274283
<groupId>com.axway.maven.plugins</groupId>
275284
<artifactId>apigw-maven-plugin</artifactId>
276285
<version>{mvn-plugin-ver}</version>
277286
<extensions>true</extensions>
278-
<configuration>
279-
<!--5-->
280-
<!--
281-
<certsFile>${basedir}/src/main/axwgw/gateway-cert.json</certsFile>
282-
<propertyFile>${basedir}/src/main/axwgw/gateway-prop.json</propertyFile>
283-
-->
284-
</configuration>
285287
</plugin>
286288
</plugins>
287289
</build>
288290
</project>
289291
----
290292
<1> Environment specific artifact, so the name should include the target environment.
291293
<2> The packaging type `axway-deployment-archive` marks it as a deployment project.
292-
<3> Include the dependency of your previously created server archive.
293-
<4> Use _Maven Plugin for API Gateway_ for this project.
294-
<5> Optionally specify additional configuration files.
294+
<3> Optionally specify additional configuration files.
295+
<4> Include the dependency of your previously created server archive.
296+
<5> Use _Maven Plugin for API Gateway_ for this project.
297+
295298

296299
To initialize the project invoke the Maven goal `apigw:init`.
297300

298301
$ mvn apigw:init
299302

300303
This will create a source folder with an empty configuration file.
301304

302-
.src/main/gateway.config.json
305+
.src/main/axwgw/gateway.config.json
303306
[source,json]
304307
----
305308
{}
@@ -317,7 +320,7 @@ As we haven't configured our project yet, the build will fail.
317320

318321
For convenience the plugin will automatically add new fields to the configuration file (see below).
319322

320-
.src/main/gateway.config.json
323+
.src/main/axwgw/gateway.config.json
321324
[source,json]
322325
----
323326
{
@@ -364,13 +367,22 @@ And build your project again.
364367

365368
$ mvn clean package
366369

367-
Now the build succeeds and a deployment archive `hello-world-dev-0.1.0-SNAPSHOT.axdar` containing the `.fed` file will be created.
370+
Now the build succeeds and a deployment archive `hello-world-dev-0.1.0-SNAPSHOT.axdar` containing the `.fed` file is created.
368371

369372
For manual checks via ConfigurationStudio the content of the archive is located in the `target/axway-archive` folder.
370373

371374
== Deployment
372375

373-
Deployment of the gateway is currently not in scope of the plugin.
374-
But it should be very easy to incorporate the deployment archive in your deployment pipeline.
375-
Extract the content of the archive and use the `projdeploy` tool for deployment.
376+
The project can be deployed to a gateway via the plugin.
377+
378+
Just invoke the `apigw:deploy` goal within the deployment project and specify the target domain and group.
379+
380+
In the following example it is assumed that the Admin Node Manager is located at `localhost:8090`.
381+
The user `admin` is allowed to deploy projects and has the password `changeme`.
382+
The project shall be deployed to the group `test`.
383+
384+
$ mvn -Daxway.anm.host=localhost -Daxway.anm.port=8090 \
385+
-Daxway.anm.user=admin -Daxway.anm.password=changeme \
386+
-Daxway.deploy.group=test \
387+
clean apigw:deploy
376388

doc/manual/_reference.adoc

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ This property has to be defined before using the plugin.
173173
Default: _none_
174174

175175
|axway.home.apigw
176-
|Home directory of the installed AI Gateway.
176+
|Home directory of the installed API Gateway.
177177

178178
Default: ${axway.home}/apigateway
179179

@@ -226,6 +226,21 @@ Default: ${axway.home}/apigateway/system/conf/templates/BlankConfiguration-Vorde
226226

227227
Default: ${axway.home}/apigateway/system/conf/templates/BlankNoSettingsConfiguration-VordelGateway.fed
228228

229+
|axway.config.envs
230+
|Path to configuration file for environmentalized fields (required for deployment or deployment projects).
231+
232+
Default: ${axway.dir.source}/gateway.config.json _(only for deployment projects)_
233+
234+
|axway.config.certs
235+
|Path to configuration file for certificates (required for deployment or deployment projects).
236+
237+
Default: _none_
238+
239+
|axway.config.props
240+
|Path to configuration file for properties (required for deployment or deployment projects).
241+
242+
Default: _none_
243+
229244
|axway.tools.cfg.verbose
230245
|Set to _true_ to enable verbose mode for internal configuration tool.
231246

@@ -247,18 +262,46 @@ This property can be used to enable the previous behavior.
247262

248263
Default: false
249264

250-
|axway.passphrase.in
251-
|Passphrase for reading input (`.pol`, `.env`) packages.
252-
Applicable to deployment projects only.
265+
|axway.passphrase.pol
266+
|Passphrase for reading or generating `.pol` and `.env` packages.
267+
268+
Default: _no passphrase_
269+
270+
|axway.passphrase.fed
271+
|Passphrase for reading or writing `.fed` packages.
253272

254273
Default: _no passphrase_
255274

256-
|axway.passphrase.out
257-
|Passphrase for writing output (`.pol`, `.env`, `.fed`) packages.
258-
Applicable to server and deployment projects.
275+
|axway.passphrase.deploy
276+
|Passphrase for gateway deployment.
259277

260278
Default: _no passphrase_
261279

280+
|axway.anm.host
281+
|Host of Admin Node Manager (required for deployment only)
282+
283+
Default: _none_
284+
285+
|axway.anm.port
286+
|Port of Admin Node Manager (required for deployment only)
287+
288+
Default: 8090
289+
290+
|axway.anm.user
291+
|Admin user for Admin Node Manager (required for deployment only)
292+
293+
Default: admin
294+
295+
|axway.anm.password
296+
|Password word Admin Node Manager (required for deployment only)
297+
298+
Default: _none_
299+
300+
|axway.deploy.group
301+
|Group the projects have to be deployed to (required for deployment only)
302+
303+
Default: _none_
304+
262305
|axway.skipPackaging
263306
|Set to _true_ to skip `package` goal in case of the target artifact already exists.
264307

doc/manual/_usage.adoc

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,98 @@ To deploy the generated project archive to the remote repository use the `deploy
177177

178178
$ mvn clean deploy
179179

180+
== Deploy Project to API Gateway
181+
182+
To install the project to a gateway instance the goal `apigw:deploy` is used.
183+
It only supports a standard deployment.
184+
Deployment of static files or JARs are not supported.
185+
186+
For deployment following properties are used:
187+
188+
[cols="1,<5a,1", options="header"]
189+
|===
190+
|Property|Description|Mandatory
191+
192+
|`axway.anm.host`
193+
|Host of the Admin Node Manager.
194+
|yes
195+
196+
|`axway.anm.port`
197+
|Port of the Admin Node Manager (default: 8090).
198+
|no
199+
200+
|`axway.anm.user`
201+
|User to connect to the Admin Node Manager (default: admin).
202+
|no
203+
204+
|`axway.anm.password`
205+
|Password of the user.
206+
|yes
207+
208+
|`axway.deploy.group`
209+
|Name of the group the project is deployed to.
210+
|yes
211+
212+
|`axway.passphrase.pol`
213+
|Passphrase for `.pol` and `.env` packages.
214+
|no
215+
216+
|`axway.passphrase.fed`
217+
|Passphrase for `.fed` packages.
218+
|no
219+
220+
|`axway.passphrase.deploy`
221+
|Passphrase for deployment group.
222+
|no
223+
224+
|`axway.config.envs`
225+
|Path to environmentalized fields configuration file.
226+
|yes
227+
228+
|`axway.config.certs`
229+
|Path to certificates configuration file.
230+
|no
231+
232+
|`axway.config.props`
233+
|Path to properties configuration file.
234+
|no
235+
|===
236+
237+
Example:
238+
239+
$ mvn -Daxway.anm.host=localhost -Daxway.anm.password=changeme -Daxway.deploy.group=test -Daxway.config.envs=gateway.config.json clean apigw:deploy
240+
241+
=== Policy Projects
242+
243+
For policy projects the test server which is included in the project is deployed.
244+
245+
Steps:
246+
247+
. Execute `package` lifecycle.
248+
. Build `.pol` and `.env` packages.
249+
. Build and configure `.fed` package.
250+
. Deploy `.fed` package to gateway
251+
252+
=== Server Projects
253+
254+
For server projects the generated `.pol` and `.env` packages are deployed.
255+
256+
Steps:
257+
258+
. Execute `package` lifecycle.
259+
. Build and configure `.fed` package from `.pol` and `.env` packages.
260+
. Deploy `.fed` package to gateway
261+
262+
=== Deployment Projects
263+
264+
For deployment projects the `.fed` package of the generated artifact is deployed.
265+
266+
Steps:
267+
268+
. Execute `package` lifecycle.
269+
. Deploy `.fed` package to gateway
270+
271+
180272
== Miscellaneous
181273

182274
=== Standalone Configuration Tools
@@ -221,4 +313,8 @@ This section provides a short overview of the goals supported by the Maven plugi
221313
|apigw:tools
222314
|Extract the scripts of the configuration tools to the target directory.
223315
|yes|yes|yes
316+
317+
|apigw:deploy
318+
|Deploy project to a gateway.
319+
|yes|yes|yes
224320
|===

doc/manual/user-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ifdef::env-github[]
1818
:warning-caption: :warning:
1919
endif::[]
2020

21-
:mvn-plugin-ver: 0.7.0
21+
:mvn-plugin-ver: 0.8.0-SNAPSHOT
2222

2323
== About the Plugin
2424

example/getting-started/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<packaging>pom</packaging>
88

99
<properties>
10-
<axway.maven.plugin.ver>0.7.0</axway.maven.plugin.ver>
10+
<axway.maven.plugin.ver>0.8.0-SNAPSHOT</axway.maven.plugin.ver>
1111
</properties>
1212

1313
<modules>

0 commit comments

Comments
 (0)