Skip to content

Commit

Permalink
+ add archetype:generate test into CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jan 4, 2021
1 parent 094af90 commit bde5759
Showing 1 changed file with 70 additions and 7 deletions.
77 changes: 70 additions & 7 deletions scripts/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readonly eend=$'\033[0m' # escape end


################################################################################
# util functions
# common util functions
################################################################################

colorEcho() {
Expand Down Expand Up @@ -54,30 +54,93 @@ die() {


################################################################################
# CI operations
# build util functions
################################################################################

readonly -a MVN_CMD=(
./mvnw -V --no-transfer-progress
readonly -a MVN_OPTIONS=(
-V --no-transfer-progress
)

MVN() {
local maven_wrapper_name="mvnw"

local d="$PWD"
while true; do
[ "/" = "$d" ] && die "Fail to find $maven_wrapper_name!"
[ -f "$d/$maven_wrapper_name" ] && break

d=$(dirname "$d")
done

runCmd "$d/$maven_wrapper_name" "${MVN_OPTIONS[@]}" "$@"
}


################################################################################
# CI operations
################################################################################

(
headInfo "CI: cola-components"

cd cola-components/
runCmd "${MVN_CMD[@]}" install
MVN install
)


(
headInfo "CI: cola-archetypes"

cd cola-archetypes/
runCmd "${MVN_CMD[@]}" install
MVN install
)


(
headInfo "CI: archetype:generate by cola-framework-archetype-service"

demo_dir="cola-archetypes/target/cola-framework-archetype-service-demo"
mkdir -p "$demo_dir"
cd "$demo_dir"

artifactId=demo-service
MVN archetype:generate \
-DgroupId=com.alibaba.cola.demo.archetype-service -DartifactId=$artifactId -Dversion=1.0.0-SNAPSHOT \
-Dpackage=com.alibaba.cola.demo.service \
-DarchetypeGroupId=com.alibaba.cola \
-DarchetypeArtifactId=cola-framework-archetype-service \
-DarchetypeVersion=4.0.0 \
-DinteractiveMode=false

cd $artifactId
MVN install
)


(
headInfo "CI: archetype:generate by cola-framework-archetype-web"

demo_dir="cola-archetypes/target/cola-framework-archetype-web-demo"
mkdir -p "$demo_dir"
cd "$demo_dir"

artifactId=demo-web
MVN archetype:generate \
-DgroupId=com.alibaba.cola.demo.archetype-web -DartifactId=$artifactId -Dversion=1.0.0-SNAPSHOT \
-Dpackage=com.alibaba.cola.demo.web \
-DarchetypeGroupId=com.alibaba.cola \
-DarchetypeArtifactId=cola-framework-archetype-web \
-DarchetypeVersion=4.0.0 \
-DinteractiveMode=false

cd $artifactId
MVN install
)


(
headInfo "CI: sample/craftsman"

cd sample/craftsman/
runCmd "${MVN_CMD[@]}" install
MVN install
)

0 comments on commit bde5759

Please sign in to comment.