mirror of
https://github.com/gutmensch/docker-dmarc-report.git
synced 2025-12-17 17:56:30 +00:00
update pipeline and remove chmod for entrypoint
This commit is contained in:
parent
a1358b9187
commit
b5271abc8a
11
Dockerfile
11
Dockerfile
@ -1,4 +1,6 @@
|
|||||||
FROM trafex/alpine-nginx-php7:2.0.2
|
ARG UPSTREAM_IMAGE=trafex/alpine-nginx-php7:2.0.2
|
||||||
|
|
||||||
|
FROM $UPSTREAM_IMAGE
|
||||||
|
|
||||||
LABEL maintainer="Robert Schumann <gutmensch@n-os.org>"
|
LABEL maintainer="Robert Schumann <gutmensch@n-os.org>"
|
||||||
|
|
||||||
@ -13,7 +15,7 @@ COPY ./manifest/ /
|
|||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apk update \
|
&& apk update \
|
||||||
&& apk add bash expat-dev mariadb-dev mariadb-client mariadb-connector-c openssl gzip wget perl-utils g++ make perl-dev \
|
&& apk add bash expat-dev mariadb-dev mariadb-client mariadb-connector-c openssl openssl-dev gzip wget perl-utils g++ make perl-dev \
|
||||||
&& wget -4 -q --no-check-certificate -O parser.zip $REPORT_PARSER_SOURCE \
|
&& wget -4 -q --no-check-certificate -O parser.zip $REPORT_PARSER_SOURCE \
|
||||||
&& wget -4 -q --no-check-certificate -O viewer.zip $REPORT_VIEWER_SOURCE \
|
&& wget -4 -q --no-check-certificate -O viewer.zip $REPORT_VIEWER_SOURCE \
|
||||||
&& unzip parser.zip && cp -av dmarcts-report-parser-master/* /usr/bin/ && rm -vf parser.zip && rm -rvf dmarcts-report-parser-master \
|
&& unzip parser.zip && cp -av dmarcts-report-parser-master/* /usr/bin/ && rm -vf parser.zip && rm -rvf dmarcts-report-parser-master \
|
||||||
@ -24,12 +26,11 @@ RUN set -x \
|
|||||||
&& sed -i 's%.*root /var/www/html;% root /var/www/viewer;%g' /etc/nginx/nginx.conf \
|
&& sed -i 's%.*root /var/www/html;% root /var/www/viewer;%g' /etc/nginx/nginx.conf \
|
||||||
&& sed -i 's/.*index index.php index.html;/ index dmarcts-report-viewer.php;/g' /etc/nginx/nginx.conf \
|
&& sed -i 's/.*index index.php index.html;/ index dmarcts-report-viewer.php;/g' /etc/nginx/nginx.conf \
|
||||||
&& sed -i 's%files = /etc/supervisor.d/\*.ini%files = /etc/supervisor/conf.d/*.conf%g' /etc/supervisord.conf \
|
&& sed -i 's%files = /etc/supervisor.d/\*.ini%files = /etc/supervisor/conf.d/*.conf%g' /etc/supervisord.conf \
|
||||||
&& chmod 755 /entrypoint.sh \
|
|
||||||
&& (echo y;echo o conf prerequisites_policy follow;echo o conf commit)|cpan \
|
&& (echo y;echo o conf prerequisites_policy follow;echo o conf commit)|cpan \
|
||||||
&& for i in \
|
&& for i in \
|
||||||
|
IO::Socket::SSL \
|
||||||
CPAN \
|
CPAN \
|
||||||
CPAN::DistnameInfo \
|
CPAN::DistnameInfo \
|
||||||
IO::Socket::SSL \
|
|
||||||
File::MimeInfo \
|
File::MimeInfo \
|
||||||
IO::Compress::Gzip \
|
IO::Compress::Gzip \
|
||||||
Getopt::Long \
|
Getopt::Long \
|
||||||
@ -47,7 +48,7 @@ RUN set -x \
|
|||||||
Socket6 \
|
Socket6 \
|
||||||
PerlIO::gzip \
|
PerlIO::gzip \
|
||||||
; do cpan install $i; done \
|
; do cpan install $i; done \
|
||||||
&& apk del mariadb-dev expat-dev perl-dev g++ make
|
&& apk del mariadb-dev expat-dev openssl-dev perl-dev g++ make
|
||||||
|
|
||||||
HEALTHCHECK --interval=1m --timeout=3s CMD curl --silent --fail http://127.0.0.1:80/fpm-ping
|
HEALTHCHECK --interval=1m --timeout=3s CMD curl --silent --fail http://127.0.0.1:80/fpm-ping
|
||||||
|
|
||||||
|
|||||||
68
Jenkinsfile
vendored
Normal file
68
Jenkinsfile
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
DOCKER_IMAGE = ''
|
||||||
|
DOCKER_ARGS = '--network=services_default'
|
||||||
|
DOCKER_REGISTRY = 'registry.n-os.org:5000'
|
||||||
|
DOCKER_REPO = "${JOB_BASE_NAME}"
|
||||||
|
|
||||||
|
properties([
|
||||||
|
parameters([
|
||||||
|
string(defaultValue: '3.11', name: 'UPSTREAM_IMAGE', description: "Upstream docker image to start with")
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
node {
|
||||||
|
try {
|
||||||
|
setBuildStatus('build started', 'PENDING')
|
||||||
|
pipeline()
|
||||||
|
setBuildStatus('build succeeded', 'SUCCESS')
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
setBuildStatus('build failed', 'FAILURE')
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
cleanup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def pipeline() {
|
||||||
|
stage('checkout') {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('image build') {
|
||||||
|
DOCKER_IMAGE = docker.build(
|
||||||
|
"${DOCKER_REGISTRY}/${DOCKER_REPO}:${BUILD_ID}",
|
||||||
|
"--build-arg UPSTREAM_IMAGE=${UPSTREAM_IMAGE}" +
|
||||||
|
"--no-cache ${DOCKER_ARGS} ."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// stage('run tests') {
|
||||||
|
// DOCKER_IMAGE.inside("${DOCKER_ARGS} --entrypoint=") {
|
||||||
|
// sh 'bats /usr/build/test/*.bats'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
stage('push image') {
|
||||||
|
def shortHash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
||||||
|
DOCKER_IMAGE.push()
|
||||||
|
DOCKER_IMAGE.push(shortHash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def cleanup() {
|
||||||
|
stage('schedule cleanup') {
|
||||||
|
build job: '../Maintenance/dangling-container-cleanup', wait: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setBuildStatus(message, state) {
|
||||||
|
def repoUrl = sh(script: 'git config --get remote.origin.url', returnStdout: true).trim()
|
||||||
|
step([
|
||||||
|
$class: "GitHubCommitStatusSetter",
|
||||||
|
reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl],
|
||||||
|
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
|
||||||
|
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
|
||||||
|
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
|
||||||
|
]);
|
||||||
|
}
|
||||||
0
manifest/entrypoint.sh
Normal file → Executable file
0
manifest/entrypoint.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user