Skip to content

Commit e90da16

Browse files
Merge branch 'master' into patch-1
2 parents 173e6d4 + c2cdc91 commit e90da16

File tree

12 files changed

+223
-43
lines changed

12 files changed

+223
-43
lines changed

.circleci/config.yml

Lines changed: 126 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
command: |
5353
go mod vendor
5454
- run: cf login -a $CF_API -o $ORG -s $SPACE -u $TECH_USER -p $TECH_PASS
55-
- run: cd integration && go test -tags=integration
55+
- run: cd integration && go test -tags=integration
5656

5757
compliance:
5858
docker:
@@ -139,6 +139,102 @@ jobs:
139139
export GITHUB_TOKEN=${CLOUD_MTA_BOT_GITHUB_TOKEN}
140140
curl -sfL https://goreleaser.com/static/run | bash
141141
142+
publish-to-dockerhub-java8-node14:
143+
docker:
144+
- image: cimg/go:1.17
145+
working_directory: ~/go/src/github.com/SAP/cloud-mta-build-tool
146+
steps:
147+
- checkout
148+
- setup_remote_docker:
149+
version: 20.10.6
150+
- run:
151+
name: build image pre-setup
152+
command: |
153+
#Make sure HEAD points to master
154+
git checkout master
155+
git fetch
156+
git rebase
157+
- run:
158+
name: build Java 8.1.091 & Node 14.21.1 image
159+
command: |
160+
MBT_VERSION=$(cat ./VERSION)
161+
sh $PWD/scripts/build_image 8.1.091 14.21.1 ${MBT_VERSION}
162+
- run:
163+
name: publish Java 8.1.091 & Node 14.21.1 image
164+
command: |
165+
MBT_VERSION=$(cat ./VERSION)
166+
echo "Image release: ${MBT_VERSION}"
167+
#Push to Docker Hub
168+
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
169+
sh $PWD/scripts/publish_image 8.1.091 14.21.1 ${MBT_VERSION} "devxci"
170+
#Push to GitHub Container Registry
171+
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
172+
sh $PWD/scripts/publish_image 8.1.091 14.21.1 ${MBT_VERSION} "ghcr.io/sap"
173+
174+
publish-to-dockerhub-java8-node16:
175+
docker:
176+
- image: cimg/go:1.17
177+
working_directory: ~/go/src/github.com/SAP/cloud-mta-build-tool
178+
steps:
179+
- checkout
180+
- setup_remote_docker:
181+
version: 20.10.6
182+
- run:
183+
name: build image pre-setup
184+
command: |
185+
#Make sure HEAD points to master
186+
git checkout master
187+
git fetch
188+
git rebase
189+
- run:
190+
name: build Java 8.1.091 & Node 16.18.1 image
191+
command: |
192+
MBT_VERSION=$(cat ./VERSION)
193+
sh $PWD/scripts/build_image 8.1.091 16.18.1 ${MBT_VERSION}
194+
- run:
195+
name: publish Java 8.1.091 & Node 16.18.1 image
196+
command: |
197+
MBT_VERSION=$(cat ./VERSION)
198+
echo "Image release: ${MBT_VERSION}"
199+
#Push to Docker Hub
200+
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
201+
sh $PWD/scripts/publish_image 8.1.091 16.18.1 ${MBT_VERSION} "devxci"
202+
#Push to GitHub Container Registry
203+
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
204+
sh $PWD/scripts/publish_image 8.1.091 16.18.1 ${MBT_VERSION} "ghcr.io/sap"
205+
206+
publish-to-dockerhub-java8-node18:
207+
docker:
208+
- image: cimg/go:1.17
209+
working_directory: ~/go/src/github.com/SAP/cloud-mta-build-tool
210+
steps:
211+
- checkout
212+
- setup_remote_docker:
213+
version: 20.10.6
214+
- run:
215+
name: build image pre-setup
216+
command: |
217+
#Make sure HEAD points to master
218+
git checkout master
219+
git fetch
220+
git rebase
221+
- run:
222+
name: build Java 8.1.091 & Node 18.12.1 image
223+
command: |
224+
MBT_VERSION=$(cat ./VERSION)
225+
sh $PWD/scripts/build_image 8.1.091 18.12.1 ${MBT_VERSION}
226+
- run:
227+
name: publish Java 8.1.091 & Node 18.12.1 image
228+
command: |
229+
MBT_VERSION=$(cat ./VERSION)
230+
echo "Image release: ${MBT_VERSION}"
231+
#Push to Docker Hub
232+
echo "$DOCKER_HUB_TOKEN" | docker login --username $DOCKER_HUB_USER --password-stdin
233+
sh $PWD/scripts/publish_image 8.1.091 18.12.1 ${MBT_VERSION} "devxci"
234+
#Push to GitHub Container Registry
235+
echo "$CLOUD_MTA_BOT_GITHUB_TOKEN" | docker login "ghcr.io" --username $CLOUD_MTA_BOT_USER --password-stdin
236+
sh $PWD/scripts/publish_image 8.1.091 18.12.1 ${MBT_VERSION} "ghcr.io/sap"
237+
142238
publish-to-dockerhub-java11-node14:
143239
docker:
144240
- image: cimg/go:1.17
@@ -157,8 +253,8 @@ jobs:
157253
- run:
158254
name: build Java 11.0.17 & Node 14.21.1 image
159255
command: |
160-
MBT_VERSION=$(cat ./VERSION)
161-
sh $PWD/scripts/build_image 11.0.17 14.21.1 ${MBT_VERSION}
256+
MBT_VERSION=$(cat ./VERSION)
257+
sh $PWD/scripts/build_image 11.0.17 14.21.1 ${MBT_VERSION}
162258
- run:
163259
name: publish Java 11.0.17 & Node 14.21.1 image
164260
command: |
@@ -553,6 +649,30 @@ workflows:
553649
only: /release/
554650
branches:
555651
ignore: /.*/
652+
- publish-to-dockerhub-java8-node14:
653+
requires:
654+
- publish-to-npm
655+
filters:
656+
tags:
657+
only: /release/
658+
branches:
659+
ignore: /.*/
660+
- publish-to-dockerhub-java8-node16:
661+
requires:
662+
- publish-to-npm
663+
filters:
664+
tags:
665+
only: /release/
666+
branches:
667+
ignore: /.*/
668+
- publish-to-dockerhub-java8-node18:
669+
requires:
670+
- publish-to-npm
671+
filters:
672+
tags:
673+
only: /release/
674+
branches:
675+
ignore: /.*/
556676
- publish-to-dockerhub-java11-node14:
557677
requires:
558678
- publish-to-npm
@@ -627,6 +747,9 @@ workflows:
627747
ignore: /.*/
628748
- remove-github-release-tag:
629749
requires:
750+
- publish-to-dockerhub-java8-node14
751+
- publish-to-dockerhub-java8-node16
752+
- publish-to-dockerhub-java8-node18
630753
- publish-to-dockerhub-java11-node14
631754
- publish-to-dockerhub-java11-node16
632755
- publish-to-dockerhub-java11-node18

