Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroEJ GitHub Delivery committed Oct 19, 2021
1 parent de1510a commit 8170fe4
Show file tree
Hide file tree
Showing 7 changed files with 497 additions and 1 deletion.
82 changes: 82 additions & 0 deletions 4.1.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Dockerfile
#
# Copyright 2021 MicroEJ Corp. All rights reserved.
# This library is provided in source code for use, modification and test, subject to license terms.
# Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
FROM eclipse-temurin:8

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
unzip \
udev \
docker-ce-cli \
ssh \
sshpass \
# Required for Eclipse-based SDK to run
libwebkit2gtk-4.0-37 && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

RUN echo 'ACTION!="add", GOTO="usbdongle_end"\n' \
'SUBSYSTEM=="usb", GOTO="usbdongle_start"\n' \
'SUBSYSTEMS=="usb", GOTO="usbdongle_start"\n' \
'GOTO="usbdongle_end"\n' \
'LABEL="usbdongle_start"\n' \
'ATTRS{idVendor}=="096e" , ATTRS{idProduct}=="0006" , MODE="0666"\n' \
'LABEL="usbdongle_end"' > /etc/udev/rules.d/91-usbdongle.rules

# Set the new user parameter.
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
RUN addgroup --gid ${gid} ${group} && \
adduser --home /home/${user} --uid ${uid} --ingroup ${group} --disabled-password ${user}

# Good practice, switch back to user.
USER ${user}

# Set env
ENV HOME /home/${user}
ENV ECLIPSE_HOME=$HOME/ECLIPSE
ENV MICROEJ_BUILD_JDK_HOME=$JAVA_HOME
ENV MICROEJ_BUILDKIT_HOME=${HOME}/Tool-CommandLineBuild
ENV PATH=$MICROEJ_BUILDKIT_HOME:$PATH

# Set workdir
WORKDIR ${HOME}

# I) Install SDK
RUN curl -O https://repository.microej.com/packages/SDK/4.1.5/zip/microej-sdk-4.1.5-linux_x86_64.zip && \
mkdir -p $ECLIPSE_HOME && \
unzip microej-sdk-4.1.5-linux_x86_64.zip -d $ECLIPSE_HOME && \
rm -f microej-sdk-4.1.5-linux_x86_64.zip && \
# II) Install Tool-CommandLineBuild
git clone --recursive https://github.com/MicroEJ/Tool-CommandLineBuild.git && \
# III) Extract BuildKit from SDK
mkdir -p Tool-CommandLineBuild/buildKit/ && \
unzip ${ECLIPSE_HOME}/plugins/com.is2t.eclipse.plugin.easyant4e_1.7.3.20180621-1638.jar 'lib/*' -d Tool-CommandLineBuild/buildKit/ant && \
unzip ${ECLIPSE_HOME}/plugins/com.is2t.eclipse.plugin.easyant4e.offlinerepo_1.6.0.20180621-1638.jar repositories/is2t_repo.zip && \
unzip repositories/is2t_repo.zip -d Tool-CommandLineBuild/buildKit/microej-build-repository && \
rm -rf repositories && \
# IV) Install jdtCompiler from SDK 20.12
curl -O https://repository.microej.com/packages/SDK/20.12/zip/microej-sdk-20.12-linux_x86_64.zip && \
unzip microej-sdk-20.12-linux_x86_64.zip 'plugins/com.is2t.eclipse.plugin.easyant4e_2.3.1.202012101611.jar' && \
unzip plugins/com.is2t.eclipse.plugin.easyant4e_2.3.1.202012101611.jar lib/jdtCompilerAdapter.jar lib/org.eclipse.jdt.compiler.apt.jar lib/org.eclipse.jdt.core.jar -d Tool-CommandLineBuild/buildKit/ant/ && \
rm -rf microej-sdk-20.12-linux_x86_64.zip plugins && \
# V) Configure BuildKit
echo "\neasyant.inject.build.compiler=org.eclipse.jdt.core.JDTCompilerAdapter" >> Tool-CommandLineBuild/local-build.properties && \
echo "\neasyant.inject.eclipse.home=\"${ECLIPSE_HOME}\"" >> Tool-CommandLineBuild/local-build.properties && \
echo 'sdk.version=4.1.5' > $MICROEJ_BUILDKIT_HOME/release.properties

