Compare commits

..

No commits in common. "master" and "1.0.0" have entirely different histories.

4 changed files with 22 additions and 38 deletions

View File

@ -1,5 +1,4 @@
kind: pipeline kind: pipeline
type: docker
name: default name: default
steps: steps:
@ -9,7 +8,7 @@ steps:
settings: settings:
daemon_off: false daemon_off: false
dry_run: true dry_run: true
repo: git.libreschool.org/libreschool-automation/libreschool-iso-builder repo: registry.libreschool.org/libreschool-automation/libreschool-iso-builder
tags: tags:
- latest - latest
when: when:
@ -22,15 +21,14 @@ steps:
pull: always pull: always
settings: settings:
daemon_off: false daemon_off: false
force_tag: true
registry: git.libreschool.org
username:
from_secret: docker_username
password: password:
from_secret: docker_password from_secret: docker_password
repo: git.libreschool.org/libreschool-automation/libreschool-iso-builder registry: registry.libreschool.org
repo: registry.libreschool.org/libreschool-automation/libreschool-iso-builder
tags: tags:
- latest - latest
username:
from_secret: docker_username
when: when:
event: event:
- tag - tag

View File

@ -1,11 +1,7 @@
FROM centos:7 FROM debian:stable
RUN yum install -y epel-release && \ RUN apt-get update && \
yum localinstall -y http://mirror.nethserver.org/nethserver/7/base/x86_64/Packages/nethserver-release-7-19.ns7.noarch.rpm && \ apt-get install -y curl wget p7zip-full createrepo genisoimage syslinux-utils isomd5sum cpio
yum localinstall -y https://repo.libreschool.org/nethserver/7/base/x86_64/Packages/libreschool-release-1.0-1.noarch.rpm && \
sed -i 's/^gpgcheck.*/gpgcheck=0/' /etc/yum.repos.d/LibreSchool.repo && \
sed -i 's/^repo_gpgcheck.*/repo_gpgcheck=0/' /etc/yum.repos.d/LibreSchool.repo && \
yum install -y curl wget p7zip p7zip-plugins createrepo genisoimage syslinux isomd5sum cpio
ADD run.sh /usr/local/bin ADD run.sh /usr/local/bin
RUN chmod 755 /usr/local/bin/run.sh RUN chmod 755 /usr/local/bin/run.sh

View File

@ -2,11 +2,12 @@
[![Build Status](https://drone.libreschool.org/api/badges/libreschool-automation/libreschool-iso-builder/status.svg)](https://drone.libreschool.org/libreschool-automation/libreschool-iso-builder) [![Build Status](https://drone.libreschool.org/api/badges/libreschool-automation/libreschool-iso-builder/status.svg)](https://drone.libreschool.org/libreschool-automation/libreschool-iso-builder)
Centos 7 docker image with some packages preinstalled and a script to correctly Debian docker image with some packages preinstalled and a script to correctly
package the LibreSchool ISO package the LibreSchool ISO
## Build ## Build
```bash ```
docker build . -t libreschool-automation/libreschool-iso-builder:latest docker build . -t libreschool-automation/libreschool-iso-builder:latest
``` ```

33
run.sh
View File

@ -2,7 +2,7 @@
set -e set -e
PLUGIN_SOURCE_ISO_URL=${PLUGIN_SOURCE_ISO_URL:-"http://downloads.sourceforge.net/project/nethserver/nethserver-7.7.1908-x86_64.iso"} PLUGIN_SOURCE_ISO_URL=${PLUGIN_SOURCE_ISO_URL:-"http://downloads.sourceforge.net/project/nethserver/nethserver-7.6.1810-x86_64.iso"}
PLUGIN_OUTPUT_ISO=${PLUGIN_OUTPUT_ISO:-"output.iso"} PLUGIN_OUTPUT_ISO=${PLUGIN_OUTPUT_ISO:-"output.iso"}
echo "+ PWD: $PWD" echo "+ PWD: $PWD"
@ -13,11 +13,6 @@ if [ ! -r /source.iso ] ; then
wget -qO/source.iso "$PLUGIN_SOURCE_ISO_URL" || exit 1 wget -qO/source.iso "$PLUGIN_SOURCE_ISO_URL" || exit 1
fi fi
if [ ! -r /drone/src/packages.list ] ; then
echo "! missing packages.list"
exit 1
fi
mkdir /src mkdir /src
echo "+ Extracting source ISO" echo "+ Extracting source ISO"
7z x -o/src -bd /source.iso || exit 1 7z x -o/src -bd /source.iso || exit 1
@ -26,28 +21,22 @@ echo "+ Removing all TRANS.TBL files"
find /src -name TRANS.TBL -delete find /src -name TRANS.TBL -delete
echo "+ Adding custom files from 'root'" echo "+ Adding custom files from 'root'"
cp -vfr /drone/src/root/* /src/ cp -vr /drone/src/root/* /src/
echo "+ Adding GPG signing key" echo "+ Adding GPG signing key"
curl -s "http://repo.libreschool.org/nethserver/RPM-GPG-KEY-LibreSchool" > /src/RPM-GPG-KEY-LibreSchool curl -s "http://repo.libreschool.org/nethserver/RPM-GPG-KEY-LibreSchool" > /src/RPM-GPG-KEY-LibreSchool
rpm --import /src/RPM-GPG-KEY-LibreSchool
echo "+ Adding custom packages" echo "+ Adding custom packages"
# TODO: find a way to remove packages already on ISO if [ ! -r /drone/src/packages.list ] ; then
mkdir -p /src/libreschool /drone/src/package_cache echo "! missing packages.list"
cat /drone/src/packages.list | xargs yum install --downloaddir=/drone/src/package_cache --downloadonly && \ exit 1
cat /drone/src/packages.list | xargs yumdownloader --destdir=/drone/src/package_cache --downloadonly --archlist=x86_64 \
|| ( echo "! cannot download all packages." ; exit 1 )
cp /drone/src/package_cache/*.rpm /src/libreschool
cd /src/libreschool
if [ -r comps.xml ] ; then
echo "+ Updating libreschool local repo (with groups)"
createrepo -g comps.xml -dp .
else
echo "+ Updating libreschool local repo"
createrepo -dp .
fi fi
mkdir -p /src/libreschool
cd /src/libreschool
wget -qi /drone/src/packages.list
echo "+ Updating libreschool local repo"
createrepo -dp .
if [ -d /drone/src/anaconda ] ; then if [ -d /drone/src/anaconda ] ; then
echo "+ Generating anaconda customization package" echo "+ Generating anaconda customization package"