|
432 | 432 | </plugins> |
433 | 433 | </build> |
434 | 434 | </profile> |
| 435 | + |
| 436 | + <profile> |
| 437 | + <!-- NOTE(AR) Profile to build a Docker Image --> |
| 438 | + <id>docker</id> |
| 439 | + <properties> |
| 440 | + <!-- directory that contains the filtered Dockerfile --> |
| 441 | + <docker.dir>${project.build.directory}/docker</docker.dir> |
| 442 | + <!-- directory for placing files that will be added to the Docker Image --> |
| 443 | + <docker.context.dir>${project.build.directory}/docker-context</docker.context.dir> |
| 444 | + </properties> |
| 445 | + <build> |
| 446 | + <plugins> |
| 447 | + <plugin> |
| 448 | + <groupId>org.apache.maven.plugins</groupId> |
| 449 | + <artifactId>maven-resources-plugin</artifactId> |
| 450 | + <executions> |
| 451 | + <execution> |
| 452 | + <id>process-dockerfile</id> |
| 453 | + <phase>process-resources</phase> |
| 454 | + <goals> |
| 455 | + <goal>copy-resources</goal> |
| 456 | + </goals> |
| 457 | + <configuration> |
| 458 | + <resources> |
| 459 | + <resource> |
| 460 | + <directory>src/main/docker</directory> |
| 461 | + <filtering>true</filtering> |
| 462 | + </resource> |
| 463 | + </resources> |
| 464 | + <outputDirectory>${docker.dir}</outputDirectory> |
| 465 | + </configuration> |
| 466 | + </execution> |
| 467 | + </executions> |
| 468 | + </plugin> |
| 469 | + <plugin> |
| 470 | + <groupId>org.exist-db.maven.plugins</groupId> |
| 471 | + <artifactId>public-xar-repo-plugin</artifactId> |
| 472 | + <executions> |
| 473 | + <execution> |
| 474 | + <id>fetch-xars</id> |
| 475 | + <phase>generate-resources</phase> |
| 476 | + <goals> |
| 477 | + <goal>resolve</goal> |
| 478 | + </goals> |
| 479 | + <configuration> |
| 480 | + <repoUri>${public.xar.repo.uri}</repoUri> |
| 481 | + <outputDirectory>${docker.context.dir}</outputDirectory> |
| 482 | + <existDbVersion>${project.version}</existDbVersion> |
| 483 | + <packages> |
| 484 | + <package> |
| 485 | + <abbrev>templating</abbrev> |
| 486 | + <version>${html-templating.xar.version}</version> |
| 487 | + </package> |
| 488 | + <package> |
| 489 | + <abbrev>githubxq</abbrev> |
| 490 | + <version>${githubxq.xar.version}</version> |
| 491 | + </package> |
| 492 | + <package> |
| 493 | + <abbrev>crypto</abbrev> |
| 494 | + <version>${crypto.xar.version}</version> |
| 495 | + </package> |
| 496 | + <package> |
| 497 | + <abbrev>exist-sparql</abbrev> |
| 498 | + <version>${sparql.xar.version}</version> |
| 499 | + </package> |
| 500 | + </packages> |
| 501 | + </configuration> |
| 502 | + </execution> |
| 503 | + </executions> |
| 504 | + </plugin> |
| 505 | + <plugin> |
| 506 | + <groupId>com.evolvedbinary.maven.mfrey</groupId> |
| 507 | + <artifactId>copy-maven-plugin</artifactId> |
| 508 | + <configuration> |
| 509 | + <showfiles>true</showfiles> |
| 510 | + </configuration> |
| 511 | + <executions> |
| 512 | + <execution> |
| 513 | + <id>copy-xar-to-docker-context</id> |
| 514 | + <phase>package</phase> |
| 515 | + <goals> |
| 516 | + <goal>copy</goal> |
| 517 | + </goals> |
| 518 | + <configuration> |
| 519 | + <resources> |
| 520 | + <resource> |
| 521 | + <workOnFullPath>true</workOnFullPath> |
| 522 | + <directory>${project.build.directory}</directory> |
| 523 | + <includes>*.xar</includes> |
| 524 | + <paths> |
| 525 | + <path> |
| 526 | + <from>${project.build.directory}</from> |
| 527 | + <to>${docker.context.dir}</to> |
| 528 | + </path> |
| 529 | + </paths> |
| 530 | + <replaceExisting>true</replaceExisting> |
| 531 | + </resource> |
| 532 | + </resources> |
| 533 | + </configuration> |
| 534 | + </execution> |
| 535 | + </executions> |
| 536 | + </plugin> |
| 537 | + <plugin> |
| 538 | + <groupId>io.fabric8</groupId> |
| 539 | + <artifactId>docker-maven-plugin</artifactId> |
| 540 | + <configuration> |
| 541 | + <verbose>true</verbose> |
| 542 | + <images> |
| 543 | + <image> |
| 544 | + <name>srophe/srophe:%v</name> |
| 545 | + <alias>srophe</alias> |
| 546 | + <build> |
| 547 | + <tags> |
| 548 | + <tag>latest</tag> |
| 549 | + </tags> |
| 550 | + <dockerFile>${docker.dir}/Dockerfile</dockerFile> |
| 551 | + <contextDir>${docker.context.dir}</contextDir> |
| 552 | + <buildx> |
| 553 | + <platforms> |
| 554 | + <platform>linux/amd64</platform> |
| 555 | + <platform>linux/arm64</platform> |
| 556 | + </platforms> |
| 557 | + </buildx> |
| 558 | + </build> |
| 559 | + </image> |
| 560 | + </images> |
| 561 | + </configuration> |
| 562 | + <executions> |
| 563 | + <execution> |
| 564 | + <id>build-image</id> |
| 565 | + <phase>package</phase> |
| 566 | + <goals> |
| 567 | + <goal>build</goal> |
| 568 | + </goals> |
| 569 | + </execution> |
| 570 | + <execution> |
| 571 | + <id>push-image</id> |
| 572 | + <phase>deploy</phase> |
| 573 | + <goals> |
| 574 | + <goal>push</goal> |
| 575 | + </goals> |
| 576 | + </execution> |
| 577 | + </executions> |
| 578 | + </plugin> |
| 579 | + </plugins> |
| 580 | + </build> |
| 581 | + </profile> |
435 | 582 | </profiles> |
436 | 583 |
|
437 | 584 | <pluginRepositories> |
|
0 commit comments