Blame view

script/git-upgrade 481 Bytes
f5815890   Antonio Terceiro   Adding upgrade sc...
1
2
3
4
#!/bin/sh

set -e

d25a2f8f   Antonio Terceiro   Organizing compon...
5
say(){
3f9ee972   Antonio Terceiro   git-upgrade: reus...
6
7
8
  if [ -t 1 ]; then
    printf "\033[33;01m$0: $1\033[m\n"
  fi
d25a2f8f   Antonio Terceiro   Organizing compon...
9
10
}

3f9ee972   Antonio Terceiro   git-upgrade: reus...
11
say "Upgrading code"
d25a2f8f   Antonio Terceiro   Organizing compon...
12

3f9ee972   Antonio Terceiro   git-upgrade: reus...
13
14
15
16
17
18
19
last_passed=$(curl --silent --fail http://ci.noosfero.org/noosfero/LAST_SUCCESS_HEAD || true)
if [ -n "$last_passed" ]; then
  git fetch
  git reset --hard "$last_passed"
else
  exit
fi
d25a2f8f   Antonio Terceiro   Organizing compon...
20

3f9ee972   Antonio Terceiro   git-upgrade: reus...
21
22
say "Compiling translations"
rake noosfero:translations:compile 2>/dev/null || (echo "Translations compilation failed; run manually to check"; false)
f5815890   Antonio Terceiro   Adding upgrade sc...
23

3f9ee972   Antonio Terceiro   git-upgrade: reus...
24
./script/production restart