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: script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./docker-images-builder.sh - FORCE=1 ./docker-images-builder.sh
branches: branches:
only: 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 ADD entrypoint.sh /entrypoint
RUN chmod 755 /entrypoint RUN chmod 755 /entrypoint
ENV GOSU_USER="0:0"
RUN mkdir -p /src /output /overlay /repositories /feeds RUN mkdir -p /src /output /overlay /repositories /feeds
WORKDIR /src WORKDIR /src

View File

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

View File

@ -10,11 +10,10 @@ CUSTOM_REPOSITORIES=$(ls $PATH_REPOSITORIES)
CPUS=${CPUS:-2} CPUS=${CPUS:-2}
CLEAN=${CLEAN:-0} CLEAN=${CLEAN:-0}
## HANDLE REPOSITORYS ## HANDLE REPOSITORYS
cp $PATH_SRC/repositories.conf $PATH_SRC/repositories.conf.default cp $PATH_SRC/repositories.conf $PATH_SRC/repositories.conf.default
for CUSTOM_REPOSITORY in $CUSTOM_REPOSITORIES; do 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; done;
# Build image # Build image

View File

@ -2,6 +2,7 @@
PATH_SRC=/src PATH_SRC=/src
PATH_FEEDS=/feeds PATH_FEEDS=/feeds
PATH_OUTPUT=/output
CUSTOM_FEEDS=$(ls $PATH_FEEDS) CUSTOM_FEEDS=$(ls $PATH_FEEDS)
CPUS=${CPUS:-2} CPUS=${CPUS:-2}
CLEAN=${CLEAN:-0} CLEAN=${CLEAN:-0}
@ -15,33 +16,47 @@ CLEAN=${CLEAN:-0}
## HANDLE FEEDS ## HANDLE FEEDS
cp $PATH_SRC/feeds.conf.default $PATH_SRC/feeds.conf cp $PATH_SRC/feeds.conf.default $PATH_SRC/feeds.conf
for CUSTOM_FEED in $CUSTOM_FEEDS; do 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; done;
./scripts/feeds update -a ./scripts/feeds update -a
for CUSTOM_FEED in $CUSTOM_FEEDS; do for CUSTOM_FEED in $CUSTOM_FEEDS; do
./scripts/feeds install -a -p $CUSTOM_FEED ./scripts/feeds install -a -p $CUSTOM_FEED
done;
for PACKAGE in $PACKAGES; do
./scripts/feeds install "$PACKAGE"
done; done;
make defconfig make defconfig
echo "- Building packages $PACKAGES..." echo "- Building packages: $PACKAGES"
COMMANDS="" MAKE="make"
[ "$CLEAN" != "0" ] && {
for PACKAGE in $PACKAGES; do [ ! -z $DEBUG ] && {
COMMANDS="$COMMANDS package/${PACKAGE}/clean" MAKE="$MAKE V=s"
done
}
for PACKAGE in $PACKAGES; do
COMMANDS="$COMMANDS package/${PACKAGE}/download"
}
for PACKAGE in $PACKAGES; do
COMMANDS="$COMMANDS package/${PACKAGE}/compile"
} }
make -j ${CPUS} ${COMMANDS} \ # Add CPUs
BIN_DIR="$PATH_OUTPUT" 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 # Move bin/packages contents to the PATH_OUTPUT
echo "- Moving built packages to output dir..." # for package in $(find $PATH_SRC/bin | grep ".ipk$"); do
mv -v bin/packages/* $PATH_OUTPUT # 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!"