diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be5afd1292b9303a8f03197f6fe38f92fdb73652..762b5be8d2507db652d460786858e3b3e32f2c08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,26 +11,26 @@ # Job definition for automated Docker image building # create_image: - stage: build + stage: build - # - # Select proper runner node - # - tags: - - docker-build + # + # Select proper runner node + # + tags: + - docker-image-build - # - # This section is unused, but required by Gitlab-CI - # - script: - - echo 'Create Docker image' + # + # This section is unused, but required by Gitlab-CI + # + script: + - echo 'Create Docker image' - # - # Set parameters for image building - # - variables: - TO: 'docker.cern.ch/security-services/code-checking:latest' - DOCKER_INFO: 'true' # Display Docker informations - DOCKER_LOGIN_SERVER: 'docker.cern.ch' - DOCKER_LOGIN_USERNAME: $_DOCKER_USERNAME - DOCKER_LOGIN_PASSWORD: $_DOCKER_PASSWORD + # + # Set parameters for image building + # + variables: + TO: 'docker.cern.ch/security-services/code-checking:latest' + DOCKER_INFO: 'true' # Display Docker informations + DOCKER_LOGIN_SERVER: 'docker.cern.ch' + DOCKER_LOGIN_USERNAME: $_DOCKER_USERNAME + DOCKER_LOGIN_PASSWORD: $_DOCKER_PASSWORD diff --git a/Dockerfile b/Dockerfile index e6a94f38ec5de5b7d3583b6a3e2eb07efe6f55fa..bc2cc57c5225dc36e8ec42d290d5c7b3c916031b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,13 @@ MAINTAINER "CERN IT-DI-CSO <computer.security@cern.ch>" ENV basedir /opt +# +# Create space for extra aliases +# +RUN touch /etc/profile.d/cso-aliases.sh +RUN chmod +x /etc/profile.d/cso-aliases.sh + + # # Enable extra repositories # @@ -32,10 +39,36 @@ RUN yum -y groups mark convert RUN yum -y groupinstall 'Development Tools' +# +# Install Java development packages +# +RUN yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel + + +# +# Install Perl development packages +# +RUN yum -y install perl perl-devel + + # # Install Python development packages # -RUN yum -y install python-devel python-flake8 python-pep8 +RUN yum -y install python python-devel +RUN yum -y install python-flake8 python-pep8 + + +# +# Install Ruby development packages +# +RUN yum -y install ruby ruby-devel + + +# +# Install Python PIP +# +RUN yum -y install python-pip +RUN pip install --upgrade pip # @@ -53,27 +86,40 @@ RUN yum -y install expat expat-devel RUN yum -y install flex flex-devel +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + # -# Install dependencies for PMD and FindBugs +# Install CppLint # -RUN yum -y install java +RUN pip install cpplint # -# Install RATS +# Install FindBugs # WORKDIR $basedir -RUN wget https://rough-auditing-tool-for-security.googlecode.com/files/rats-2.4.tgz -RUN tar -xzf rats-2.4.tgz +RUN wget http://prdownloads.sourceforge.net/findbugs/findbugs-3.0.1.tar.gz +RUN tar -xzf findbugs-3.0.1.tar.gz -WORKDIR $basedir/rats-2.4 -RUN ./configure && make && make install +RUN echo "alias findbugs='/opt/findbugs-3.0.1/bin/findbugs'" >> /etc/profile.d/cso-aliases.sh # -# Install PyLint +# Install FlawFinder # -RUN yum -y install pylint +WORKDIR $basedir +RUN wget http://www.dwheeler.com/flawfinder/flawfinder-1.31.tar.gz +RUN tar -xzf flawfinder-1.31.tar.gz + +WORKDIR $basedir/flawfinder-1.31 +RUN make install + + +# +# Install Perl::Critic +# +RUN yum -y install perl-Perl-Critic # @@ -83,10 +129,37 @@ WORKDIR $basedir RUN wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.5.1/pmd-bin-5.5.1.zip RUN unzip pmd-bin-5.5.1.zip +RUN echo "alias cpd='/opt/pmd-bin-5.5.1/bin/run.sh cpd'" >> /etc/profile.d/cso-aliases.sh +RUN echo "alias pmd='/opt/pmd-bin-5.5.1/bin/run.sh pmd'" >> /etc/profile.d/cso-aliases.sh + # -# Install FindBugs +# Install PyChecker +# +RUN yum -y install pychecker + + +# +# Install PyLint +# +RUN yum -y install pylint + + +# +# Install RATS # WORKDIR $basedir -RUN wget http://prdownloads.sourceforge.net/findbugs/findbugs-3.0.1.tar.gz -RUN tar -xzf findbugs-3.0.1.tar.gz +RUN wget https://rough-auditing-tool-for-security.googlecode.com/files/rats-2.4.tgz +RUN tar -xzf rats-2.4.tgz + +WORKDIR $basedir/rats-2.4 +RUN ./configure && make && make install + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +# +# Finish +# +WORKDIR /