Commit f2a79323 authored by Yann Garcia's avatar Yann Garcia
Browse files

Create pipeline scripts

parent e5efe458
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+25 −0
Original line number Diff line number Diff line
# CI/CD:
#
# BUILD triggered by:
#  - any (branch commit)
#  
#   

stages:
  - build
    
Build stfubuntu docker image:
  stage: build
  before_script: cd common
  script: docker build --tag etsiforge/stfubuntu:20.04 -f Dockerfile.stfubuntu .
  rules:
    - changes:
        - common/Dockerfile.sftubuntu
              
Build TTCN-3 Test Suite docker image for devel:
  stage: build
  before_script: cd 5GCORE_NGAP
  script: docker build -t etsiforge/int-ts .
  rules:
    - changes:
        - 5GCORE_NGAP/Dockerfile
+22 −0
Original line number Diff line number Diff line
# CI/CD:
#
# Runnig tests triggered by:
#  - devel (branch commit) and ENVIRONMENT_ENABLED
#  

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH == "devel"
    
stages:
  - run
        
Running tests:
  stage: run
  before_script:
    - set -vx
  script:
    - echo 'Running tests'
    - docker run --interactive --tty --rm --publish 2222:22 --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix --cap-add=NET_RAW --cap-add=NET_ADMIN etsiforge/mec-ts /bin/bash -c "export ATS=AtsMec && cd ~ && . ./devenv.bash && sed --in-place 's/sbxpl1eil4/sbxrsvoat/g' ~/dev/mec_devel/etc/AtsMec/AtsMec.cfg && cd ~/dev/mec_devel/scripts && ./run_all.bash"
  rules:
    - if: $ENVIRONMENT_ENABLED == "True"
 No newline at end of file

5GCORE_NGAP/Dockerfile

0 → 100644
+26 −0
Original line number Diff line number Diff line
FROM etsiforge/stfubuntu:20.04

MAINTAINER ETSI INT 5G CORE

LABEL description="TTF_T033_Mec Docker Image"

ENV TERM=linux \
    HOME=/home/etsi \
    HOSTNAME=docker-titan-TTF_T033

COPY home /home/etsi

RUN cd /home/etsi \
    && chown -R etsi:etsi . \
    && ls ./etc/init.d/*.sh | while read S; do chmod 0750 "$S" || exit 1; done

USER etsi

RUN cd ${HOME} \
    && export PATH=$HOME/bin:$PATH \
    && ls ${HOME}/etc/init.d/*.sh | while read S; do /bin/bash -c "$S" || exit 1; done \
    && rm -fr ${HOME}/etc

CMD ["/bin/bash"]

# That's all Floks
+53 −0
Original line number Diff line number Diff line
#!/bin/bash

#set -e
set -vx

echo -e "*****************************\n* Install titan\n*****************************\n"
SRC_DIR=${HOME}/frameworks/titan/titan.core
export TTCN3_DIR=$HOME/frameworks/titan/Install

[ -f /usr/bin/java ] &&  export JAVA_HOME=`readlink -f /usr/bin/java | sed "s:bin/java::"`
TITAN_REPO=`cat ${HOME}/etc/titan_repos.txt | grep 'titan\.core\.git' | head -n 1`
export PATH=$PATH:$TTCN3_DIR/bin

mkdir -p "$SRC_DIR"
cd "$SRC_DIR/.." || exit 1

# Install titan core
git clone --progress "$TITAN_REPO" || exit 1

cd titan.core || exit 1
cat >Makefile.personal <<EOF
TTCN3_DIR=$TTCN3_DIR
JNI=no
GUI=no
DEBUG=no
GEN_PDF=no
JDKDIR=$JAVA_HOME
EOF

# To prevent link error /usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command lineema  
sed --in-place 's/LINUX_LIBS     := -lxml2/LINUX_LIBS     := -lxml2 -lpthread/g' ./core/Makefile

make && make install || exit 1

# To be compiant with build_ttcn3.bash
# TODO Refactor build_ttcn3.bash & devenv.bash
mv ${TTCN3_DIR} ${SRC_DIR}
export TTCN3_DIR=${SRC_DIR}/Install

echo "export TTCN3_DIR=$TTCN3_DIR" >> $HOME/.bashrc
echo "export PATH=\$PATH:\$TTCN3_DIR/bin" >> $HOME/.bashrc

# Install other repos
cd $SRC_DIR/.. || exit 1
cat ${HOME}/etc/titan_repos.txt | grep -v -e '^\s*#' -e 'titan\.core' | while read REPO; do
  [ -z $ $REPO ] && continue
  WS=`echo $REPO | sed -e 's|.*/||g' -e 's|\.git||g'`
  if git clone --progress "${REPO}" "${WS}"; then
    [ -f "$WS/Makefile" ] && make -C "$WS"
  fi
done

cd $HOME
+26 −0
Original line number Diff line number Diff line
#!/bin/bash

ECLIPSE_URL='https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz&r=1'
TITAN_URL='https://www.eclipse.org/downloads/download.php?file=/titan/TITAN_Designer_and_Executor_Plugin_7.1.0.zip&r=1'

#set -e
set -vx

echo -e "*****************************\n* Install eclipse\n*****************************\n"

mkdir -p ${HOME}/frameworks
cd ${HOME}/frameworks || exit 1
wget --progress=dot:mega 'http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2024-03/R/eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz || exit 1
tar -zxvf ./eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz || exit 1
ln -sf ${HOME}/frameworks/eclipse/eclipse ${HOME}/bin/eclipse
rm -f ./eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz

if wget --progress=dot:mega 'https://www.eclipse.org/downloads/download.php?file=/titan/TITAN_Designer_and_Executor_plugin-8.1.0.zip' -OTITAN_Designer_and_Executor_plugin.zip; then
  eclipse/eclipse -noSplash -application org.eclipse.equinox.p2.director \
    -destination /home/etsi/frameworks/eclipse \
    -repository 'jar:file:///home/etsi/frameworks/TITAN_Designer_and_Executor_plugin.zip!/' \
    -installIU TITAN_Designer.feature.group,TITAN_Executor.feature.group,TITAN_Log_Viewer.feature.group,Titan_external_dependencies.feature.group,Titanium.feature.group,Titanium_external_dependencies.feature.group
  rm -f TITAN_Designer_and_Executor_plugin.zip
fi

cd ${HOME}
Loading