Skip to content

Socat #18

Merged
4 commits merged into from Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Jenkinsfile
Expand Up @@ -50,7 +50,6 @@ node('docker') {
dir('haproxy'){
sh 'docker build --rm -t my/haproxy . > debug'
sh 'rm debug'
sh 'docker rm haproxy'
}
} catch(error) {
def error_details = readFile('haproxy/debug');
Expand Down Expand Up @@ -124,6 +123,8 @@ def handleError(String message, String tag, Boolean doCleanup = true){
def cleanup(String tag) {
try{
sh 'bin/decompose.sh &> debug'
sh 'docker rm haproxy'
sh 'docker rmi my/haproxy'
sh 'bin/prune.sh &> debug'
} catch(error) {
def error_details = readFile('./debug');
Expand Down
3 changes: 3 additions & 0 deletions haproxy/Dockerfile
Expand Up @@ -10,4 +10,7 @@ LABEL ImageType="haproxy"
LABEL ImageName=$imagename
LABEL ImageOS=centos7
LABEL Version=$version

RUN apt-get update && apt-get install -y socat
COPY container_files/ /opt
copy conf/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
1 change: 1 addition & 0 deletions haproxy/conf/haproxy.cfg
Expand Up @@ -2,6 +2,7 @@
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
stats socket /usr/local/etc/haproxysock level admin

defaults
log global
Expand Down
2 changes: 2 additions & 0 deletions haproxy/container_files/bin/haproxycfg.sh
@@ -0,0 +1,2 @@
#!/bin/bash
echo "$@" | socat unix-connect:/usr/local/etc/haproxysock stdio
14 changes: 14 additions & 0 deletions tests/haproxy.bats
@@ -0,0 +1,14 @@
#!/usr/bin/env bats

load ../common

# These tests assume the pipeline will start and stop the container.

@test "socat process exists" {
docker exec -i haproxy which socat
}

@test "socat helper process exists" {
docker exec -i haproxy /opt/bin/haproxycfg.sh show stat
}