mbt 1.2.2 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -23
- package/index.js +1 -0
- package/package.json +1 -1
- package/bin/mbt +0 -45
package/README.md
CHANGED
|
@@ -36,49 +36,92 @@ This demo shows the basic usage of the tool. For more advanced scenarios, follow
|
|
|
36
36
|
</p>
|
|
37
37
|
|
|
38
38
|
#### The Cloud MTA Build Tool Images
|
|
39
|
-
|
|
40
|
-
The images are
|
|
39
|
+
We supply serveral images for **CI environment** containg the Cloud MTA Build Tool. The images are hosted at [Github container registry](https://github.com/orgs/SAP/packages?tab=packages&q=mbtci-) and also at [Docker Hub registry](https://hub.docker.com/search?q=mbtci-&type=image).
|
|
40
|
+
The images are built from template docker files which depend on most common technologies (Java and Node) as follows:
|
|
41
|
+
* [mbtci-java8-node12](https://hub.docker.com/r/devxci/mbtci-java8-node12) is built from [Dockerfile_mbtci_java8](https://github.com/SAP/cloud-mta-build-tool/blob/master/Dockerfile_mbtci_java8) using Node 12.
|
|
42
|
+
* [mbtci-java8-node14](https://hub.docker.com/r/devxci/mbtci-java8-node14) is built from [Dockerfile_mbtci_java8](https://github.com/SAP/cloud-mta-build-tool/blob/master/Dockerfile_mbtci_java8) using Node 14.
|
|
43
|
+
* [mbtci-java11-node12](https://hub.docker.com/r/devxci/mbtci-java11-node12) is built from [Dockerfile_mbtci_java11](https://github.com/SAP/cloud-mta-build-tool/blob/master/Dockerfile_mbtci_java11) using Node 12.
|
|
44
|
+
* [mbtci-java11-node14](https://hub.docker.com/r/devxci/mbtci-java11-node14) is built from [Dockerfile_mbtci_java11](https://github.com/SAP/cloud-mta-build-tool/blob/master/Dockerfile_mbtci_java14) using Node 14.
|
|
45
|
+
|
|
46
|
+
Additional image which is more light-weight and gives the flexibility to add "per-scenario" the required set of tools:
|
|
47
|
+
* [mbtci-alpine](https://hub.docker.com/r/devxci/mbtci-alpine) is built from [Dockerfile_mbtci_alpine](https://github.com/SAP/cloud-mta-build-tool/blob/master/Dockerfile_mbtci_alpine).
|
|
48
|
+
|
|
49
|
+
##### How to pull the images
|
|
50
|
+
You should choose the relevant image type from following list to replace the `<TYPE>` template in the command/FROM according your MTA project technologies:
|
|
51
|
+
* java8-node12
|
|
52
|
+
* java8-node14
|
|
53
|
+
* java11-node12
|
|
54
|
+
* java11-node14
|
|
55
|
+
* alpine
|
|
41
56
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
From the command line:
|
|
58
|
+
```
|
|
59
|
+
$ docker pull devxci/mbtci-<TYPE>:latest
|
|
60
|
+
```
|
|
61
|
+
or
|
|
62
|
+
```
|
|
63
|
+
$ docker pull ghcr.io/sap/mbtci-<TYPE>:latest
|
|
64
|
+
```
|
|
47
65
|
|
|
48
|
-
|
|
66
|
+
From Dockerfile as a base image:
|
|
67
|
+
```
|
|
68
|
+
FROM devxci/mbtci-<TYPE>:latest
|
|
69
|
+
```
|
|
70
|
+
or
|
|
71
|
+
```
|
|
72
|
+
FROM ghcr.io/sap/mbtci-<TYPE>:latest
|
|
73
|
+
```
|
|
49
74
|
|
|
50
|
-
|
|
75
|
+
E.g. if your MTA project uses Java 11 and Node 14 then you should pull the relevant image as follows:
|
|
76
|
+
|
|
77
|
+
From the command line:
|
|
51
78
|
```
|
|
52
|
-
$ docker pull devxci/mbtci-
|
|
79
|
+
$ docker pull devxci/mbtci-java11-node14:latest
|
|
53
80
|
```
|
|
54
81
|
or
|
|
55
82
|
```
|
|
56
|
-
$ docker pull ghcr.io/sap/mbtci-
|
|
83
|
+
$ docker pull ghcr.io/sap/mbtci-java11-node14:latest
|
|
57
84
|
```
|
|
58
|
-
|
|
85
|
+
|
|
86
|
+
From Dockerfile as a base image:
|
|
59
87
|
```
|
|
60
|
-
FROM devxci/mbtci-
|
|
88
|
+
FROM devxci/mbtci-java11-node14:latest
|
|
61
89
|
```
|
|
62
90
|
or
|
|
63
91
|
```
|
|
64
|
-
FROM ghcr.io/sap/mbtci-
|
|
92
|
+
FROM ghcr.io/sap/mbtci-java11-node14:latest
|
|
65
93
|
```
|
|
66
94
|
|
|
67
|
-
##### How to use the
|
|
95
|
+
##### How to use the images
|
|
96
|
+
You should choose the relevant image type from following list to replace the `<TYPE>` template in the command according your MTA project technologies:
|
|
97
|
+
* java8-node12
|
|
98
|
+
* java8-node14
|
|
99
|
+
* java11-node12
|
|
100
|
+
* java11-node14
|
|
101
|
+
* alpine
|
|
102
|
+
|
|
68
103
|
On a Linux/Darwin machine you can run:
|
|
69
104
|
```
|
|
70
|
-
docker run -it --rm -v "$(pwd)/[proj-releative-path]:/project" devxci/mbtci
|
|
105
|
+
docker run -it --rm -v "$(pwd)/[proj-releative-path]:/project" devxci/mbtci-<TYPE>:latest mbt build -p=cf -t [target-folder-name]
|
|
71
106
|
```
|
|
72
107
|
This will build an mtar file for SAP Cloud Platform (Cloud Foundry). The folder containing the project needs to be mounted into the image at /project.
|
|
73
108
|
|
|
74
109
|
<b>Note:</b> The parameter `-p=cf` can be omitted as the build for cloud foundry is the default build, this is an example of the MBT build parameters, for further commands see MBT docs.
|
|
75
110
|
|
|
76
|
-
##### How to build the
|
|
77
|
-
|
|
111
|
+
##### How to build the images
|
|
112
|
+
To buid the images, you should choose the relevant docker file type from following list to replace the `<TYPE>` template in the Dockerfile according your MTA project Java version:
|
|
113
|
+
* java8
|
|
114
|
+
* java11
|
|
115
|
+
|
|
116
|
+
Copy the docker file template:
|
|
117
|
+
```
|
|
118
|
+
cp Dockerfile_<TYPE> Dockerfile
|
|
78
119
|
```
|
|
79
|
-
|
|
120
|
+
E.g. copy the docker file used for Java 8:
|
|
80
121
|
```
|
|
81
|
-
|
|
122
|
+
cp Dockerfile_java8 Dockerfile
|
|
123
|
+
```
|
|
124
|
+
Replace `NODE_VERSION_TEMPLATE` with your Node version in the Dockerfile:
|
|
82
125
|
```
|
|
83
126
|
ARG NODE_VERSION=NODE_VERSION_TEMPLATE
|
|
84
127
|
```
|
|
@@ -87,15 +130,20 @@ Then you can build the image:
|
|
|
87
130
|
docker build -t devxci/mbtci .
|
|
88
131
|
```
|
|
89
132
|
|
|
133
|
+
To build the mbtci-alpine image you can run:
|
|
134
|
+
```
|
|
135
|
+
docker build -f Dockerfile_alpine -t devxci/mbtci .
|
|
136
|
+
```
|
|
137
|
+
|
|
90
138
|
##### The images provide:
|
|
91
139
|
|
|
92
|
-
- Cloud MTA Build Tool - 1.2.
|
|
93
|
-
- Nodejs - 12.
|
|
140
|
+
- Cloud MTA Build Tool - 1.2.6
|
|
141
|
+
- Nodejs - 12.22.5 or 14.17.5
|
|
94
142
|
- Maven - 3.6.3
|
|
95
143
|
- Golang - 1.14.7
|
|
96
144
|
- Java - 8 or 11
|
|
97
145
|
|
|
98
|
-
The MTA Archive Builder delegates module builds to other native build tools.
|
|
146
|
+
The MTA Archive Builder delegates module builds to other native build tools. These images provide Node.js, Maven, Java, and Golang so the archive builder can delegate to these build technologies. In case other build tools are needed, <b>inherit</b> from one of these images and add more build tools.
|
|
99
147
|
|
|
100
148
|
##### License
|
|
101
149
|
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mbt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "[](https://circleci.com/gh/SAP/cloud-mta-build-tool) [](https://goreportcard.com/report/github.com/SAP/cloud-mta-build-tool) [](https://coveralls.io/github/SAP/cloud-mta-build-tool?branch=cover)  ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
package/bin/mbt
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var path = require("path");
|
|
3
|
-
var spawn = require("child_process").spawn;
|
|
4
|
-
var fs = require("fs");
|
|
5
|
-
|
|
6
|
-
var os = process.env.BINWRAP_PLATFORM || process.platform;
|
|
7
|
-
var arch = process.env.BINWRAP_ARCH || process.arch;
|
|
8
|
-
|
|
9
|
-
var requested = os + "-" + arch;
|
|
10
|
-
var current = process.platform + "-" + process.arch;
|
|
11
|
-
if (requested !== current ) {
|
|
12
|
-
console.error("WARNING: Using binaries for the requested platform (" + requested + ") instead of for the actual platform (" + current + ").")
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var binExt = "";
|
|
16
|
-
if (os == "win32") {
|
|
17
|
-
binExt = ".exe";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var unpackedBinPath = path.join(__dirname, "..", "unpacked_bin");
|
|
21
|
-
var binPath = path.join(unpackedBinPath, "mbt" + binExt);
|
|
22
|
-
|
|
23
|
-
function execBin() {
|
|
24
|
-
spawn(
|
|
25
|
-
binPath,
|
|
26
|
-
process.argv.slice(2),
|
|
27
|
-
{stdio: 'inherit'}
|
|
28
|
-
).on('exit', process.exit);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (fs.existsSync(binPath)) {
|
|
32
|
-
execBin();
|
|
33
|
-
} else {
|
|
34
|
-
console.error("INFO: Running " + path.basename(__filename) + " for the first time; downloading the actual binary");
|
|
35
|
-
|
|
36
|
-
var packageInfo = require(path.join(__dirname, "..", "package.json"));
|
|
37
|
-
var package = require(path.join(__dirname, "..", packageInfo.main));
|
|
38
|
-
|
|
39
|
-
package.install(unpackedBinPath, os, arch).then(function(result) {
|
|
40
|
-
execBin();
|
|
41
|
-
}, function(err) {
|
|
42
|
-
console.log("ERR", err);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
});
|
|
45
|
-
}
|