Commit d1c677b0 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'ci-try-outs' into 'develop'

MR proper merge

See merge request !10
parents c20e9959 5ad10be0
Pipeline #8838 passed with stage
in 0 seconds
......@@ -26,8 +26,10 @@ pipeline {
echo "GitLab tar branch is ${env.gitlabTargetBranch}"
// GitLab-Jenkins pugin integration is lacking to perform the merge by itself
// Doing it manually --> it may have merge conflicts
sh "git merge --ff origin/${env.gitlabTargetBranch}"
sh "git log -n1"
sh "./scripts/doGitLabMerge.sh ${GIT_COMMIT} ${env.gitlabTargetBranch}"
sh "./scripts/checkCodingFormattingRules.sh ${GIT_COMMIT} ${env.gitlabTargetBranch}"
} else {
sh "./scripts/checkCodingFormattingRules.sh"
}
}
}
......
# OAI is using a style that is similar to the Google style
--style=google
# long options can be written without the preceding '--'
# Convert tabs to spaces
convert-tabs
# Indentation is 2 spaces
indent=spaces=2
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
indent-switches
# Indent C++ comments beginning in column one.
indent-col1-comments
# Pad empty lines around header blocks
break-blocks
delete-empty-lines
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
align-pointer=name
# The code line length is 200 characters/columns
max-code-length=200
break-after-logical
lineend=linux
#!/bin/bash
if [ $# -eq 0 ]
then
NB_FILES_TO_FORMAT=`astyle --dry-run --options=scripts/astyle-options.txt src/*.* | grep -c Formatted `
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
exit 0
fi
if [ $# -eq 2 ]
then
# Merge request scenario
INIT_COMMIT=$1
echo "Initial Commit is : $INIT_COMMIT"
TARGET_BRANCH=$2
echo "Target Branch is : $TARGET_BRANCH"
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
echo "Merged Commit is : $MERGE_COMMMIT"
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
echo "Target Init is : $TARGET_INIT_COMMIT"
# Retrieve the list of modified files since the latest develop commit
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
NB_TO_FORMAT=0
for FULLFILE in $MODIFIED_FILES
do
echo $FULLFILE
filename=$(basename -- "$FULLFILE")
EXT="${filename##*.}"
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
then
TO_FORMAT=`astyle --dry-run --options=scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
fi
done
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
exit 0
fi
if [ $# -ne 0 ] || [ $# -ne 2 ]
then
echo "Syntax error: $0 without any option will check all files in repository"
echo " or: $0 feature-branch-commit-id target-branch"
echo " will only check files that are pushed for a merge-request"
exit 1
fi
#!/bin/bash
INIT_COMMIT=$1
echo "Initial Commit is : $INIT_COMMIT"
TARGET_BRANCH=$2
echo "Target Branch is : $TARGET_BRANCH"
git checkout origin/$TARGET_BRANCH
git config user.email "jenkins@openairinterface.org"
git config user.name "OAI Jenkins"
git merge --ff $INIT_COMMIT -m "Temporary merge for CI"
/*
* Comments
* Copyright OAI Software Alliance - 2018
* Author Raphael Defosseux
* Comments : Proper comments
*/
#include <stdio.h>
......
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