diff --git a/ci/Dockerfile b/ci/Dockerfile deleted file mode 100644 index 7e16480..0000000 --- a/ci/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM registry.fedoraproject.org/fedora:30 - -ARG UID -ARG GID - -RUN groupadd -g ${GID} jenkins \ - && useradd -u ${UID} -g ${GID} -m -d /var/lib/jenkins -l jenkins - -RUN dnf install -y \ - bc \ - bzip2 \ - cpio \ - diffutils \ - g++ \ - gcc \ - git \ - make \ - ncurses-devel \ - openssh-clients \ - patch \ - perl-ExtUtils-MakeMaker \ - perl-Thread-Queue \ - rsync \ - systemd \ - wget \ - which \ - && dnf clean all diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index b0dae25..f66eb52 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -2,16 +2,12 @@ pipeline { agent { - dockerfile { - dir 'ci' - args ''' - -v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts - --pids-limit 16384 - ''' - additionalBuildArgs '''\ - --build-arg UID=$(id -u) \ - --build-arg GID=$(id -g) \ - ''' + kubernetes { + yamlFile 'ci/podTemplate.yaml' + defaultContainer 'buildroot' + workspaceVolume persistentVolumeClaimWorkspaceVolume( + claimName: 'jenkins-ws-metricspi' + ) } } @@ -20,10 +16,6 @@ pipeline { disableConcurrentBuilds() } - triggers { - pollSCM '' - } - parameters { booleanParam \ name: 'Clean', diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..002b5b8 --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,20 @@ +spec: + securityContext: + fsGroup: 1000 + containers: + - name: buildroot + image: registry.pyrocufflink.blue/buildroot + command: + - sleep + - infinity + volumeMounts: + - name: tmp + mountPath: /tmp + securityContext: + readOnlyRootFilesystem: true + runAsUser: 1000 + volumes: + - name: tmp + emptyDir: + medium: Memory + sizeLimit: 100Mi