Dockerfile_mbtci_template

Lines changed: 64 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ FROM debian:bullseye-slim
33
# Build time arguments
44
ARG MTA_USER="mta"
55
ARG MTA_USER_HOME="/home/${MTA_USER}"
6-
ARG MBT_VERSION=1.2.21
6+
ARG MBT_VERSION=1.2.23
77
ARG GO_VERSION=1.19.3
88
ARG NODE_VERSION=NODE_VERSION_TEMPLATE
9-
ARG MAVEN_VERSION=3.8.6
9+
ARG MAVEN_VERSION=3.8.7
1010
ARG MAVEN_BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
1111
ARG SAPMACHINE_VERSION=JAVA_VERSION_TEMPLATE
1212

1313
# Environment variables
1414
ENV PYTHON /usr/bin/python3
15+
ENV JAVA_HOME /opt/jdk
1516
ENV MAVEN_HOME /usr/share/maven
1617
ENV M2_HOME ${MAVEN_HOME}
1718
ENV PATH /usr/local/go/bin:$PATH
@@ -72,12 +73,12 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
7273
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
7374
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \
7475
done \
75-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
76-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
76+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" \
77+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt.asc" \
7778
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
78-
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
79-
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
80-
&& rm -rf "$GNUPGHOME" "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
79+
&& grep " node-v${NODE_VERSION}-linux-${ARCH}.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
80+
&& tar -xJf "node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
81+
&& rm -rf "$GNUPGHOME" "node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
8182
&& apt-mark auto '.*' > /dev/null \
8283
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
8384
| awk '/=>/ { print $(NF-1) }' \
@@ -143,31 +144,59 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
143144
&& go version
144145

