Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chobits/ngx_http_proxy_connect_module
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sporting-innovations/ngx_http_proxy_connect_module
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 7 commits
  • 4 files changed
  • 1 contributor

Commits on Jun 17, 2019

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    38d9ec0 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    046ff59 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    0911087 View commit details
  4. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    3de8d6c View commit details
  5. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    1048510 View commit details
  6. need to add dynamic option to ngx module config file so it can be com…

    …piled into a shared library
    anitakrueger committed Jun 17, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    d212902 View commit details
  7. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    anitakrueger Anita Krueger
    Copy the full SHA
    a8c483b View commit details
Showing with 141 additions and 3 deletions.
  1. +28 −0 Dockerfile
  2. +86 −0 Jenkinsfile
  3. +9 −3 config
  4. +18 −0 docker-entrypoint.sh
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM centos:7.6.1810

ARG ARG_NGINX_VERSION=1.15.9
ARG ARG_NGINX_ARTIFACT=https://nexus.fanthreesixty.com/repository/infrastructure-archives/nginx-${ARG_NGINX_VERSION}.tar.gz
ARG ARG_NGINX_PROXY_CONNECT_VERSION=0.1
ARG ARG_NGINX_PROXY_CONNECT_GITURL=https://github.com/sporting-innovations/ngx_http_proxy_connect_module

ENV NGINX_VERSION=${ARG_NGINX_VERSION}
ENV NGINX_ARTIFACT=${ARG_NGINX_ARTIFACT}
ENV NGINX_PATH=/opt/nginx-${NGINX_VERSION}
ENV NGINX_PROXY_CONNECT_VERSION=${ARG_NGINX_PROXY_CONNECT_VERSION}

COPY docker-entrypoint.sh /opt/bin/docker-entrypoint.sh

RUN yum install -y gcc pcre pcre-devel openssl openssl-devel zlib-devel git patch \
&& groupadd -g 9999 jenkins \
&& adduser -M -g 9999 -u 9999 jenkins \
&& chown -R jenkins:jenkins /opt

RUN mkdir -p /opt/bin && cd /opt \
&& curl -sS ${NGINX_ARTIFACT} | tar xvz \
&& git clone ${ARG_NGINX_PROXY_CONNECT_GITURL}

RUN chmod +x /opt/bin/docker-entrypoint.sh

WORKDIR ${NGINX_PATH}

CMD ["/opt/bin/docker-entrypoint.sh"]
86 changes: 86 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
pipeline {
agent {
label 'master'
}

parameters {
string(
name: "NGINX_VERSION",
defaultValue: "1.15.9",
description: "Version of Nginx to Build Dockerfile with"
)
string(
name: "NGINX_PROXY_CONNECT_VERSION",
defaultValue: "0.1",
description: "Version of Nginx Proxy Connect Module to Build Dockerfile with"
)
}

options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds()
}

environment {
APPLICATION_NAME = 'nginx_proxy_connect'
ARTIFACT_NAME = 'ngx_http_proxy_connect_module'
ARTIFACT_EXTENSION = '.so'
}

stages {
stage('Build Nginx Module Artifact') {
agent {
dockerfile {
label 'docker'
additionalBuildArgs "--build-arg ARG_NGINX_VERSION=1.15.9 --build-arg ARG_NGINX_PROXY_CONNECT_VERSION=0.1"
args "-u root"
}
}
steps {
ansiColor('xterm') {
sh '/opt/bin/docker-entrypoint.sh'

sh "tar cfz ${APPLICATION_NAME}-${params.NGINX_PROXY_CONNECT_VERSION}.tar.gz /usr/lib64/nginx/modules/${ARTIFACT_NAME}${ARTIFACT_EXTENSION}"
sh "chown jenkins:jenkins ${APPLICATION_NAME}-${params.NGINX_PROXY_CONNECT_VERSION}.tar.gz"
stash includes: "${APPLICATION_NAME}-*.tar.gz", name: "${env.APPLICATION_NAME}"
}
}
}

stage('Publish Release Artifact') {
agent {
label 'master'
}
when {
anyOf {
environment name: 'GIT_BRANCH', value: 'master'
environment name: 'GIT_BRANCH', value: 'origin/master'
}
}
stages {
stage('Publish Artifcat to Nexus'){
steps {
ansiColor('xterm') {
unstash "${env.APPLICATION_NAME}"
publishNexusArtifact artifactId: "${env.APPLICATION_NAME}",
classifier: 'module',
file: "${WORKSPACE}/${env.APPLICATION_NAME}-${params.NGINX_PROXY_CONNECT_VERSION}.tar.gz",
groupId: 'com.fanthreesixty',
type: 'tar.gz',
repository: 'fts-artifacts-releases',
version: params.NGINX_PROXY_CONNECT_VERSION
}
}
}
}
}
}
post {
always {
notifySlack channel: '#nonprod_deployments'
logstashSend failBuild: false, maxLines: 0
cleanWs()
}
}
}
12 changes: 9 additions & 3 deletions config
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ngx_addon_name=ngx_http_proxy_connect_module
HTTP_MODULES="$HTTP_MODULES ngx_http_proxy_connect_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_proxy_connect_module.c"

if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=ngx_http_proxy_connect_module
ngx_module_srcs="$ngx_addon_dir/ngx_http_proxy_connect_module.c"
. auto/module
else
HTTP_MODULES="$HTTP_MODULES ngx_http_proxy_connect_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_proxy_connect_module.c"
fi
have=NGX_HTTP_PROXY_CONNECT . auto/have
18 changes: 18 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e

echo "******"
echo "NGINX_VERSION: ${NGINX_VERSION}"
echo "NGINX_PROXY_CONNECT_VERSION: ${NGINX_PROXY_CONNECT_VERSION}"
echo "******"

cd $NGINX_PATH

patch -p1 < ../ngx_http_proxy_connect_module/patch/proxy_connect_rewrite_101504.patch

./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --add-dynamic-module=../ngx_http_proxy_connect_module

make modules

mkdir -p /usr/lib64/nginx/modules/
cp objs/ngx_http_proxy_connect_module.so /usr/lib64/nginx/modules/