Skip to content

Commit

Permalink
@ teracyhq#42 | create teracy/travis image
Browse files Browse the repository at this point in the history
  • Loading branch information
hieptranquoc committed Oct 6, 2017
1 parent 7f11976 commit 3d21b4b
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -20,6 +20,7 @@ env:
- IMG_REPO=ubuntu BUILD_PATH=base IMG_TAG=16.04-dind-latest
- IMG_REPO=packer BUILD_PATH=latest IMG_TAG=latest
- IMG_REPO=python-coveralls BUILD_PATH=base IMG_TAG=latest
- IMG_REPO=travis-build BUILD_PATH=base IMG_TAG=latest
# additional tags
- IMG_REPO=angular-cli BUILD_PATH=base IMG_TAG=1.0.0 DOCKER_ARGS="--build-arg NG_CLI_VERSION=1.0.0"
- IMG_REPO=httpie-jwt-auth BUILD_PATH=base IMG_TAG=0.3.0 DOCKER_ARGS="--build-arg HTTPIE_JWT_AUTH_VERSION=0.3.0"
Expand Down
14 changes: 14 additions & 0 deletions dev-setup/vagrant_config_default.json
@@ -0,0 +1,14 @@
{
"vm": {
"synced_folders":[{ // Enable this for .git two-way sync
"_id": "docker-files-0",
"type": "virtual_box",
"host": "./workspace/docker-files/.git",
"guest": "/home/vagrant/workspace/docker-files/.git",
"mount_options": [
"dmode=775",
"fmode=755"
]
}]
}
}
29 changes: 29 additions & 0 deletions travis-build/base/Dockerfile
@@ -0,0 +1,29 @@
ARG RUBY_VERSION=2.3.4
FROM ruby:${RUBY_VERSION}

LABEL authors="hieptranquoc"

# add more arguments from CI to the image so that `$ env` should reveal more info
ARG CI_BUILD_ID
ARG CI_BUILD_REF
ARG CI_REGISTRY_IMAGE
ARG CI_BUILD_TIME

ENV CI_BUILD_ID=$CI_BUILD_ID CI_BUILD_REF=$CI_BUILD_REF CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE \
CI_BUILD_TIME=$CI_BUILD_TIME

ARG BRANCH_NAME="master"

RUN mkdir -p $HOME/builds

RUN cd $HOME/builds; \
git clone --depth=50 --branch=${BRANCH_NAME} https://github.com/travis-ci/travis-build.git; \
cd travis-build; \
gem install travis; \
printf "y" | travis; \
ln -s `pwd` ~/.travis/travis-build; \
bundle install --gemfile ~/.travis/travis-build/Gemfile; \
bundler binstubs travis

ENTRYPOINT ["travis"]
CMD [ "sh" ]
15 changes: 15 additions & 0 deletions travis-build/base/README.md
@@ -0,0 +1,15 @@
# teracy/travis-build Docker image

teracy/travis-build image for travis-ci runners locally.

## How to use

- To get docker volume mapping work, you should use the below usage example for each specific directory:

```
$ ws
$ cd <project_you_want_to_run>
$ docker run --rm -v $(pwd):/tmp -w /tmp teracy/travis-build compile > build.sh
```

You will see `build.sh` file in project!

0 comments on commit 3d21b4b

Please sign in to comment.