diff --git a/5.8.0/CHANGELOG.md b/5.8.0/CHANGELOG.md new file mode 100644 index 0000000..0f987fd --- /dev/null +++ b/5.8.0/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.4.0] - 2023-08-07 +### Added +- Add Dockerfile for sdk 5.8.0 + +## [1.3.0] - 2023-03-10 +### Added +- Add Dockerfile for sdk 5.6.2 jdk11 +- Add Dockerfile for sdk 5.7.0 and 5.7.0-jdk11 based on 5.6.2 + +## [1.2.0] - 2022-09-06 +### Added +- Add Dockerfile for sdk 5.6.2 based on 5.5.0 + +--- +_Markdown_ +_Copyright 2021-2022 MicroEJ Corp. All rights reserved._ +_Use of this source code is governed by a BSD-style license that can be found with this software._ diff --git a/5.8.0/Dockerfile b/5.8.0/Dockerfile new file mode 100644 index 0000000..eaf6756 --- /dev/null +++ b/5.8.0/Dockerfile @@ -0,0 +1,78 @@ +# Dockerfile +# +# Copyright 2023 MicroEJ Corp. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be found with this software. +FROM eclipse-temurin:11 + +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 + +# Set the new user parameter. +ARG user=microej +ARG group=microej +ARG uid=1000 +ARG gid=1000 +RUN addgroup --gid ${gid} ${group} && \ + adduser --home /home/${user} --uid ${uid} --ingroup ${group} --disabled-password ${user} + +# Set env +ENV HOME /home/${user} +ENV ECLIPSE_HOME=/opt/eclipse +ENV BUILD_KIT_HOME=/opt/buildKit +ENV PATH=$BUILD_KIT_HOME/bin:$PATH + +# Set workdir +WORKDIR ${HOME} + +# I) Install SDK +RUN curl -O https://repository.microej.com/packages/SDK/23.07/zip/microej-sdk-23.07-linux_x86_64.zip && \ + mkdir -p $ECLIPSE_HOME && \ + unzip microej-sdk-23.07-linux_x86_64.zip -d $ECLIPSE_HOME && \ + rm -f microej-sdk-23.07-linux_x86_64.zip && \ +# II) Configure SDK location + mkdir -p $HOME/.microej && \ + chown $user:$group $HOME/.microej && \ + echo "[options]\neclipse.home=\"${ECLIPSE_HOME}\"" > $HOME/.microej/.mmmconfig && \ +# III) 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.202307031455.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.7.1.202307031455.jar cli/mmm-cli.zip && \ + unzip cli/mmm-cli.zip -d $BUILD_KIT_HOME/ && \ + rm -rf cli && \ +# 3. Extract ivysettings + unzip $ECLIPSE_HOME/plugins/org.apache.ivyde.eclipse_2.5.1.final-202307031339-RELEASE/ivyde-eclipse.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.8.0' > $BUILD_KIT_HOME/release.properties && \ + mkdir -p $HOME/.microej/build-repository-cache && \ + ln -s $HOME/.microej/build-repository-cache $BUILD_KIT_HOME/microej-build-repository/cache && \ + chown $user:$group $BUILD_KIT_HOME/microej-build-repository/cache + +# Good practice, switch back to user. +USER ${user} diff --git a/Jenkinsfile b/Jenkinsfile index 894842e..8d31082 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ node('docker') { def platform_dir = "Platform-Espressif-ESP-WROVER-KIT-V4.1" def platform_url = "https://github.com/MicroEJ/${platform_dir}" - def platform_tag = "2.0.0" + def platform_tag = "2.2.0" def platform_target = "ESP32WROVER-Platform-GNUv84_xtensa-esp32-psram-${platform_tag}" stage('Checkout') { @@ -13,72 +13,11 @@ node('docker') { checkout scm } - //////////////////////// - / Build of image 4.1.5 / - //////////////////////// - - stage('Lint check 4.1.5') { - docker.image('hadolint/hadolint:latest-alpine').inside { - sh 'hadolint --no-fail 4.1.5/Dockerfile' - } - } - stage('Build 4.1.5') { - image = docker.build("sdk:4.1.5", "4.1.5") - } - stage('Test: ensure sdk:4.1.5 can run docker') { - image.inside('-u root -v/var/run/docker.sock:/var/run/docker.sock') { - sh 'docker run --rm -t hello-world' - } - } - stage('Test: Prepare central-repo') { - image.inside { - sh 'mkdir central-repo' - sh 'curl -LO https://developer.microej.com/4.1/ivy/microej-4.1-1.10.0.zip' - sh 'unzip microej-4.1-1.10.0.zip -d central-repo' - } - } - stage('Test: snapshot is correctly published') { - image.inside { - sh 'mkdir snapshot' - sh 'sed -e s~^microej.central.repository.dir=.*~microej.central.repository.dir=$(pwd)/central-repo~ $MICROEJ_BUILDKIT_HOME/local-build.properties > /tmp/local-build && cat /tmp/local-build > $MICROEJ_BUILDKIT_HOME/local-build.properties' - sh 'sed -e s~^snapshot.repository.dir=.*~snapshot.repository.dir=$(pwd)/snapshot~ $MICROEJ_BUILDKIT_HOME/local-build.properties > /tmp/local-build && cat /tmp/local-build > $MICROEJ_BUILDKIT_HOME/local-build.properties' - sh 'rm -rf Demo-Widget' - sh 'git clone --branch 6.1.1 https://github.com/MicroEJ/Demo-Widget.git' - sh 'build_module_local.sh Demo-Widget/com.microej.demo.widget/ snapshot' - sh 'ls snapshot/com/microej/demo/widget/6.1.1-RC*/ivy-6.1.1-RC*.xml' - } - } - stage('Test: release is correctly published') { - image.inside { - sh 'mkdir release' - sh 'sed -e s~^microej.central.repository.dir=.*~microej.central.repository.dir=$(pwd)/central-repo~ $MICROEJ_BUILDKIT_HOME/local-build.properties > /tmp/local-build && cat /tmp/local-build > $MICROEJ_BUILDKIT_HOME/local-build.properties' - sh 'sed -e s~^release.repository.dir=.*~release.repository.dir=$(pwd)/release~ $MICROEJ_BUILDKIT_HOME/local-build.properties > /tmp/local-build && cat /tmp/local-build > $MICROEJ_BUILDKIT_HOME/local-build.properties' - sh 'echo "skip.license.checker=true\nskip.readme.checker=true\nskip.changelog.checker=true" > build.properties' - sh 'build_module_local.sh Demo-Widget/com.microej.demo.widget/ release build.properties' - sh 'ls release/com/microej/demo/widget/6.1.1/ivy-6.1.1.xml' - } - } - stage('Test: build platform') { - image.inside { - sh "rm -rf ${platform_dir}" - sh "git clone --depth 1 --branch 1.8.4 ${platform_url}" - // Remove mccom-install not provided by SDK:4.1.5 - sh "sed '/mccom-install/d' -i ${platform_dir}/ESP32-WROVER-Xtensa-FreeRTOS-configuration/module.ivy" - // Override mccom-install targets with empty ones - sh "sed '/' -i ${platform_dir}/ESP32-WROVER-Xtensa-FreeRTOS-configuration/module.ant" - sh "sed '/' -i ${platform_dir}/ESP32-WROVER-Xtensa-FreeRTOS-configuration/module.ant" - // Add microEJCentral to the list of resolvers to fetch the dependencies - sh 'sed \'//a \' -i $MICROEJ_BUILDKIT_HOME/ivy/ivysettings.xml' - // This fails because we don't have an eval license, but the build per see is started with eclipse - sh "build_module_local.sh ${platform_dir}/ESP32-WROVER-Xtensa-FreeRTOS-configuration/ | grep 'No license found'" - } - } - /////////////////////// / Build of images 5.+ / /////////////////////// - def subfolders = sh(returnStdout: true, script: 'ls -d 5.*').trim().split("\n") + def subfolders = sh(returnStdout: true, script: 'ls -d 5.8*').trim().split("\n") subfolders.each { folder -> stage("Lint check ${folder}") { docker.image('hadolint/hadolint:latest-alpine').inside { @@ -153,13 +92,19 @@ node('docker') { } } stage("Test(${folder}): build platform and firmware-singleapp") { - image.inside { - sh "rm -rf ${platform_dir}" - sh "git clone --depth 1 --branch ${platform_tag} ${platform_url}" - sh "cd ${platform_dir}/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 publish local -Dplatform-loader.target.platform.dir=../${platform_dir}/${platform_target}/source -Dvirtual.device.sim.only=SET" + try { + image.inside { + sh "rm -rf ${platform_dir}" + sh "git clone --depth 1 --branch ${platform_tag} ${platform_url}" + sh "cd ${platform_dir}/ESP32-WROVER-Xtensa-FreeRTOS-configuration/ && mmm -v" + 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 publish local -Dplatform-loader.target.platform.dir=../${platform_dir}/${platform_target}/source -Dvirtual.device.sim.only=SET" + } } + catch (Exception e) { + echo 'Exception occurred: ' + e.toString() + sh 'cat /home/microej/.eclipse/com.is2t.microej.mpp.product.product_23.07_1473617060_linux_gtk_x86_64/configuration/*.log' + } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 490596a..b303765 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +![SDK 5.8 Compatible](https://shields.microej.com/endpoint?url=https://repository.microej.com/packages/badges/sdk_5.8.json) ![SDK 5.7 Compatible](https://shields.microej.com/endpoint?url=https://repository.microej.com/packages/badges/sdk_5.7.json) ![SDK 5.6 Compatible](https://shields.microej.com/endpoint?url=https://repository.microej.com/packages/badges/sdk_5.6.json) ![SDK 5.5 Compatible](https://shields.microej.com/endpoint?url=https://repository.microej.com/packages/badges/sdk_5.5.json)