Commit f8337756 authored by Michele Carignani's avatar Michele Carignani

Merge branch 'devop' into 'master'

Devop

See merge request !1
parents 79d958d0 2819e743
Pipeline #1541 failed with stage
in 0 seconds
#!/bin/bash
# Copyright ETSI 2018
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -vx
#set -e
cd "$(dirname "$0")"
run_dir="$(pwd)"
./scripts/build-container.sh
./scripts/run-container.sh "${run_dir}"
exit $?
#!/bin/bash
# Copyright ETSI 2019
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
set -vx
DOCKER_FILE=./scripts/docker/Dockerfile
if [ -f ${DOCKER_FILE} ]
then
#check and build stf569-rf image
DOCKER_ID=`docker ps -a | grep -e stf569-rf | awk '{ print $1 }'`
if [ ! -z "${DOCKER_ID}" ]
then
docker rm --force stf569-rf
fi
docker build --tag stf569-rf --force-rm -f ${DOCKER_FILE} .
if [ "$?" != "0" ]
then
echo "Docker build failed: $?"
exit -1
fi
docker image ls -a
docker inspect stf569-rf:latest
if [ "$?" != "0" ]
then
echo "Docker inspect failed: $?"
exit -2
fi
else
exit -3
fi
# That's all Floks
exit 0
FROM ubuntu:16.04
MAINTAINER ETSI STF 569
LABEL description="SFT569 Robot Framework Docker Image"
ENV TERM=xterm
ENV HOSTNAME docker-robot-STF569
ARG ssh_prv_key
RUN DEBIAN_FRONTEND=noninteractive apt update \
&& apt install python3 -y \
&& apt install python3-pip -y \
&& apt install openssh-server -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*
RUN echo "docker-robot-STF569" > /etc/hostname \
&& echo "root:etsi" | chpasswd
RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \
&& echo "etsi:etsi" | chpasswd \
&& adduser etsi sudo \
&& echo "etsi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN DEBIAN_FRONTEND=noninteractive \
&& mkdir -p /home/etsi/dev/robot \
&& cd /home/etsi/dev/robot
ADD . /home/etsi/dev/robot
RUN pip3 install robotframework
RUN DEBIAN_FRONTEND=noninteractive \
&& cd /home/etsi/dev/robot \
&& pip3 install -r requirements.txt \
&& chmod +x /home/etsi/dev/robot/scripts/*
CMD tail -f /dev/null
File mode changed from 100644 to 100755
......@@ -2,7 +2,9 @@
## Launch robot tests validator
/bin/bash /scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log
mkdir logs
/bin/bash scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log
## Filter failed Keywords
grep -r10n "| FAIL |" logs/robot_stdout.log | grep -v "Output:" | grep -v "Log:" | grep -v "Report:" > logs/failures.log
......@@ -18,4 +20,19 @@ ERRORS=`awk 'END{print NR}' logs/errors.log logs/failures.log`
if [ "${ERRORS}" -eq 0 ]; then
rm -f logs/errors.log
rm -f logs/failures.log
fi
\ No newline at end of file
fi
if [ ! -z logs/errors.log ]; then
cat logs/errors.log
fi
if [ ! -z logs/failures.log ]; then
cat logs/failures.log
fi
if [ ! -z logs/erros.log ] || [ ! -z logs.failures.log ]; then
echo "Errors are found. Job failed"
exit 1
fi
#!/bin/bash
# Copyright ETSI 2019
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
#set -vx
docker run stf569-rf:latest "/bin/bash" \
-c "cd /home/etsi/dev/robot \
&& sh scripts/run-all.bash \
&& ls -ltr logs/"
# That's all Floks
exit $?
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment