diff --git a/src/Jenkinsfile b/src/Jenkinsfile index 977d70b..224c350 100644 --- a/src/Jenkinsfile +++ b/src/Jenkinsfile @@ -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 diff --git a/src/config b/src/config new file mode 100644 index 0000000..d381379 --- /dev/null +++ b/src/config @@ -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 + diff --git a/src/jenkins_slave.Dockerfile b/src/jenkins_slave.Dockerfile new file mode 100644 index 0000000..d169369 --- /dev/null +++ b/src/jenkins_slave.Dockerfile @@ -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/ +