Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions codeship-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app:
build: ./codeship/
cached: true
add_docker: true
working_dir: /app
volumes:
- .:/app
18 changes: 18 additions & 0 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- type: serial
name: examplezz
service: app
steps:
- 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.'"
3 changes: 3 additions & 0 deletions codeship/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine

RUN apk add --update docker jq curl checkbashisms
1 change: 1 addition & 0 deletions drun
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down