Skip to content

Commit

Permalink
docker agent prototype
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Mendes Spessoto Junior <[email protected]>
  • Loading branch information
MarceloSpessoto committed Jun 13, 2024
1 parent 38d7866 commit 4c9c66f
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 19 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM jenkins/jenkins:lts
USER root

RUN apt update -y \
&& apt install -y binutils-dev libssl-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake build-essential python3
# && cmake . \
# && make \
# && make install
#
#COPY /kworkflow/ /tests/
#WORKDIR /tests/
RUN apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
USER kworkflow
# && ls \
# && ./run_tests.sh prepare \
# && mkdir kcov_out/ \
# && git config --global user.email "[email protected]" \
# && git config --global user.name "Kworkflow" \
# && ./run_tests.sh prepare \
# && kcov --include-path=src,kw --exclude-pattern=src/bash_autocomplete.sh,src/help.sh kcov_out/ ./run_tests.sh
40 changes: 21 additions & 19 deletions jenkinsfiles/codecov
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
pipeline {
agent any
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
stage('Build') {
steps {
echo 'Building..'
sh "ls"
}
}
stage('Test') {
steps {
parallel(
"Test": {
echo 'Testing..'
},
"Integration Test": {
echo 'Integration Test testing 1234567...'
}
)
}
}
stage('Deploy') {
steps {
echo 'Deploying 123....'
}
}

}
}
28 changes: 28 additions & 0 deletions jenkinsfiles/formatter-shfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pipeline {
agent {
dockerfile true
}
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}

}
}
26 changes: 26 additions & 0 deletions jenkinsfiles/integration_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline {
agent { dockerfile true }
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}

}
}
26 changes: 26 additions & 0 deletions jenkinsfiles/setup_and_doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline {
agent { dockerfile true }
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}

}
}
26 changes: 26 additions & 0 deletions jenkinsfiles/shellcheck-reviewdog
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline {
agent { dockerfile true }
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}

}
}
26 changes: 26 additions & 0 deletions jenkinsfiles/unit_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline {
agent { dockerfile true }
stages {

stage('Build'){
steps{
sh '''
apt update -y
apt install -y shunit2 bc sqlite3 bsdmainutils libxml-xpath-perl
./run_tests.sh prepare
rm -rf kcov_out
mkdir kcov_out/
git config --global user.email "[email protected]"
git config --global user.name "Kworkflow"
./run_tests.sh
kcov --include-path=src,kw \
--exclude-pattern=src/bash_autocomplete.sh,src/help.sh \
kcov_out/ ./run_tests.sh
mv kcov_out/run_tests.sh.*/cobertura.xml $(pwd)/cobertura.xml
'''
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
}
}

}
}

0 comments on commit 4c9c66f

Please sign in to comment.