From ea488f61e6c74b238d8dac5cd6bc95ed1c0a1bb7 Mon Sep 17 00:00:00 2001 From: JP Bochi Date: Mon, 7 May 2018 18:38:26 +0200 Subject: [PATCH 1/5] adds basic codeship build config --- codeship-services.yml | 2 ++ codeship-steps.yml | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 codeship-services.yml create mode 100644 codeship-steps.yml diff --git a/codeship-services.yml b/codeship-services.yml new file mode 100644 index 0000000..a302f12 --- /dev/null +++ b/codeship-services.yml @@ -0,0 +1,2 @@ +app: + image: drydock/u16 diff --git a/codeship-steps.yml b/codeship-steps.yml new file mode 100644 index 0000000..06f2f51 --- /dev/null +++ b/codeship-steps.yml @@ -0,0 +1,7 @@ +- type: parallel + name: examplezz + steps: + - service: app + command: printenv + - service: app + command: ls From 7674990fbdba290f0a34f80cc1d15bb2dd3ad662 Mon Sep 17 00:00:00 2001 From: JP Bochi Date: Mon, 7 May 2018 18:59:18 +0200 Subject: [PATCH 2/5] debug codeship --- codeship-services.yml | 4 +++- codeship-steps.yml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/codeship-services.yml b/codeship-services.yml index a302f12..5437f2b 100644 --- a/codeship-services.yml +++ b/codeship-services.yml @@ -1,2 +1,4 @@ app: - image: drydock/u16 + image: docker + volumes: + - .:/usr/app diff --git a/codeship-steps.yml b/codeship-steps.yml index 06f2f51..9a5350e 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -1,7 +1,9 @@ -- type: parallel +- type: serial name: examplezz steps: - service: app command: printenv - service: app - command: ls + command: ls /usr/app/ + - service: app + command: /usr/app/drun -? From eb137680a9f39ad60f41bda71064bd0c4c73d032 Mon Sep 17 00:00:00 2001 From: JP Bochi Date: Mon, 7 May 2018 20:44:27 +0200 Subject: [PATCH 3/5] adds all regular build steps --- codeship-services.yml | 7 +++++-- codeship-steps.yml | 21 +++++++++++++++------ codeship/Dockerfile | 3 +++ 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 codeship/Dockerfile diff --git a/codeship-services.yml b/codeship-services.yml index 5437f2b..c2d5900 100644 --- a/codeship-services.yml +++ b/codeship-services.yml @@ -1,4 +1,7 @@ app: - image: docker + build: ./codeship/ + cached: true + add_docker: true + working_dir: /app volumes: - - .:/usr/app + - .:/app diff --git a/codeship-steps.yml b/codeship-steps.yml index 9a5350e..87c0c44 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -1,9 +1,18 @@ - type: serial name: examplezz + service: app steps: - - service: app - command: printenv - - service: app - command: ls /usr/app/ - - service: app - command: /usr/app/drun -? + - command: ./drun -? + - command: sh -c "./drun -x ubuntu:16.04 cat /etc/issue | grep 'Ubuntu 16.04'" # should execute command inside container + - command: sh -c "./drun -x docker:1.10.0 docker version" # should bind docker.sock + - command: sh -c "./drun -x docker:1.10.0 sh -c './drun -x docker:1.10.0 true'" # should do inception in 2 levels + - command: sh -c "./drun -x docker:1.10.0 sh -c './drun -x docker:1.10.0 sh -c "./drun -x docker:1.10.0 true"'" # should do inception in 3 levels + - command: sh -c "./drun -x mhart/alpine-node:5.12.0 node --version | grep 'v5.12.0'" # should get version of node + - command: sh -c "echo '{"engines":{"node":"7.7.1"}}' > package.json && ./drun -xNA node --version | grep 'v7.7.1'" # should read version from package.json + - command: sh -c "echo '{"engines":{"node":"~7.7.1"}}' > package.json && ./drun -xNA node --version | grep 'v7.7.1'" # should read version from package.json + - command: sh -c "echo '{"engines":{"node":"^7.7.1"}}' > package.json && ./drun -xNA node --version | grep 'v7.7.1'" # should read version from package.json + - command: sh -c "echo '{"engines":{"node":">=7.7.1"}}' > package.json && ./drun -xNA node --version | grep 'v7.7.1'" # should read version from package.json + - command: sh -c "echo '{"engines":{"node":"7.7.1"}}' > package.json && ./drun -xNM slim node --version | grep 'v7.7.1'" # should read version from package.json node:7.7.1-slim image + - command: sh -c "echo '{"test":"passing"}' | ./drun -x stedolan/jq '.test' | grep '"passing"'" # should pipe into command inside container + - command: sh -c "echo '{"test":"passing"}' > test.json && ./drun -x stedolan/jq '.test' test.json | grep '"passing"'" # should mount current directory + - command: sh -c "checkbashisms -f drun && echo 'checkbashisms passed.'" diff --git a/codeship/Dockerfile b/codeship/Dockerfile new file mode 100644 index 0000000..8722e11 --- /dev/null +++ b/codeship/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine + +RUN apk add --update docker jq curl checkbashisms From 3ed6abb2366d5dce2971a3e96141ea9720a3ad1a Mon Sep 17 00:00:00 2001 From: JP Bochi Date: Tue, 8 May 2018 11:05:08 +0200 Subject: [PATCH 4/5] debug codeship --- drun | 1 + 1 file changed, 1 insertion(+) diff --git a/drun b/drun index 6b05e68..1d17dd6 100755 --- a/drun +++ b/drun @@ -126,6 +126,7 @@ MAP_CURRENT_DIR_OPT="-v $CURRENT_DIR:$CONTAINER_HOME" if [ -f '/proc/1/cgroup' ]; then CURRENT_CONTAINER=$(grep '/docker/' -- /proc/1/cgroup | head -n1 | cut -d '/' -f 3) if [ -n "${CURRENT_CONTAINER}" ]; then + docker inspect ${CURRENT_CONTAINER} # DEBUG ONLY # Maps volumes from current container EXTRA_OPTS="${EXTRA_OPTS:-} --volumes-from $CURRENT_CONTAINER" From ea226dce3614729cfc4006e19b7c35be383cdcdf Mon Sep 17 00:00:00 2001 From: JP Bochi Date: Thu, 10 May 2018 13:26:24 +0200 Subject: [PATCH 5/5] empty