Как сделать несколько сборок для одного исходного кода?
Есть файл assembly для сборки zip файла с конфигами
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/config</directory>
<outputDirectory>config</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/logs</directory>
<outputDirectory>logs</outputDirectory>
</fileSet>
</fileSets>
</assembly>
И есть .gitlab-ci.yml файл для отправки этого zip архива на артефактори
image: maven
before_script:
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings settings.xml"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
key: "$CI_JOB_NAME"
production for dev:
script:
- mvn clean package -Pdev -DskipTests $MAVEN_CLI_OPTS test-compile
- SHA1_CHECKSUM_SKINS=$(shasum -a 1 target/imgconv-dev.zip | awk '{ print $1 }')
- SHA256_CHECKSUM_SKINS=$(sha256sum target/imgconv-dev.zip | awk '{ print $1 }')
- MD5_CHECKSUM_SKINS=$(md5sum target/imgconv-dev.zip | awk '{ print $1 }')
- 'curl -u ...'
only:
- dev
Мне необходимо один jar класть в разные zip архивы и отправлять эти zip архивы с разными названиями на artefactory(сервер где лежат эти zip архивы). Возможно ли во время одной сборки проекта делать два zip файла?
Возможно ли данную проблему решить при помощи spring-cloud?