Blame view

script/software_communities_ci.sh 2.69 KB
a6a82ec3   Tallys Martins   Add scripts to ru...
1
2
3
RED='\033[1;31m'
GREEN='\033[1;32m'
NC='\033[0m'
39855a9c   Tallys Martins   Added travis CI
4
current_path=$(pwd)
a6a82ec3   Tallys Martins   Add scripts to ru...
5

39855a9c   Tallys Martins   Added travis CI
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
printf "${GREEN}=================================\n"
printf "Enabling SPB plugins${NC}\n"
ln -s "$current_path/../src/noosfero-spb/software_communities/" plugins/software_communities
ln -s "$current_path/../src/noosfero-spb/gov_user/" plugins/gov_user
ln -s "$current_path/../src/noosfero-spb/spb_migrations/" plugins/spb_migrations
ln -s "$current_path/../src/noosfero-spb/noosfero-spb-theme" public/designs/themes/noosfero-spb-theme

printf "${GREEN}=================================\n"
printf "Enabling Organization Ratings${NC}\n"
./script/noosfero-plugins enable organization_ratings
bundle exec rake db:migrate
ratings=$?

printf "${GREEN}=================================\n"
printf "Enabling Gov User, Software Communities and SPB Migrations${NC}\n"
./script/noosfero-plugins enable software_communities gov_user
bundle exec rake db:migrate
gov_and_soft_plugins=$?


printf "${GREEN}=================================\n"
printf "Enabling SPB Migrations${NC}\n"
./script/noosfero-plugins enable spb_migrations
bundle exec rake db:migrate
spb_migrations=$?

printf "${GREEN}=================================\n"
printf "Compiling translations${NC}\n"
rake noosfero:translations:compile &>/dev/null
translations=$?

if [ $gov_and_soft_plugins -ne 0 ] || [ $ratings -ne 0 ] || [ $translations -ne 0 ] || [ $spb_migrations -ne 0 ]; then
	printf "${RED}=================================\n"
	printf "Error migrating SPB plugins!!n${NC}\n"
  exit 1
fi

printf "${GREEN}=================================\n"
printf "Running rake db:test:prepare${NC}\n"
bundle exec rake db:test:prepare

# =======================================================================================
a6a82ec3   Tallys Martins   Add scripts to ru...
48
49
50
51
52
53
54
55
56
57
58
59
60
./script/noosfero-plugins disable gov_user
printf "${GREEN}=================================\n"
printf "SoftwareCommunitiesPlugin:UNITS${NC}\n"
rake test:units TEST=plugins/software_communities/test/unit/*
units=$?

printf "${GREEN}=================================\n"
printf "SoftwareCommunitiesPlugin:FUNCTIONALS${NC}\n"
rake test:functionals TEST=plugins/software_communities/test/functional/*
functionals=$?

printf "${GREEN}=================================\n"
printf "SoftwareCommunitiesPlugin:SELENIUM${NC}\n"
39855a9c   Tallys Martins   Added travis CI
61
ruby -S cucumber --profile software_communities_selenium --format progress
a6a82ec3   Tallys Martins   Add scripts to ru...
62
63
64
65
selenium=$?

printf "${GREEN}=================================\n"
printf "SoftwareCommunitiesPlugin:CUCUMBER${NC}\n"
39855a9c   Tallys Martins   Added travis CI
66
ruby -S cucumber --profile software_communities --format progress
a6a82ec3   Tallys Martins   Add scripts to ru...
67
68
69
70
71
72
73
cucumber=$?

if [ $units -ne 0 ] || [ $functionals -ne 0 ] || [ $selenium -ne 0 ] || [ $cucumber -ne 0 ]; then
	printf "${RED}=================================\n"
	printf "ERROR RUNNING SOFTWARE COMMUNITIES PLUGIN TESTS${NC}\n"
	exit 1
fi