forked from SAP/cloud-mta-build-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cloud mta build tool docker images (SAP#997)
* new file: Dockerfile_mbtci_java11 new file: Dockerfile_mbtci_java17 new file: Dockerfile_mbtci_java8 new file: docker-compose.test.yml new file: scripts/build_image new file: scripts/publish_image new file: test/goss/README.MD new file: test/goss/goss_template.yaml modified: .circleci/config.yml modified: cmd/testdata/mta/node-js/package.json modified: go.mod modified: go.sum modified: integration/testdata/mta_assemble/node/package.json modified: integration/testdata/mta_demo/node-js/package.json modified: integration/testdata/mta_demo/node/package.json modified: internal/artifacts/testdata/mta/node-js/package.json modified: internal/exec/testdata/mta/node-js/package.json * modified: .circleci/config.yml modified: cmd/testdata/mta/node-js/package.json modified: go.mod modified: go.sum modified: integration/testdata/mta_assemble/node/package.json modified: integration/testdata/mta_demo/node-js/package.json modified: integration/testdata/mta_demo/node/package.json modified: internal/artifacts/testdata/mta/node-js/package.json modified: internal/exec/testdata/mta/node-js/package.json * revert on-pr-build and on_merge_build_test workflow * upgrad node 16 version and change workflow logic which after test success the rest step will run * modified: .circleci/config.yml Co-authored-by: Young Yang <young.yang03@sap.com>
- Loading branch information
1 parent
1e62707
commit 4dfaf96
Showing
17 changed files
with
612 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
FROM sapmachine:11 | ||
|
||
# Build time arguments | ||
ARG MTA_USER_HOME=/home/mta | ||
ARG MBT_VERSION=1.2.18 | ||
ARG GO_VERSION=1.15.6 | ||
# node version as found in https://nodejs.org/dist/ e.g: "v16.15.0" | ||
ARG NODE_VERSION=NODE_VERSION_TEMPLATE | ||
ARG MAVEN_VERSION=3.6.3 | ||
|
||
# Environment variables | ||
ENV PYTHON /usr/bin/python3 | ||
ENV M2_HOME=/opt/maven/apache-maven-${MAVEN_VERSION} | ||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
ENV CGO_ENABLED=0 | ||
ENV GOOS=linux | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ADD http://aia.pki.co.sap.com/aia/SAP%20Global%20Root%20CA.crt \ | ||
/etc/ssl/certs/SAP_Global_Root_CA.crt | ||
|
||
# Download required env tools | ||
RUN apt-get update && \ | ||
apt-get install --yes --no-install-recommends \ | ||
ca-certificates \ | ||
git \ | ||
curl && \ | ||
|
||
# Change security level as the SAP npm repo doesnt support buster new security upgrade | ||
# the default configuration for OpenSSL in Buster explicitly requires using more secure ciphers and protocols, | ||
# and the server running at http://npm.sap.com/ is running software configured to only provide insecure, older ciphers. | ||
# This causes SSL connections using OpenSSL from a Buster based installation to fail | ||
# Should be remove once SAP npm repo will patch the security level | ||
# see - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912759 | ||
sed -i -E 's/(CipherString\s*=\s*DEFAULT@SECLEVEL=)2/\11/' /etc/ssl/openssl.cnf && \ | ||
|
||
# install node | ||
NODE_HOME=/opt/nodejs; mkdir -p ${NODE_HOME} && \ | ||
curl --fail --silent --output - "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.gz" \ | ||
| tar -xzv -f - -C "${NODE_HOME}" && \ | ||
ln -s "${NODE_HOME}/node-${NODE_VERSION}-linux-x64/bin/node" /usr/local/bin/node && \ | ||
ln -s "${NODE_HOME}/node-${NODE_VERSION}-linux-x64/bin/npm" /usr/local/bin/npm && \ | ||
ln -s "${NODE_HOME}/node-${NODE_VERSION}-linux-x64/bin/npx" /usr/local/bin/ && \ | ||
npm install --prefix /usr/local/ -g grunt-cli && \ | ||
|
||
# install ui5-cli temporay solution | ||
npm install --prefix /usr/local/ -g @ui5/cli && \ | ||
|
||
# installing Golang | ||
curl -O https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz && tar -xvf go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
mv go /usr/local && \ | ||
mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" && \ | ||
mkdir -p ${GOPATH}/src ${GOPATH}/bin && \ | ||
|
||
# update maven home | ||
M2_BASE="$(dirname ${M2_HOME})" && \ | ||
mkdir -p "${M2_BASE}" && \ | ||
curl --fail --silent --output - "https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" \ | ||
| tar -xzvf - -C "${M2_BASE}" && \ | ||
ln -s "${M2_HOME}/bin/mvn" /usr/local/bin/mvn && \ | ||
chmod --recursive a+w "${M2_HOME}"/conf/* && \ | ||
|
||
# Download MBT | ||
curl -L "https://github.com/SAP/cloud-mta-build-tool/releases/download/v${MBT_VERSION}/cloud-mta-build-tool_${MBT_VERSION}_Linux_amd64.tar.gz" | tar -zx -C /usr/local/bin && \ | ||
chown root:root /usr/local/bin/mbt && \ | ||
|
||
# handle users permission | ||
useradd --home-dir "${MTA_USER_HOME}" \ | ||
--create-home \ | ||
--shell /bin/bash \ | ||
--user-group \ | ||
--uid 1000 \ | ||
--comment 'Cloud MTA Build Tool' \ | ||
--password "$(echo weUseMta |openssl passwd -1 -stdin)" mta && \ | ||
# allow anybody to write into the images HOME | ||
chmod a+w "${MTA_USER_HOME}" && \ | ||
|
||
# Install essential build tools and python, required for building db modules | ||
apt-get install --yes --no-install-recommends \ | ||
build-essential \ | ||
python2.7 \ | ||
python3 && \ | ||
|
||
# Install python 3.10 | ||
#apt-get install software-properties-common && \ | ||
#apt-get update && \ | ||
#add-apt-repository ppa:deadsnakes/ppa && \ | ||
#apt-get install python3.10 && \ | ||
|
||
# remove build env tools | ||
apt-get remove --purge --autoremove --yes \ | ||
curl && \ | ||
|
||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PATH=$PATH:./node_modules/.bin HOME=${MTA_USER_HOME} | ||
WORKDIR /project | ||
USER mta |
Oops, something went wrong.