CI: Renamed Dockerfile to make code highlight to work in GitLab web interface. Also simplified it and made to terminate earlier in case of compilation errors.

(cherry picked from commit 7fd8824fbc)
This commit is contained in:
Maxim Ganetsky 2023-11-22 02:42:38 +03:00
parent 851cd68564
commit 138a8b4bc4
2 changed files with 9 additions and 24 deletions

View File

@ -38,7 +38,7 @@ stages: # List of stages for jobs, and their order of execution
rules:
- when: on_success
update-build-env: # This job updates building environment image. Run it if FPC version constants and/or Dockerfile.buildenv were changed.
update-build-env: # This job updates building environment image. Run it if FPC version constants and/or buildenv.Dockerfile were changed.
stage: prepenv
image: docker
services:
@ -50,7 +50,7 @@ update-build-env: # This job updates building environment image. Run it if FPC
--build-arg FPC_STABLE_VER=$FPC_STABLE_VER
--build-arg FPC_FIXES_VER=$FPC_FIXES_VER
--build-arg FPC_MAIN_VER=$FPC_MAIN_VER
-t $IMAGE_TAG - < Dockerfile.buildenv
-t $IMAGE_TAG - < buildenv.Dockerfile
- docker push $IMAGE_TAG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

View File

@ -36,10 +36,7 @@ RUN docarchive=doc-chm.zip; \
tar xf ${tarball[2]}.tar; \
cd ${tarball[2]}; \
# install only compiler and RTL, do not install documentation and demos
echo -e "\nn\nn\n" | ./install.sh; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
echo -e "\nn\nn\n" | ./install.sh || exit 1; \
cd ..; \
# store fpdoc binaries separately for each FPC version (needed to build Lazarus docs)
cp -v /usr/bin/fpdoc /usr/bin/fpdoc-${tarball[0]}; \
@ -81,34 +78,22 @@ RUN tarballs=( \
for tbl in "${tarballs[@]}"; do \
tarball=($tbl); \
cd ${tarball[2]}; \
make all FPC=/usr/lib/fpc/${tarball[0]}/ppcx64 OS_TARGET=${tarball[4]} CPU_TARGET=${tarball[5]}; \
make crossinstall FPC=/usr/lib/fpc/${tarball[0]}/ppcx64 OS_TARGET=${tarball[4]} CPU_TARGET=${tarball[5]} INSTALL_PREFIX=/usr; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
make all FPC=/usr/lib/fpc/${tarball[0]}/ppcx64 OS_TARGET=${tarball[4]} CPU_TARGET=${tarball[5]} || exit 1; \
make crossinstall FPC=/usr/lib/fpc/${tarball[0]}/ppcx64 OS_TARGET=${tarball[4]} CPU_TARGET=${tarball[5]} INSTALL_PREFIX=/usr || exit 1; \
cd ..; \
done; \
# save sources for FPC from main branch separately (they are needed e.g. for running Codetools tests)
fpcsrcdir=/fpcsrc; \
fpcsrcdirmain=$fpcsrcdir/$FPC_MAIN_VER; \
mkdir -p $fpcsrcdirmain; \
tar zxf source-main.tar.gz --strip-components=1 --directory $fpcsrcdirmain; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
tar zxf source-main.tar.gz --strip-components=1 --directory $fpcsrcdirmain || exit 1; \
# compile and install pas2js (needed for running some Codetools tests)
git clone --depth 1 https://gitlab.com/freepascal.org/fpc/pas2js.git; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
git clone --depth 1 https://gitlab.com/freepascal.org/fpc/pas2js.git || exit 1; \
cd pas2js; \
rm -rf compiler; \
ln -s ../source-main compiler; \
make all FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64; \
make install FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64; \
if [ $? -ne 0 ]; then \
exit 1; \
fi; \
make all FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64 || exit 1; \
make install FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64 || exit 1; \
cd ..; \
rm -rf pas2js; \
echo "Contents of /usr/local/bin/pas2js.cfg:"; \