100 changes: 100 additions & 0 deletions 5.4.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Dockerfile
#
# Copyright 2021 MicroEJ Corp. All rights reserved.
# This library is provided in source code for use, modification and test, subject to license terms.
# Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
FROM eclipse-temurin:8

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
unzip \
udev \
docker-ce-cli \
ssh \
sshpass \
# Required for Eclipse-based SDK to run
libwebkit2gtk-4.0-37 && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

RUN echo 'ACTION!="add", GOTO="usbdongle_end"\n' \
'SUBSYSTEM=="usb", GOTO="usbdongle_start"\n' \
'SUBSYSTEMS=="usb", GOTO="usbdongle_start"\n' \
'GOTO="usbdongle_end"\n' \
'LABEL="usbdongle_start"\n' \
'ATTRS{idVendor}=="096e" , ATTRS{idProduct}=="0006" , MODE="0666"\n' \
'LABEL="usbdongle_end"' > /etc/udev/rules.d/91-usbdongle.rules

# Set the new user parameter.
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
RUN addgroup --gid ${gid} ${group} && \
adduser --home /home/${user} --uid ${uid} --ingroup ${group} --disabled-password ${user}

# Good practice, switch back to user.
USER ${user}

# Set env
ENV HOME /home/${user}
ENV ECLIPSE_HOME=$HOME/ECLIPSE
ENV BUILD_KIT_HOME=$HOME/buildKit
ENV PATH=$BUILD_KIT_HOME/bin:$PATH

# Set workdir
WORKDIR ${HOME}

# I) Install SDK
RUN curl -O https://repository.microej.com/packages/SDK/21.03/zip/microej-sdk-21.03-linux_x86_64.zip && \
mkdir -p $ECLIPSE_HOME && \
unzip microej-sdk-21.03-linux_x86_64.zip -d $ECLIPSE_HOME && \
rm -f microej-sdk-21.03-linux_x86_64.zip && \
# II) Configure SDK location
mkdir -p $HOME/.microej && \
echo "[options]\neclipse.home=\"${ECLIPSE_HOME}\"" > $HOME/.microej/.mmmconfig && \
# III) Update SDK to 5.4.1
# 1. Uninstall SDK 5.4.0
$ECLIPSE_HOME/MicroEJ-SDK \
-application org.eclipse.equinox.p2.director \
-noSplash \
-uninstallIU \
com.is2t.microej.sdk.feature.feature.group && \
# 2. Install SDK 5.4.1
$ECLIPSE_HOME/MicroEJ-SDK \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository \
https://repository.microej.com/p2/sdk/5.4.1 \
-installIUs \
com.is2t.microej.sdk.feature.feature.group && \
# IV) Extract Build Kit from SDK
mkdir -p $BUILD_KIT_HOME && \
# 1. Extract build repository
unzip $ECLIPSE_HOME/plugins/com.is2t.eclipse.plugin.easyant4e.offlinerepo_1.6.1.202104161741.jar repositories/microej-build-repository.zip && \
unzip repositories/microej-build-repository.zip -d $BUILD_KIT_HOME/microej-build-repository && \
rm -rf repositories/ && \
# 2. Extract mmm-cli
unzip $ECLIPSE_HOME/plugins/com.is2t.eclipse.plugin.easyant4e_2.4.0.202104161741.jar cli/mmm-cli.zip && \
unzip cli/mmm-cli.zip -d $BUILD_KIT_HOME/ && \
rm -rf cli && \
# 3. Extract ivysettings
unzip $ECLIPSE_HOME/plugins/com.is2t.eclipse.plugin.easyant4e_2.4.0.202104161741.jar resources/microej-ivysettings-5.4.xml && \
mkdir -p $BUILD_KIT_HOME/microej-module-repository/ && \
mv resources/microej-ivysettings-5.4.xml $BUILD_KIT_HOME/microej-module-repository/ivysettings.xml && \
rm -rf resources/ && \
# 4. Set SDK version
echo 'sdk.version=5.4.1' > $BUILD_KIT_HOME/release.properties


14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
..
Copyright 2021 MicroEJ Corp. All rights reserved.
This library is provided in source code for use, modification and test, subject to license terms.
Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
===========
Changelog
===========

----------------------
[1.0.0] - 2021-10-07
----------------------

