Skip to content
Snippets Groups Projects
Commit 9fb83c37 authored by Suru Dissanaike's avatar Suru Dissanaike
Browse files

iopsys/code-analysis:0.2

parent a912de3e
No related branches found
No related tags found
No related merge requests found
include:
- project: 'iopsys/gitlab-ci-pipeline'
file: '/static-code-analysis.yml'
stages:
- static_code_analysis
- format_check
- build
- unit_testing
- dynamic_code_analysis
- api_testing
variables:
DEBUG: 'TRUE'
SOURCE_FOLDER: "."
run_format_check:
stage: format_check
image: iopsys/code-analysis:0.1
allow_failure: true
script:
- "ls"
run_build:
stage: build
image: iopsys/code-analysis:0.1
allow_failure: true
script:
- "ls"
run_unit_testing:
stage: unit_testing
image: iopsys/code-analysis:0.1
allow_failure: true
script:
- "make test"
run_dynamic_code_analysis:
stage: dynamic_code_analysis
image: iopsys/code-analysis:0.1
allow_failure: true
script:
- "make test_coverage"
run_api_testing:
stage: api_testing
image: iopsys/code-analysis:0.1
allow_failure: true
script:
- "ls"
\ No newline at end of file
......@@ -6,7 +6,7 @@ LABEL run="docker run -it --entrypoint /bin/bash --rm -v ${PWD}:/opt/work code-a
# docker build -t code-analysis .
# docker images
# docker tag <image id> iopsys/code-analysis:0.x
# docker tag <image id> iopsys/code-analysis:0.1
# docker push iopsys/code-analysis:0.x
......@@ -15,6 +15,7 @@ RUN \
# general tools
git \
cmake \
curl \
wget \
build-essential \
lcov \
......@@ -41,7 +42,6 @@ RUN \
flawfinder
# Install dependent libraries
RUN \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
......@@ -59,6 +59,20 @@ RUN rm -rf /var/lib/apt/lists/*
RUN mkdir /opt/dev
RUN mkdir /etc/config
# install node
ENV NODE_VERSION=12.14.1
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version
# install tap-junit
RUN npm i -g tap-junit
# Install JSON-C
RUN \
......@@ -122,7 +136,61 @@ RUN \
git checkout 44b32937a062ec4ffc9f7355841dc94ab6efa50f && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:String="Release" . && \
make && \
make install
sudo make install
# nlohmann
RUN \
cd /opt/dev && \
git clone https://github.com/nlohmann/json.git && \
cd json && \
git checkout be61ad147000be4802173d0d118fd1b8109b4668 && \
mkdir build && \
cd build && \
cmake .. && \
cmake --build . && \
sudo make install
# json-schema-validator-cpp
RUN \
cd /opt/dev && \
git clone https://github.com/pboettch/json-schema-validator.git json-schema-validator-cpp && \
cd json-schema-validator-cpp && \
git checkout 3ec0e69a0bce7524f12a865b153b71d0d7ef2484 && \
mkdir build && \
cd build && \
cmake .. -DBUILD_SHARED_LIBS=ON && \
make && \
sudo make install && \
sudo ldconfig
# iopsys json-schema-validator
RUN \
cd /opt/dev && \
git clone https://dev.iopsys.eu/iopsys/json-schema-validator.git && \
cd json-schema-validator && \
git checkout devel && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:String="Release" . && \
make && \
sudo make install && \
sudo ldconfig
# tap
RUN \
cd /opt/dev && \
git clone https://github.com/zorgnax/libtap.git && \
cd libtap && \
make && \
sudo make install && \
sudo ldconfig
# git ubus-api-validator
RUN \
cd /opt/dev && \
git clone https://dev.iopsys.eu/iopsys/ubus-api-validator.git && \
cd ubus-api-validator && \
make && \
sudo make install
#install cpd
WORKDIR /home/user
......@@ -136,3 +204,14 @@ WORKDIR /opt/work
# Prepare supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Prepare JSON Schemas
RUN mkdir -p /usr/share/rpcd/schemas
RUN mkdir -p /usr/share/rpcd/definitions
RUN node --version
RUN npm --version
# Start entrypoint
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
#!/bin/bash
set -x
# Start supervisor
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf -l /var/log/supervisord.log -j /var/run/supervisord.pid
#Start bash to enable an interactive session
/bin/bash
[supervisord]
nodaemon=true
nodaemon=false
[program:ubusd]
command=/bin/bash -c "/usr/sbin/ubusd"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment