diff --git a/bin/build.sh b/bin/build.sh index 26c3ab2..d129684 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -241,14 +241,18 @@ function agentimages() { popd pushd slave-nodejs - dockerbuild Dockerfile jenkins-slave-nodejs-centos7 jenkins-slave-base-centos7 $VERSION + dockerbuild Dockerfile jenkins-slave-nodejs-centos7 ${ARTIFACT_PREFIX}jenkins-slave-base-centos7 $VERSION popd pushd slave-maven - dockerbuild Dockerfile jenkins-slave-maven-centos7 jenkins-slave-base-centos7 $VERSION + dockerbuild Dockerfile jenkins-slave-maven-centos7 ${ARTIFACT_PREFIX}jenkins-slave-base-centos7 $VERSION popd popd + + pushd images/jenkins-slave-full-centos7 + dockerbuild Dockerfile jenkins-slave-full-centos7 ${ARTIFACT_PREFIX}jenkins-slave-maven-centos7 $VERSION + popd } @@ -318,8 +322,8 @@ else MAVEN_OPTS="$MAVEN_OPTS -Dfabric8.mode=kubernetes" fi -#git submodule init -#git submodule update +git submodule init +git submodule update for module in $(modules_to_build) do diff --git a/images/jenkins-slave-full-centos7/Dockerfile b/images/jenkins-slave-full-centos7/Dockerfile new file mode 100644 index 0000000..362007a --- /dev/null +++ b/images/jenkins-slave-full-centos7/Dockerfile @@ -0,0 +1,34 @@ +FROM openshift/jenkins-slave-maven-centos7 + +ENV NODEJS_VERSION=4.4 \ + NPM_CONFIG_PREFIX=$HOME/.npm-global \ + PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \ + BASH_ENV=/usr/local/bin/scl_enable \ + ENV=/usr/local/bin/scl_enable \ + PROMPT_COMMAND=". /usr/local/bin/scl_enable" + +COPY contrib/bin/scl_enable /usr/local/bin/scl_enable + + +# Install NodeJS +RUN yum install -y centos-release-scl-rh && \ + INSTALL_PKGS="rh-nodejs4 rh-nodejs4-npm rh-nodejs4-nodejs-nodemon" && \ + ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + yum clean all -y + +COPY contrib/google-chrome.repo /etc/yum.repos.d/google-chrome.repo + +# Install Yarn and Xvfb +RUN curl https://dl.yarnpkg.com/rpm/yarn.repo > /etc/yum.repos.d/yarn.repo && \ + curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - && \ + yum install -y google-chrome-stable xorg-x11-server-Xvfb liberation-mono-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts yarn nodejs gcc-c++ make && \ + mkdir /.cache /.config && chmod 777 /.cache /.config && \ + dbus-uuidgen > /etc/machine-id + + +RUN chown -R 1001:0 $HOME && \ + chmod -R g+rw $HOME + +USER 1001 diff --git a/images/jenkins-slave-full-centos7/contrib/bin/scl_enable b/images/jenkins-slave-full-centos7/contrib/bin/scl_enable new file mode 100755 index 0000000..e275e83 --- /dev/null +++ b/images/jenkins-slave-full-centos7/contrib/bin/scl_enable @@ -0,0 +1,3 @@ +# This will make scl collection binaries work out of box. +unset BASH_ENV PROMPT_COMMAND ENV +source scl_source enable rh-nodejs4 diff --git a/images/jenkins-slave-full-centos7/contrib/google-chrome.repo b/images/jenkins-slave-full-centos7/contrib/google-chrome.repo new file mode 100644 index 0000000..5c61bcd --- /dev/null +++ b/images/jenkins-slave-full-centos7/contrib/google-chrome.repo @@ -0,0 +1,6 @@ +[google-chrome] +name=google-chrome - \$basearch +baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch +enabled=1 +gpgcheck=1 +gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub