Skip to content

Commit

Permalink
Changed jenkins slave image (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii Misharov authored Nov 9, 2021
1 parent 1dc8a5c commit 30d4a6f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ node {
}

//Clear the cache for the app being deployed
openShiftUtils.withNode(image: "docker-registry.default.svc:5000/jenkins/jenkins-slave-base-centos7-python36:latest") {
openShiftUtils.withNode(image: "quay.io/redhatqe/jenkins-slave-python36-akamai:v3.11") {
//install python dependencies
sh "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
sh "python3 get-pip.py --user"
sh "wget https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master/src/akamai_cache_buster/bustCache.py"
sh "wget https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master/src/akamai_cache_buster/requirements.txt"
sh "python3 -m pip install --user -r requirements.txt"
sh "export PATH=$PATH:/home/jenkins/.local/bin"
sh "pip install -r requirements.txt"
withCredentials([file(credentialsId: "jenkins-eccu-cache-purge", variable: 'EDGERC')]) {
//path to .edgerc file is now set to $EDGERC"
//Bust the current cache
Expand Down
7 changes: 7 additions & 0 deletions src/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[cli]
cache-path = /home/jenkins/.akamai-cli/cache
config-version = 1.1
install-in-path = no
last-upgrade-check = ignore
enable-cli-statistics = false

31 changes: 31 additions & 0 deletions src/jenkins_slave.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM docker.io/openshift/jenkins-slave-base-centos7:v3.11

RUN yum install -y centos-release-scl && \
yum-config-manager --enable centos-sclo-rh-testing && \
yum install -y rh-python36 && \
yum clean all

ENV PATH=/opt/bin/:/opt/rh/rh-python36/root/usr/bin${PATH:+:${PATH}} \
LD_LIBRARY_PATH=/opt/rh/rh-python36/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} \
PKG_CONFIG_PATH=/opt/rh/rh-python36/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} \
XDG_DATA_DIRS="/opt/rh/rh-python36/root/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"

RUN mkdir -p /opt/bin/ /home/jenkins/.akamai-cli/src/cli-purge/bin/ && \
curl -L https://github.com/akamai/cli/releases/download/1.3.0/akamai-1.3.0-linuxamd64 \
-o /opt/bin/akamai && \
curl -L https://github.com/akamai/cli-purge/releases/download/1.0.1/akamai-purge-1.0.1-linuxamd64 \
-o /home/jenkins/.akamai-cli/src/cli-purge/bin/akamai-purge && \
curl -L https://raw.githubusercontent.com/akamai/cli-purge/1.0.1/cli.json \
-o /home/jenkins/.akamai-cli/src/cli-purge/cli.json && \
chmod +x /opt/bin/akamai /home/jenkins/.akamai-cli/src/cli-purge/bin/akamai-purge

COPY config /home/jenkins/.akamai-cli/

RUN python3.6 -m venv /insights_venv

ENV PATH=/insights_venv/bin/:${PATH}

RUN pip install --no-cache-dir -U pip setuptools wheel && \
chgrp -R 0 /insights_venv/ && \
chmod -R g+rwX /insights_venv/

0 comments on commit 30d4a6f

Please sign in to comment.