2f9be27299e778a046e2537e7f33550de2d84112
[releng.git] / jjb / sandbox / promote.sh
1 #!/bin/bash
2 #set -o errexit
3 #set -o nounset
4 #set -o pipefail
5
6 # get the job type
7 # we only support verify, merge, daily and weekly jobs
8 if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then
9     JOB_TYPE=${BASH_REMATCH[0]}
10 else
11     echo "Unable to determine job type!"
12     exit 1
13 fi
14
15 # do stuff differently based on the job type
16 case "$JOB_TYPE" in
17     verify)
18         echo "Running as part of verify job"
19         ;;
20     merge)
21         echo "Running as part of merge job"
22         ;;
23     daily)
24         echo "Running as part of daily job"
25         ;;
26     weekly)
27         echo "Running as part of weekly job"
28         ;;
29     *)
30         echo "Job type $JOB_TYPE is not supported!"
31         exit 1
32 esac
33
34 # this just shows we can get the patch/commit information
35 # no matter what job we are executed by
36 cd $WORKSPACE
37 echo
38 echo "Commit Message is"
39 echo "-------------------------------------"
40 git log --format=%B -n 1 $(git rev-parse HEAD)
41 echo "-------------------------------------"
42 echo
43 echo "Repo contents"
44 echo "-------------------------------------"
45 ls -al
46 echo "-------------------------------------"
47 echo
48 echo "Changed files are"
49 echo "-------------------------------------"
50 git diff origin/master --name-only
51 echo "-------------------------------------"
52 echo
53 echo "Change introduced"
54 echo "-------------------------------------"
55 git diff origin/master
56 echo "-------------------------------------"
57 echo
58 echo "git show"
59 echo "-------------------------------------"
60 git show
61 echo "-------------------------------------"