Skip to content

Commit

Permalink
Upgrade MBT Maven Builder Default Command to Batch Mode (#1062)
Browse files Browse the repository at this point in the history
(1)upgrade mbt maven builder default command from  “mvn clean package” to “mvn -B clean package”.

(2)fix binwrap install problem from @wangshen-sap 

(3) upgrade sap-jvm version from 8.1.094 to 8.1.095
  • Loading branch information
young-yang03 authored Aug 29, 2023
1 parent c9909db commit 72a31d2
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,21 @@ jobs:
git fetch
git rebase
- run:
name: build Java 8.1.094 & Node 14.21.1 image
name: build Java 8.1.095 & Node 14.21.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
sh $PWD/scripts/build_image 8.1.094 14.21.1 ${MBT_VERSION}
sh $PWD/scripts/build_image 8.1.095 14.21.1 ${MBT_VERSION}
- run:
name: publish Java 8.1.094 & Node 14.21.1 image
name: publish Java 8.1.095 & Node 14.21.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
echo "Image release: ${MBT_VERSION}"
#Push to Docker Hub
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 14.21.1 ${MBT_VERSION} "devxci"
sh $PWD/scripts/publish_image 8.1.095 14.21.1 ${MBT_VERSION} "devxci"
#Push to GitHub Container Registry
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 14.21.1 ${MBT_VERSION} "ghcr.io/sap"
sh $PWD/scripts/publish_image 8.1.095 14.21.1 ${MBT_VERSION} "ghcr.io/sap"
publish-to-dockerhub-java8-node16:
docker:
Expand All @@ -193,21 +193,21 @@ jobs:
git fetch
git rebase
- run:
name: build Java 8.1.094 & Node 16.18.1 image
name: build Java 8.1.095 & Node 16.18.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
sh $PWD/scripts/build_image 8.1.094 16.18.1 ${MBT_VERSION}
sh $PWD/scripts/build_image 8.1.095 16.18.1 ${MBT_VERSION}
- run:
name: publish Java 8.1.094 & Node 16.18.1 image
name: publish Java 8.1.095 & Node 16.18.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
echo "Image release: ${MBT_VERSION}"
#Push to Docker Hub
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 16.18.1 ${MBT_VERSION} "devxci"
sh $PWD/scripts/publish_image 8.1.095 16.18.1 ${MBT_VERSION} "devxci"
#Push to GitHub Container Registry
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 16.18.1 ${MBT_VERSION} "ghcr.io/sap"
sh $PWD/scripts/publish_image 8.1.095 16.18.1 ${MBT_VERSION} "ghcr.io/sap"
publish-to-dockerhub-java8-node18:
docker:
Expand All @@ -225,21 +225,21 @@ jobs:
git fetch
git rebase
- run:
name: build Java 8.1.094 & Node 18.16.1 image
name: build Java 8.1.095 & Node 18.16.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
sh $PWD/scripts/build_image 8.1.094 18.16.1 ${MBT_VERSION}
sh $PWD/scripts/build_image 8.1.095 18.16.1 ${MBT_VERSION}
- run:
name: publish Java 8.1.094 & Node 18.16.1 image
name: publish Java 8.1.095 & Node 18.16.1 image
command: |
MBT_VERSION=$(cat ./VERSION)
echo "Image release: ${MBT_VERSION}"
#Push to Docker Hub
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 18.16.1 ${MBT_VERSION} "devxci"
sh $PWD/scripts/publish_image 8.1.095 18.16.1 ${MBT_VERSION} "devxci"
#Push to GitHub Container Registry
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
sh $PWD/scripts/publish_image 8.1.094 18.16.1 ${MBT_VERSION} "ghcr.io/sap"
sh $PWD/scripts/publish_image 8.1.095 18.16.1 ${MBT_VERSION} "ghcr.io/sap"
publish-to-dockerhub-java11-node14:
docker:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_mbtci_template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG MTA_USER_HOME="/home/${MTA_USER}"
ARG MBT_VERSION=1.2.24
ARG GO_VERSION=1.19.3
ARG NODE_VERSION=NODE_VERSION_TEMPLATE
ARG MAVEN_VERSION=3.9.3
ARG MAVEN_VERSION=3.9.4
ARG UI5_VERSION=2.14.19
ARG MAVEN_BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
ARG SAPMACHINE_VERSION=JAVA_VERSION_TEMPLATE
Expand Down
10 changes: 5 additions & 5 deletions cmd/testdata/mta/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ _schema-version: '2.1'
version: 0.0.1

modules:
- name: node-js
type: nodejs
path: node-js
provides:
- name: node-js
type: nodejs
path: node-js
provides:
- name: node-js_api
properties:
url: ${default-url}
url: ${default-url}
2 changes: 1 addition & 1 deletion configs/builder_type_cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ builders:
info: "build java application"
path: "path to config file which override the following default commands"
commands:
- command: mvn clean package
- command: mvn -B clean package
build-result: target/*.war

- name: fetcher
Expand Down
25 changes: 25 additions & 0 deletions docs/docs/whatsnew.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# <b>Important updates</b>

## v1.2.25

### Configuration of `maven` builder has changed.
As of version 1.2.25, the `mvn -B clean package` command is used where the `maven` builder is configured for building a module or in a global build step.

By adding the -B parameter, the "maven clean package" command will start in interactive mode.

As a build tool, MBT builds the MTA (Multitarget Application), which contains many types of modules. Each module is built by corresponding builder, such as maven, npm and golang.

When the MTA is built, all build processes for different modules are packaged into the MBT. It wraps all the build processes as internal and it should not run in interactive mode. It is reasonable for MBT to execute the build process in batch mode.

<b>NOTE:</b> The `maven` builder is configured implicitly for the `java` module type.

If you want to keep the previous behavior, that is, to apply the `mvn clean package` command, you need to change the build parameters of the relevant module by configuring the `custom` builder:
```yaml

- name: mymodule
...
build-parameters:
builder: custom
commands:
- mvn clean package
build-result: target/*.war
```
## v1.1.0
### Configuration of `maven` builder has changed.
Expand Down
Loading

0 comments on commit 72a31d2

Please sign in to comment.