Skip to content

Commit

Permalink
Added Dockerfile for licensefinder/license_finder
Browse files Browse the repository at this point in the history
- Moved files to more consistent with concourse structure

[Finish #138061177]

Signed-off-by: Ryan Collins <[email protected]>
  • Loading branch information
Vikram Yadav authored and Ryan Collins committed Feb 3, 2017
1 parent 3fe86c2 commit eae74c0
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 51 deletions.
82 changes: 82 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y curl git-core

#install rvm
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
curl -sSL https://get.rvm.io | bash -s stable --ruby
ENV PATH=/usr/local/rvm/bin:$PATH

# install build-essential wget unzip
RUN apt-get install -y build-essential wget unzip

# nodejs seems to be required for the one of the gems
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
apt-get -y install nodejs

# install bower
RUN npm install -g bower && \
echo '{ "allow_root": true }' > /root/.bowerrc

# install bundler
RUN bash -lc "rvm install 2.3.3 && rvm use 2.3.3 && gem install bundler"

#install java 8
#http://askubuntu.com/questions/521145/how-to-install-oracle-java-on-ubuntu-14-04
RUN cd /tmp && \
wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.tar.gz -O jdk-8.tgz && \
tar xf /tmp/jdk-8.tgz && \
mkdir -p /usr/lib/jvm && \
mv jdk1.8.0_66 /usr/lib/jvm/oracle_jdk8 && \
rm /tmp/jdk-8.tgz

ENV J2SDKDIR=/usr/lib/jvm/oracle_jdk8
ENV J2REDIR=/usr/lib/jvm/oracle_jdk8/jre
ENV PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/bin
ENV JAVA_HOME=/usr/lib/jvm/oracle_jdk8
ENV DERBY_HOME=/usr/lib/jvm/oracle_jdk8/db

RUN java -version

# install python and rebar
RUN apt-get install -y python rebar

# install and update python-pip
RUN apt-get install -y python-pip && \
pip install --upgrade pip

# install maven
RUN curl -O http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz && \
tar -xf apache-maven-3.3.9-bin.tar.gz; rm -rf apache-maven-3.3.9-bin.tar.gz && \
mv apache-maven-3.3.9 /usr/local/lib/maven && \
ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn

# install gradle
WORKDIR /tmp
RUN curl -L -o gradle.zip http://services.gradle.org/distributions/gradle-2.4-bin.zip && \
unzip -q gradle.zip && \
rm gradle.zip && \
mv gradle-2.4 /root/gradle
ENV PATH=/root/gradle/bin:$PATH

#install go
WORKDIR /go
RUN wget https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz -O go.tar.gz && tar --strip-components=1 -xf go.tar.gz
ENV GOROOT /go
ENV PATH=$PATH:/go/bin

# godep is now required for license_finder to work for project that are still managed with GoDep
ENV GOROOT=/go
ENV GOPATH=/gopath
ENV PATH=$PATH:$GOPATH/bin
RUN mkdir /gopath && go get github.com/tools/godep

# Fix the locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# install license_finder
RUN bash -lc "git clone https://github.com/pivotal/LicenseFinder /LicenseFinder && cd /LicenseFinder && bundle install -j4 && rake install"

WORKDIR /
5 changes: 0 additions & 5 deletions ci/install_bower.sh

This file was deleted.

6 changes: 0 additions & 6 deletions ci/install_godep.sh

This file was deleted.

12 changes: 0 additions & 12 deletions ci/install_gradle.sh

This file was deleted.

14 changes: 0 additions & 14 deletions ci/install_rebar.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/pipeline.yml.erb → ci/pipelines/pipeline.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- get: LicenseFinder
trigger: true
- task: ruby-<%= ruby_version %>
file: LicenseFinder/build.yml
file: LicenseFinder/ci/tasks/build.yml
params:
RUBY_VERSION: <%= ruby_version %>
<% end %>
14 changes: 4 additions & 10 deletions ci/test.sh → ci/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
#!/bin/bash
#!/bin/bash --login

set -e -x

pushd LicenseFinder
source /root/.bash_profile

rbenv global $RUBY_VERSION
rvm install $RUBY_VERSION
rvm use $RUBY_VERSION
ruby --version

chmod +x ci/install_*.sh
./ci/install_rebar.sh
./ci/install_bower.sh
./ci/install_gradle.sh
./ci/install_godep.sh
export PATH=$PATH:$HOME/gradle/bin:$HOME/rebar:$HOME/go/bin GOPATH=$HOME/go
export GOPATH=$HOME/go
export RUBYOPT='-E utf-8'

gem update --system
Expand Down
6 changes: 3 additions & 3 deletions build.yml → ci/tasks/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ platform: linux
image_resource:
type: docker-image
source:
repository: ddubson/rb-go-java-node-erl-py
tag: v2
repository: licensefinder/license_finder
tag: latest

inputs:
- name: LicenseFinder

run:
path: ./LicenseFinder/ci/test.sh
path: ./LicenseFinder/ci/scripts/test.sh

params:
RUBY_VERSION:

0 comments on commit eae74c0

Please sign in to comment.