145146
# Install SAPMachine
146-
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
147-
&& case "${dpkgArch##*-}" in \
147+
RUN sapmachine_install() { \
148+
SAPMACHINE_MAJOR_VERSION=$(echo ${SAPMACHINE_VERSION} | cut -d. -f1); \
149+
ARCH=; \
150+
dpkgArch="$(dpkg --print-architecture)"; \
151+
case "${dpkgArch##*-}" in \
148152
amd64) ARCH='amd64';; \
149153
*) echo "unsupported architecture"; exit 1 ;; \
150-
esac \
154+
esac; \
155+
apt-get update; \
156+
apt-get install -y ca-certificates gnupg dirmngr --no-install-recommends; \
157+
rm -rf /var/lib/apt/lists/*; \
158+
export GNUPGHOME="$(mktemp -d)"; \
159+
for key in \
160+
CACB9FE09150307D1D22D82962754C3B3ABCFE23 \
161+
; do \
162+
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
163+
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \
164+
done; \
165+
chmod 644 /etc/apt/trusted.gpg.d/sapmachine.gpg; \
166+
echo "deb http://dist.sapmachine.io/debian/${ARCH}/ ./" | tee /etc/apt/sources.list.d/sapmachine.list; \
167+
apt-get update; \
168+
apt-get install -y sapmachine-${SAPMACHINE_MAJOR_VERSION}-jdk=${SAPMACHINE_VERSION} --no-install-recommends; \
169+
rm -rf "$GNUPGHOME" /var/lib/apt/lists/*; \
170+
apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr; \
171+
ln -s /usr/lib/jvm/sapmachine-${SAPMACHINE_MAJOR_VERSION} ${JAVA_HOME}; \
172+
}; \
173+
sapjvm_install() { \
174+
ARCH=; \
175+
dpkgArch="$(dpkg --print-architecture)"; \
176+
case "${dpkgArch##*-}" in \
177+
amd64) ARCH='x64';; \
178+
ppc64el) ARCH='ppc64le';; \
179+
*) echo "unsupported architecture"; exit 1 ;; \
180+
esac; \
181+
apt-get update; \
182+
apt-get install -y ca-certificates curl libarchive-tools --no-install-recommends; \
183+
rm -rf /var/lib/apt/lists/*; \
184+
curl -fsSLO --compressed -b 'eula_3_1_agreed=tools.hana.ondemand.com/developer-license-3_1.txt' https://tools.hana.ondemand.com/additional/sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip; \
185+
echo "583dedfeee0c119839a610ddc8c6768d0c044429 sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip" | sha1sum -c -; \
186+
bsdtar -xvf sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip -C /usr/local --strip-components=1 --no-same-owner; \
187+
rm -f sapjvm-${SAPMACHINE_VERSION}-linux-${ARCH}.zip; \
188+
apt-get remove --purge --auto-remove -y ca-certificates curl libarchive-tools; \
189+
ln -s /usr/local ${JAVA_HOME}; \
190+
} \
151191
&& set -ex \
152-
&& apt-get update \
153-
&& apt-get install -y ca-certificates gnupg dirmngr --no-install-recommends \
154-
&& rm -rf /var/lib/apt/lists/* \
155-
&& export GNUPGHOME="$(mktemp -d)" \
156-
&& for key in \
157-
CACB9FE09150307D1D22D82962754C3B3ABCFE23 \
158-
; do \
159-
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
160-
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/sapmachine.gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" ; \
161-
done \
162-
&& chmod 644 /etc/apt/trusted.gpg.d/sapmachine.gpg \
163-
&& echo "deb http://dist.sapmachine.io/debian/${ARCH}/ ./" | tee /etc/apt/sources.list.d/sapmachine.list \
164-
&& apt-get update \
165-
&& apt-get install -y sapmachine-$(echo ${SAPMACHINE_VERSION} | cut -d. -f1)-jdk=${SAPMACHINE_VERSION} --no-install-recommends \
166-
&& rm -rf "$GNUPGHOME" /var/lib/apt/lists/* \
167-
&& apt-get remove --purge --autoremove -y ca-certificates gnupg dirmngr \
192+
&& if [ $(echo ${SAPMACHINE_VERSION} | cut -d. -f1) -le 8 ]; then \
193+
sapjvm_install; \
194+
else \
195+
sapmachine_install; \
196+
fi \
168197
# smoke test
169198
&& echo "SAPMachine ${SAPMACHINE_VERSION} install smoke test!" \
170-
&& java --version
199+
&& java -version
171200

172201
# Install Maven
173202
RUN set -ex \
@@ -212,6 +241,13 @@ RUN set -ex \
212241
&& python2.7 --version \
213242
&& python3 --version
214243

215-
ENV PATH=$PATH:./node_modules/.bin HOME=${MTA_USER_HOME}
244+
# Allow global npm packages install without sudo
245+
RUN set -ex \
246+
&& mkdir ${MTA_USER_HOME}/.npm-global \
247+
&& mkdir ${MTA_USER_HOME}/.npm-global/lib \
248+
&& chown -R ${MTA_USER}:${MTA_USER} ${MTA_USER_HOME}
249+
ENV NPM_CONFIG_PREFIX ${MTA_USER_HOME}/.npm-global
250+
251+
ENV PATH=$PATH:./node_modules/.bin:${MTA_USER_HOME}/.npm-global/bin
216252
WORKDIR /project
217253
USER ${MTA_USER}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.21
1+
1.2.23

cmd/testdata/mtahtml5/mta.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# ----Executing build for module ui5app -------
1818
# installing module dependencies & execute grunt & remove dev dependencies
19-
(npm install && grunt && npm prune production ) &
19+
(npm install && grunt && npm prune production) &
2020
# wait to the process to finish
2121
wait
2222
# Pack module after build for deployment

configs/version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
cli_version: 1.2.21
1+
cli_version: 1.2.23
22
makefile_version: 0.0.1

docs/docs/index.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ If the MTA Build Tool encounters a module type in the `mta.yaml` file that is no
3030

3131
All resource definitions are passed to the `mtad.yaml` file as is without mapping and validations (for example, if the resource is supported in the target platform or if the specified parameters match the type).
3232

33-
### <b>Creating an MTA Archive According to the MTA Deploymnet Descriptor (`mtad.yaml` file)</b>
33+
### <b>Creating an MTA Archive According to the MTA Deployment Descriptor (`mtad.yaml` file)</b>
34+
35+
The function is provided to assemble multiple modules, which are developed and prebuilt as separate projects, into one MTAR for deployment. The function is implemented by the `mbt assemble` command, which copies all modules, module required dependencies, module build artifacts, and resource definitions into an MTAR, according to the MTA Deployment Descriptor (mtad.yaml file).
36+
37+
If a module doesn’t have the `path` attribute, the assemble process skips it. If a module has the `path` attribute, but its value is invalid, the assemble process fails with the following error: `ERROR could not copy MTA artifacts to assemble: the "<path value>" path does not exist in the MTA project location`.
38+
39+
If a required dependency or resource doesn’t have the `parameters.path` attribute, the assemble process skips it. If a required dependency or resource has the `parameters.path` attribute, but its value is invalid, the assemble process fails with the following error: `ERROR could not copy MTA artifacts to assemble: the "<parameters.path value>" path does not exist in the MTA project location`.
40+
41+
For more details about how to use the MBT assemble command, see [How to build an MTA archive from the modules' build artifacts](https://github.com/SAP/cloud-mta-build-tool/blob/master/docs/docs/usage.md#how-to-build-an-mta-archive-from-the-modules-build-artifacts).
3442

35-
Under construction

integration/testdata/mtahtml5/mta.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# ----Executing build for module ui5app -------
1818
# installing module dependencies & execute grunt & remove dev dependencies
19-
(npm install && grunt && npm prune production ) &
19+
(npm install && grunt && npm prune production) &
2020
# wait to the process to finish
2121
wait
2222
# Pack module after build for deployment

internal/version/version_cfg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package version
22

33
// VersionConfig - do not edit
4-
var VersionConfig = []byte{0x63, 0x6c, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x32, 0x31, 0xa, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0xa}
4+
var VersionConfig = []byte{0x63, 0x6c, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x32, 0x33, 0xa, 0x6d, 0x61, 0x6b, 0x65, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0xa}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mbt",
3-
"version": "1.2.21",
3+
"version": "1.2.23",
44
"description": "[![CircleCI](https://circleci.com/gh/SAP/cloud-mta-build-tool.svg?style=svg&circle-token=ecedd1dce3592adcd72ee4c61481972c32dcfad7)](https://circleci.com/gh/SAP/cloud-mta-build-tool) [![Go Report Card](https://goreportcard.com/badge/github.com/SAP/cloud-mta-build-tool)](https://goreportcard.com/report/github.com/SAP/cloud-mta-build-tool) [![Coverage Status](https://coveralls.io/repos/github/SAP/cloud-mta-build-tool/badge.svg?branch=cover)](https://coveralls.io/github/SAP/cloud-mta-build-tool?branch=cover) ![GitHub license](https://img.shields.io/badge/license-Apache_2.0-blue.svg) ![pre-alpha](https://img.shields.io/badge/Release-pre--alpha-orange.svg)",
55
"main": "index.js",
66
"files": [

scripts/build_image

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ echo "Build mbtci${JAVA_VERSION}${NODE_VERSION}:${MBT_VERSION}"
1919
docker build -t mbtci${JAVA_VERSION}${NODE_VERSION}:${MBT_VERSION} .
2020

2121
# test image
22-
if [ "$JAVA_MAJOR_VERSION" = "11" ] || [ "$JAVA_MAJOR_VERSION" = "17" ] || [ "$JAVA_MAJOR_VERSION" = "19" ]; then
22+
if [ "$JAVA_MAJOR_VERSION" = "8" ] || [ "$JAVA_MAJOR_VERSION" = "11" ] || \
23+
[ "$JAVA_MAJOR_VERSION" = "17" ] || [ "$JAVA_MAJOR_VERSION" = "19" ]; then
2324
cp test/goss/goss_template.yaml test/goss/goss.yaml
2425
sed_i "s/NODE_VERSION_TEMPLATE/${NODE_VERSION_TEMPLATE}/" test/goss/goss.yaml
2526
sed_i "s/JAVA_VERSION_TEMPLATE/${JAVA_VERSION_TEMPLATE}/" test/goss/goss.yaml

0 commit comments

Comments
 (0)