1
0
mirror of https://github.com/cusspvz/openwrt-builder.docker synced 2025-07-11 08:28:35 +00:00

upgrade builders

This commit is contained in:
José Moreira 2018-09-11 10:35:21 +01:00
parent 5a965a5600
commit 922b696caa
5 changed files with 39 additions and 23 deletions

View File

@ -5,7 +5,7 @@ services:
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./docker-images-builder.sh
- FORCE=1 ./docker-images-builder.sh
branches:
only:

View File

@ -17,6 +17,7 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so
ADD entrypoint.sh /entrypoint
RUN chmod 755 /entrypoint
ENV GOSU_USER="0:0"
RUN mkdir -p /src /output /overlay /repositories /feeds
WORKDIR /src

View File

@ -67,16 +67,17 @@ echo
### END - SPIT CONFIGS ###
### BEGIN - BASE IMAGE BUILDING ###
echo "BASE - Building/Fetching base image"
# Lets pull up the base image
echo "BASE - Fetching base image"
$DOCKER pull "${DOCKER_IMAGE}:base" &> $CLOSE_EXEC;
# Now that we have it in cache, lets build the base image to ensure
# that it has the same output
echo "BASE - Building base image"
$DOCKER build -t "${DOCKER_IMAGE}:base" ./base-image &> $CLOSE_EXEC;
# Push the docker base in case it gets changed
echo "BASE - Pushing base image"
$DOCKER push "${DOCKER_IMAGE}:base" &> $CLOSE_EXEC;
### END - BASE IMAGE BUILDING ###

View File

@ -10,11 +10,10 @@ CUSTOM_REPOSITORIES=$(ls $PATH_REPOSITORIES)
CPUS=${CPUS:-2}
CLEAN=${CLEAN:-0}
## HANDLE REPOSITORYS
cp $PATH_SRC/repositories.conf $PATH_SRC/repositories.conf.default
for CUSTOM_REPOSITORY in $CUSTOM_REPOSITORIES; do
echo "src ${CUSTOM_REPOSITORY} file://${PATH_REPOSITORIES}/${CUSTOM_REPOSITORY}" >> $PATH_SRC/repositories.conf
echo "src ${CUSTOM_REPOSITORY} ${PATH_REPOSITORIES}/${CUSTOM_REPOSITORY}" >> $PATH_SRC/repositories.conf
done;
# Build image

View File

@ -2,6 +2,7 @@
PATH_SRC=/src
PATH_FEEDS=/feeds
PATH_OUTPUT=/output
CUSTOM_FEEDS=$(ls $PATH_FEEDS)
CPUS=${CPUS:-2}
CLEAN=${CLEAN:-0}
@ -15,7 +16,7 @@ CLEAN=${CLEAN:-0}
## HANDLE FEEDS
cp $PATH_SRC/feeds.conf.default $PATH_SRC/feeds.conf
for CUSTOM_FEED in $CUSTOM_FEEDS; do
echo "src-link ${CUSTOM_FEED} file://${PATH_FEEDS}/${CUSTOM_FEED}" >> $PATH_SRC/feeds.conf
echo "src-link ${CUSTOM_FEED} ${PATH_FEEDS}/${CUSTOM_FEED}" >> $PATH_SRC/feeds.conf
done;
./scripts/feeds update -a
@ -23,25 +24,39 @@ for CUSTOM_FEED in $CUSTOM_FEEDS; do
./scripts/feeds install -a -p $CUSTOM_FEED
done;
for PACKAGE in $PACKAGES; do
./scripts/feeds install "$PACKAGE"
done;
make defconfig
echo "- Building packages $PACKAGES..."
echo "- Building packages: $PACKAGES"
COMMANDS=""
[ "$CLEAN" != "0" ] && {
for PACKAGE in $PACKAGES; do
COMMANDS="$COMMANDS package/${PACKAGE}/clean"
done
}
for PACKAGE in $PACKAGES; do
COMMANDS="$COMMANDS package/${PACKAGE}/download"
}
for PACKAGE in $PACKAGES; do
COMMANDS="$COMMANDS package/${PACKAGE}/compile"
MAKE="make"
[ ! -z $DEBUG ] && {
MAKE="$MAKE V=s"
}
make -j ${CPUS} ${COMMANDS} \
BIN_DIR="$PATH_OUTPUT"
# Add CPUs
MAKE="$MAKE -j${CPUS}"
for PACKAGE in $PACKAGES; do
$MAKE package/${PACKAGE}/compile
done;
echo "Building repository Packages"
$MAKE package/index
cp -vfR $PATH_SRC/bin/* /output
# Move bin/packages contents to the PATH_OUTPUT
echo "- Moving built packages to output dir..."
mv -v bin/packages/* $PATH_OUTPUT
# for package in $(find $PATH_SRC/bin | grep ".ipk$"); do
# cp "$package" /output;
# done;
# Build packages.gz
# export PATH="$PATH:$PATH_SRC/staging_dir/host/bin/"
# cd $PATH_OUTPUT
# $PATH_SRC/scripts/ipkg-make-index.sh . > Packages
# gzip --keep Packages
echo "Finished!"