Skip to content

Commit

Permalink
Jenkins/Docker: Update hadolint version.
Browse files Browse the repository at this point in the history
- Ignore hadolint warnings about not pinned version.
  • Loading branch information
JonatanAntoni committed Jul 14, 2021
1 parent e54ebc4 commit b5d07f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ DOCKERINFO = [
'label': 'latest'
]
]
HADOLINT_VERSION = '2.6.0-alpine'

dockerinfo = DOCKERINFO['production']

Expand Down Expand Up @@ -135,9 +136,7 @@ pipeline {
echo "VERSION: '${VERSION}'"
}

dir('docker') {
stash name: 'dockerfile', includes: '**'
}
stash name: 'dockerfile', includes: 'docker/**'
}
}

Expand Down Expand Up @@ -206,7 +205,7 @@ echo """Stage schedule:
runAsGroup: 1000
containers:
- name: hadolint
image: mcu--docker.eu-west-1.artifactory.aws.arm.com/hadolint/hadolint:v1.19.0-alpine
image: mcu--docker.eu-west-1.artifactory.aws.arm.com/hadolint/hadolint:${HADOLINT_VERSION}
alwaysPullImage: true
imagePullPolicy: Always
command:
Expand All @@ -221,15 +220,13 @@ echo """Stage schedule:
}
}
steps {
dir('docker') {
unstash 'dockerfile'
unstash 'dockerfile'

sh 'hadolint --format json dockerfile | tee hadolint.log'
sh 'hadolint --format json docker/dockerfile* | tee hadolint.log'

recordIssues tools: [hadoLint(id: 'hadolint', pattern: 'hadolint.log')],
qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
referenceJobName: 'nightly', ignoreQualityGate: true
}
recordIssues tools: [hadoLint(id: 'hadolint', pattern: 'hadolint.log')],
qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
referenceJobName: 'nightly', ignoreQualityGate: true
}
}

Expand Down Expand Up @@ -265,9 +262,9 @@ echo """Stage schedule:
steps {
sh('apk add bash curl git')
script {
dir('docker') {
unstash 'dockerfile'
unstash 'dockerfile'

dir('docker') {
dockerinfo = DOCKERINFO['staging']
withCredentials([sshUserPrivateKey(credentialsId: 'grasci_with_pk',
keyFileVariable: 'grasciPk',
Expand Down
2 changes: 2 additions & 0 deletions docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN useradd -u 1000 -U -m -c Jenkins jenkins

# install packages from official Ubuntu repo
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bc \
Expand Down Expand Up @@ -84,6 +85,7 @@ RUN chmod +x /usr/local/bin/PackChk

# install Python requirements
COPY requirements.txt ${INSTALLER_PATH}/
# hadolint ignore=DL3013
RUN python3 -m pip install -U --no-cache-dir pip && \
python3 -m pip install -U --no-cache-dir -r ${INSTALLER_PATH}/requirements.txt

Expand Down
2 changes: 2 additions & 0 deletions docker/dockerfile.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FROM ${DOCKER_REGISTRY}/ubuntu:focal

# install packages from official Ubuntu repo
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bc \
Expand Down Expand Up @@ -48,6 +49,7 @@ WORKDIR /

# install Python requirements
COPY requirements.txt ${INSTALLER_PATH}/
# hadolint ignore=DL3013
RUN python3 -m pip install -U --no-cache-dir pip && \
python3 -m pip install -U --no-cache-dir -r ${INSTALLER_PATH}/requirements.txt

Expand Down

0 comments on commit b5d07f0

Please sign in to comment.