Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
f256dfff
Commit
f256dfff
authored
5 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Using single zips rather than ensembles
parent
436c4df6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AuswertungKlausur/noten.sh
+58
-55
58 additions, 55 deletions
AuswertungKlausur/noten.sh
with
58 additions
and
55 deletions
AuswertungKlausur/noten.sh
+
58
−
55
View file @
f256dfff
#!/bin/bash
#!/bin/bash
# TODO: devine marker string variable
# TODO: show non-compiling projects in logfile
#rm -rf Unpack
# The original examination project skeleton
# The original examination project skeleton
PROJECTREF
=
~/GoikLectures/Klausuren/Sd1/201
7S
ummer/Exam
PROJECTREF
=
~/GoikLectures/Klausuren/Sd1/201
9s
ummer/Exam
#
R
epresentative of archive integrity
#
File r
epresentative of archive integrity
SRCREPRESENT
=
src/main/java/de/hdm_stuttgart/mi/sd1/
aufgabe1/HandyAbrechn
un
g
.java
SRCREPRESENT
=
src/main/java/de/hdm_stuttgart/mi/sd1/
task2/ChangeAmo
un
t
.java
# The executable jar archive containing unit tests
# The executable jar archive containing unit tests
TESTJAR
=
sd1_201
7so
mmer_exam-0.9-fat-tests.jar
TESTJAR
=
sd1_201
9su
mmer_exam-0.9-fat-tests.jar
# Strings like e.g. "Aufgabe 2" referencing "Aufgabe 2: (30/50)"
# Strings like e.g. "Aufgabe 2" referencing "Aufgabe 2: (30/50)"
declare
-a
MARKERS
=(
"Aufgabe 1"
"Aufgabe 2"
)
declare
-a
MARKERS
=(
"Aufgabe 1"
"Aufgabe 2"
)
#
No changes
beyond this line
#
Hands off
beyond this line
#--------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------
mkdir
-p
Unpack
zip
=
$1
fbname
=
$(
basename
"
$zip
"
.zip
)
rm
-rf
~/results.log /tmp/Reference
rm
-rf
~/results.log /tmp/Reference
cp
-r
$PROJECTREF
/tmp/Reference
cp
-r
$PROJECTREF
/tmp/Reference
pushd
/tmp/Reference
pushd
/tmp/Reference
mvn
-T4
clean
;
mvn
-T4
clean
>
/dev/null 2>&1
rm
-rf
src/main/java
rm
-rf
src/main/java
popd
popd
for
zip
in
$(
ls
*
.zip
)
;
do
mkdir
Unpack
;
pushd
Unpack
fbname
=
$(
basename
"
$zip
"
.zip
)
unzip ../
$fbname
.zip
>
/dev/null
echo
$fbname
pomFileCount
=
`
find
.
-name
pom.xml|wc
-l
`
mkdir
Unpack
;
pushd
Unpack
if
[[
1
=
$pomFileCount
]]
;
then
unzip ../
$fbname
.zip
projectDir
=
`
find
.
-name
pom.xml
`
pomFileCount
=
`
find
.
-name
pom.xml|wc
-l
`
projectDir
=
${
projectDir
%/*
}
if
[[
1
=
$pomFileCount
]]
;
then
echo
"Found project
$projectDir
"
projectDir
=
`
find
.
-name
pom.xml
`
projectDir
=
${
projectDir
%/*
}
echo
"Found project
$projectDir
"
if
[
-f
$projectDir
/
$SRCREPRESENT
]
;
then
if
[
-f
"
${
projectDir
}
"
/
$SRCREPRESENT
]
;
then
echo
"Found
$projectDir
/
$SRCREPRESENT
"
echo
"Found
$projectDir
/
$SRCREPRESENT
"
cp
-r
/tmp/Reference
.
cp
-r
/tmp/Reference
.
cp
-r
$projectDir
/src/main/java Reference/src/main
cp
-r
"
$projectDir
"
/src/main/java Reference/src/main
pushd
Reference
pushd
Reference
mvn
-T4
compile test-compile
mvn
-T4
compile test-compile
>
/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
mvn
-T4
-Dmaven
.test.skip
=
true
package
mvn
-T4
-Dmaven
.test.skip
=
true
package
>
/dev/null 2>&1
result
=
""
result
=
""
for
mark
in
"
${
MARKERS
[@]
}
"
;
do
for
mark
in
"
${
MARKERS
[@]
}
"
;
do
result+
=
`
java
-jar
target/
$TESTJAR
|
grep
"
$mark
"
|sed
's/^[ ]*//'
`
result+
=
`
java
-jar
target/
$TESTJAR
|
grep
"
$mark
"
|sed
's/^[ ]*//'
`
result+
=
" "
result+
=
" "
done
done
else
else
result
=
"
$projectDir
does not compile"
echo
"
$projectDir
does not compile"
fi
exit
1
;
popd
fi
echo
"
$fbname
$result
"
>>
~/results.log
popd
echo
"
$fbname
$result
"
>>
~/results.log
#Cleanup user project
pushd
$projectDir
#Cleanup user project
rm
-rf
*
.iml .idea A1.log
pushd
"
$projectDir
"
mvn clean
rm
-rf
*
.iml .idea A1.log
popd
mvn clean
>
/dev/null 2>&1
rm
../
$fbname
.zip
popd
zip
-r
../
$fbname
.zip
$projectDir
rm
../
"
$fbname
"
.zip
else
zip
-r
../
"
$fbname
"
.zip
"
$projectDir
"
>
/dev/null 2>&1
echo
"
$fbname
:
$SRCREPRESENT
not found"
>>
~/results.log
fi
else
else
echo
"
$fbname
: Found more than one directory component"
>>
~/results.log
echo
"
$fbname
:
${
projectDir
}
/
$SRCREPRESENT
not found"
exit
1
fi
fi
popd
# return from Unpack
else
rm
-rf
Unpack
echo
"
$fbname
: Found more than one directory component"
>>
~/results.log
done
exit
1
fi
popd
# return from Unpack
rm
-rf
Unpack
echo
"---------------------------------------"
cat
~/results.log
echo
"+++++++++++++++++++++++++++++++++++++++"
uid
=
`
echo
$1
|
sed
-e
s/.zip//
`
grep
$uid
~/bonusprojekte.csv
echo
"---------------------------------------"
echo
Results at ~/results.log
#end
#end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment