Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
masakura committed May 9, 2016
0 parents commit 9898a55
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
.*#
#*
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:14.04
MAINTAINER Tomo Masakura <tomo.masakura@gmail.com>

# Install packages
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install -y default-jdk ant libc6:i386 libncurses5:i386 libstdc++6:i386 git build-essential curl wget zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev libncurses5-dev lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 expect && apt-get clean && rm -rf /var/lib/apt/list

# Install GitLab CI Multi Runner
RUN curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | bash
RUN apt-get install gitlab-ci-multi-runner && apt-get clean && rm -rf /var/lib/apt/list

# Install rbenv & ruby-build
ENV RBENV_ROOT /usr/local/.rbenv
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && git clone https://github.com/sstephenson/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build
RUN echo 'PATH=${RBENV_ROOT}/bin:$PATH' >> /etc/profile
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile

# Install Ruby
ADD ./install_ruby.sh ${RBENV_ROOT}/install_ruby.sh
ADD ./ruby_versions.list ${RBENV_ROOT}/ruby_versions.list
ENV CONFIGURE_OPTS --disable-install-doc
RUN xargs -L 1 ${RBENV_ROOT}/install_ruby.sh < ${RBENV_ROOT}/ruby_versions.list

# Install nvm
ENV NVM_DIR /usr/local/.nvm
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
#RUN echo 'source ${NVM_DIR}/nvm.sh' >> /etc/profile

# Install Node.js
ADD ./install_node.sh ${NVM_DIR}/install_node.sh
ADD ./node_versions.list ${NVM_DIR}/node_versions.list
RUN xargs -L 1 ${NVM_DIR}/install_node.sh < ${NVM_DIR}/node_versions.list

# Install Android SDK
ENV ANDROID_HOME /usr/local/android-sdk-linux
RUN curl -L http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | tar zxvf - -C /tmp && mv /tmp/android-sdk-linux ${ANDROID_HOME}
RUN echo 'PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> /etc/profile
ARG ANDROID_SDK_DOWNLOAD_PROXY_HOST
ARG ANDROID_SDK_DOWNLOAD_PROXY_PORT
ADD androidsdk_wrapper.sh ${ANDROID_HOME}/androidsdk_wrapper.sh
RUN ${ANDROID_HOME}/androidsdk_wrapper.sh update sdk --no-ui --no-https --filter tools
RUN ${ANDROID_HOME}/androidsdk_wrapper.sh update sdk --no-ui --no-https --all --filter build-tools-23.0.3,build-tools-22.0.1,build-tools-21.1.2,build-tools-20.0.0
RUN ${ANDROID_HOME}/androidsdk_wrapper.sh update sdk --no-ui --no-https --filter platform-tools,platform
42 changes: 42 additions & 0 deletions androidsdk_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

OPTS=""
LOGIN=""
PASSWORD=""
if [ "${http_proxy}" != "" ]; then
LOGIN=`echo ${http_proxy} | sed 's/^.*:\/\///; s/:.*//;'`
PASSWORD=`echo ${http_proxy} | sed 's/^[^@]*://; s/@.*//;'`
fi
if [ "${ANDROID_SDK_DOWNLOAD_PROXY_HOST}" != "" ]; then
OPTS=" --proxy-host ${ANDROID_SDK_DOWNLOAD_PROXY_HOST} --proxy-port ${ANDROID_SDK_DOWNLOAD_PROXY_PORT}"
fi

CMD=`cat <<EOF
spawn ${ANDROID_HOME}/tools/android $@ $OPTS
set timeout 1800
expect {
"Login: " {
exp_send "$LOGIN\r"
exp_continue
}
"Password: " {
exp_send "$PASSWORD\r"
exp_continue
}
"Workstation: " {
exp_send "\r"
exp_continue
}
"Domain: " {
exp_send "\r"
exp_continue
}
"Do you accept the license" {
exp_send "y\r"
exp_continue
}
}
EOF
`

expect -c "$CMD"
20 changes: 20 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
machine:
services:
- docker

dependencies:
override:
- docker build -t GrayBullet/docker-ci-envirnment:`git rev-parse --short HEAD` .
- docker tag GrayBullet/docker-ci-envirnment:`git rev-parse --short HEAD` GrayBullet/docker-ci-envirnment

test:
override:
- echo no test

deployment:
hub:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push GrayBullet/docker-ci-envirnment:`git rev-parse --short HEAD`
- docker push GrayBullet/docker-ci-envirnment
10 changes: 10 additions & 0 deletions install_node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

NODE_VERSION=$1

. $NVM_DIR/nvm.sh

nvm install $NODE_VERSION
nvm exec $NODE_VERSION npm install -g grunt-cli gulp bower
nvm alias default $NODE_VERSION

11 changes: 11 additions & 0 deletions install_ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -eu

RUBY_VERSION=$1

PATH=${RBENV_ROOT}/bin:$PATH
eval "$(rbenv init -)"

rbenv install $RUBY_VERSION
rbenv global $RUBY_VERSION
gem install bundler --no-rdoc --no-ri

3 changes: 3 additions & 0 deletions node_versions.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
stable
4

3 changes: 3 additions & 0 deletions ruby_versions.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2.0.0-p647
2.1.7
2.2.3

0 comments on commit 9898a55

Please sign in to comment.