spec: inputs: imagename: imagetag: tardistname: tardisttag: --- container-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: stage: .pre needs: [] tags: - shell before_script: - mkdir docker - cd docker - | cat - < install-pre.sh if test -e /usr/bin/yum then yum -y install perl gcc perl-CGI libxml2-devel libxslt-devel|| exit 1 if egrep 'almalinux|rocky' /etc/os-release then yum -y install epel-release || exit 1 dnf --enablerepo=epel -y install mod_perl-devel perl-Apache-Session perl-ExtUtils-PkgConfig || exit 1 cpan LWP::UserAgent || exit 1 else if egrep 'Amazon Linux' /etc/os-release then yum -y install mod_perl-devel perl-ExtUtils-PkgConfig || exit 1 else yum -y install mod_perl-devel perl-Apache-Session perl-ExtUtils-PkgConfig || exit 1 fi fi cpan LWP::UserAgent || exit 1 cpan ExtUtils::XSBuilder || exit 2 cpan -f Apache::SessionX || exit 3 fi if test -e /usr/bin/apt then apt update || exit 3 apt -y install libextutils-xsbuilder-perl libapache2-mod-perl2-dev apache2-dev libcgi-pm-perl libapache-sessionx-perl libextutils-pkgconfig-perl libxml2-dev libxslt1-dev || exit 4 fi EOD - | cat - < Dockerfile from $[[ inputs.imagename ]]:$[[ inputs.imagetag ]] copy install-pre.sh / run bash install-pre.sh EOD - cat Dockerfile - ls -l - pwd #- env | sort script: - pwd - docker build . --force-rm -t ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] build-offline-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: stage: build needs: ["container-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]"] image: name: ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] pull_policy: never artifacts: untracked: true script: - perl xsbuilder/source_scan.pl - perl xsbuilder/xs_generate.pl - APACHE_SRC=- perl Makefile.PL - make - ls --full-time Makefile* test-offline-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: needs: ["build-offline-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]"] image: name: ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] pull_policy: never stage: test script: - ls --full-time Makefile* - make test build-apache-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: stage: build needs: ["container-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]"] image: name: ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] pull_policy: never artifacts: untracked: true script: - perl xsbuilder/source_scan.pl - perl xsbuilder/xs_generate.pl - perl Makefile.PL - make - ls --full-time Makefile* test-apache-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: needs: ["build-apache-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]"] image: name: ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] pull_policy: never stage: test script: - ls --full-time Makefile* - make test test-tardist-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]: needs: - "build-tardist-$[[ inputs.tardistname ]]-$[[ inputs.tardisttag ]]" - "container-$[[ inputs.imagename ]]-$[[ inputs.imagetag ]]" dependencies: - "build-tardist-$[[ inputs.tardistname ]]-$[[ inputs.tardisttag ]]" image: name: ep_$[[ inputs.imagename ]]:$[[ inputs.imagetag ]] pull_policy: never stage: test script: - ls --full-time Makefile* *.tar.gz - mkdir test-tardist - cd test-tardist - tar xvfz ../Embperl*.tar.gz - cd Embperl-* - pwd - perl Makefile.PL - make - make test