- Add ``Dockerfile`` of MicroEJ BuildKit Docker Image for MicroEJ SDK 4.1.5 and 5.4.1
181 changes: 181 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
// Copyright 2021 MicroEJ Corp. All rights reserved.
// This library is provided in source code for use, modification and test, subject to license terms.
// Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
pipeline {
agent { label 'docker' }
stages {
stage('Git clean') {
steps { sh 'git clean -fdx' }
}
stage('Lint check 5.4.1') {
agent { docker {
image 'hadolint/hadolint:latest-alpine'
reuseNode true
}
}
steps {
sh 'hadolint --no-fail 5.4.1/Dockerfile'
}
}
stage('Lint check 4.1.5') {
agent { docker {
image 'hadolint/hadolint:latest-alpine'
reuseNode true
}
}
steps {
sh 'hadolint --no-fail 4.1.5/Dockerfile'
}
}
stage('Build 5.4.1') {
steps {
sh 'docker build -t sdk:5.4.1 5.4.1'
}
}
stage('Test: ensure sdk:5.4.1 can run docker') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
args '-u root -v/var/run/docker.sock:/var/run/docker.sock'
}
}
steps { sh 'docker run --rm -t hello-world' }
}
stage('Build 4.1.5') {
steps {
sh 'docker build -t sdk:4.1.5 4.1.5'
}
}
stage('Test: ensure sdk:4.1.5 can run docker') {
agent { docker {
image 'sdk:4.1.5'
reuseNode true
args '-u root -v/var/run/docker.sock:/var/run/docker.sock'
}
}
steps { sh 'docker run --rm -t hello-world' }
}
stage('Test: build microej-studio-rebrand') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-studio-rebrand" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=microej-studio-rebrand -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-studio-rebrand'
sh 'cd microej-studio-rebrand && mmm -Dizpack.microej.product.location=${ECLIPSE_HOME} -Dproduct.target.os=linux64'
}
}
stage('Test: build microej-javalib') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-javalib" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-javalib'
sh 'cd microej-javalib && mmm'
}
}
stage('Test: build addon-processor') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=addon-processor" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=addon-processor'
sh 'cd addon-processor && mmm'
}
}
stage('Test: build microej-javaapi') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-javaapi" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-javaapi'
sh 'cd microej-javaapi && mmm'
}
}
stage('Test: build microej-javaimpl') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-javaimpl" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-javaimpl'
sh 'cd microej-javaimpl && mmm'
}
}
stage('Test: build microej-meta-build') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-meta-build" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-meta-build'
sh 'cd microej-meta-build && mmm'
}
}
stage('Test: build microej-mock') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=microej-mock" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=microej-mock'
sh 'cd microej-mock && mmm'
}
}
stage('Test: build artifact-repository') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=artifact-repository" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=artifact-repository'
sh 'cd artifact-repository && mmm'
}
}
stage('Test: build application') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}

steps {
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=application" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=myjavalib -Dproject.rev=1.0.0 -Dskeleton.target.dir=application'
sh 'cd application && mmm'
}
}
stage('Test: build platform and firmware-singleapp') {
agent { docker {
image 'sdk:5.4.1'
reuseNode true
}
}
steps {
sh 'rm -rf Platform-Espressif-ESP-WROVER-KIT-V4.1'
sh 'git clone --depth 1 https://github.com/MicroEJ/Platform-Espressif-ESP-WROVER-KIT-V4.1'
sh 'cd Platform-Espressif-ESP-WROVER-KIT-V4.1/ESP32-WROVER-Xtensa-FreeRTOS-configuration/ && mmm'
sh 'mmm init -D"skeleton.org=com.is2t.easyant.skeletons" -D"skeleton.module=firmware-singleapp" -D"skeleton.rev=+" -D"project.org=com.mycompany" -Dproject.module=firmware-singleapp -Dproject.rev=1.0.0 -Dskeleton.target.dir=firmware-singleapp'
sh 'cd firmware-singleapp && mmm -D"platform-loader.target.platform.dir=$(pwd)/../Platform-Espressif-ESP-WROVER-KIT-V4.1/ESP32WROVER-Platform-GNUv52b96_xtensa-esp32-psram-1.7.1/source" -D"virtual.device.sim.only=SET"'
}
}
}
}
Loading

0 comments on commit 8170fe4

Please sign in to comment.