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.

This commit is contained in:
Maxim Ganetsky 2023-11-22 02:42:38 +03:00
parent 3561292477
commit 7fd8824fbc
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: rules:
- when: on_success - 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 stage: prepenv
image: docker image: docker
services: 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_STABLE_VER=$FPC_STABLE_VER
--build-arg FPC_FIXES_VER=$FPC_FIXES_VER --build-arg FPC_FIXES_VER=$FPC_FIXES_VER
--build-arg FPC_MAIN_VER=$FPC_MAIN_VER --build-arg FPC_MAIN_VER=$FPC_MAIN_VER
-t $IMAGE_TAG - < Dockerfile.buildenv -t $IMAGE_TAG - < buildenv.Dockerfile
- docker push $IMAGE_TAG - docker push $IMAGE_TAG
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

View File

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