aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/validate-archetype-common.sh
blob: 48aa7b3586bf738026558bcd7d7e6bc966d5a068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash

display_usage() {
echo -e "\nUsage:\n$0 <version> <framework staging id> <archetypes staging id> <plugin staging id>\n"
echo -e "Example: 7.3.7 1450 1451 1452"
}

display_sed() {
echo -e "\nGNU sed was not found. If you are running Linux, ensure you have sed installed an in your PATH\n"
echo -e "If you are running Mac OS X, install gsed and ensure it is in your PATH"
}

SED=sed
# Ensure we have GNU sed
$SED --version 2>&1|grep "GNU sed" > /dev/null
if [ "$?" != "0" ]
then
	# Try gsed
	SED=gsed
	gsed --version 2>&1|grep "GNU sed" > /dev/null
	if [ "$?" != "0" ]
	then
		display_sed
		exit 2
	fi
fi

# if less than two arguments supplied, display usage
if [  $# -le 3 ]
then
  display_usage
  exit 1
fi


# check whether user had supplied -h or --help . If yes display usage
if [[ ( $# == "--help") ||  $# == "-h" ]]
then
  display_usage
  exit 0
fi

ARCHETYPE_GROUP=com.vaadin
ARCHETYPE_VERSION=$1

REPOBASE=https://oss.sonatype.org/content/repositories/
VAADINREPO=$REPOBASE"comvaadin-$2"
ARCHETYPEREPO=$REPOBASE"comvaadin-$3"
PLUGINREPO=$REPOBASE"comvaadin-$4"

ART=test-$ARCHETYPE_ARTIFACT-$ARCHETYPE_VERSION
ART=`echo $ART|sed "s/\./-/g"`
GROUP=testpkg