-
Notifications
You must be signed in to change notification settings - Fork 8
/
jenkins.sh
executable file
·141 lines (123 loc) · 4.99 KB
/
jenkins.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/sh
# Change directory
mypath=`realpath $0`
cd `dirname $mypath`
export PROGDIR="`realpath`"
if [ -z "$JENKINS_DO_UPDATE" ] ; then
# Git pull may fail if this isn't set
if [ -z "$(git config --global user.email)" ] ; then
git config --global user.email "[email protected]"
git config --global user.name "Jenkins Node"
fi
# Before we begin any build, make sure we are updated from git
git reset --hard
git pull
export JENKINS_DO_UPDATE="YES"
./jenkins.sh "$1" "$2" "$3"
exit $?
fi
# Set the variables
TYPE="${1}"
BUILD="${2}"
BRANCH="${3}"
# Set JENKINS var
export USING_JENKINS="YES"
# Pkg does stuff now with ABIs and it prevents updating the database
export IGNORE_OSVERSION="YES"
display_usage() {
cat << EOF
Available Commands:
-- FreeNAS Commands --
freenas - Builds FreeNAS release
freenas-docs - Create FreeNAS Handbook
freenas-tn-docs - Create TrueNAS Handbook
freenas-api - Create FreeNAS API
freenas-push-docs - Push FreeNAS Docs
freenas-push-tn-docs - Push TrueNAS Docs
freenas-push-api - Push FreeNAS API
freenas-push-nightly - Run 'release-push' for FreeNAS Nightly
freenas-push - Run 'release-push' for FreeNAS / TrueNAS
mkcustard - Build a Custard VM
mktrueview - Build a TrueView VM
-- TrueOS Commands --
trueos-world - Builds the world
trueos-pkg - Builds the entire pkg repo
trueos-iso-pkg - Builds just the pkgs needed for ISO creation
trueos-iso - Builds the ISO files
trueos-vm - Builds the VM images
publish-iso - Upload ISO files to ScaleEngine
publish-iso-edge - Upload ISO files to ScaleEngine (Bleeding Edge)
publish-pkg - Upload PKG files to ScaleEngine
publish-pkg-edge - Upload PKG files to ScaleEngine (Bleeding Edge)
publish-pkg-unstable - Upload PKG files to ScaleEngine (Unstable)
publish-pkg-ipfs - Add and pin PKG files to IPFS repo
promote-pkg - Promote packages from UNSTABLE -> STABLE
trueos-docs - Create TrueOS handbook
push-trueos-docs - Upload TrueOS handbook
lumina-docs - Create lumina handbook
push-lumina-docs - Upload lumina handbook
ports-tests - Test building a repo port files
-- SysAdm Commands --
sysadm-docs - Build SysAdm handbook
push-sysadm-docs - Upload SysAdm handbook
sysadm-api - Build SysAdm API handbook
push-sysadm-api - Upload SysAdm API handbook
-- iocage Commands --
iocage_pkgs - Build iocage package set
iocage_pkgs_push - Push iocage package set public
EOF
}
if [ -z "$1" ] ; then
display_usage
exit 1
fi
# Source our functions
. build.conf
. functions.sh
######################################################
case $TYPE in
trueos-world) jenkins_world ;;
trueos-pkg) jenkins_pkg "release" ;;
trueos-iso-pkg) jenkins_pkg "iso" ;;
sysadm-api) jenkins_sysadm_api ;;
push-sysadm-api) jenkins_sysadm_push_api ;;
sysadm-docs) jenkins_sysadm_docs ;;
push-sysadm-docs) jenkins_sysadm_push_docs ;;
trueos-docs) jenkins_trueos_docs ;;
push-trueos-docs) jenkins_trueos_push_docs ;;
lumina-docs) jenkins_trueos_lumina_docs ;;
push-lumina-docs) jenkins_trueos_push_lumina_docs ;;
trueos-iso) jenkins_iso ;;
publish-iso) jenkins_publish_iso ;;
publish-iso-edge) jenkins_publish_iso "edge" ;;
publish-pkg) jenkins_publish_pkg ;;
publish-pkg-edge) jenkins_publish_pkg "edge" ;;
publish-pkg-unstable) jenkins_publish_pkg "unstable" ;;
publish-pkg-ipfs) jenkins_publish_pkg_ipfs ;;
publish-pkg-ipfs-stable) jenkins_publish_pkg_ipfs "stable" ;;
promote-pkg) jenkins_promote_pkg ;;
trueos-vm) jenkins_vm ;;
jail) jenkins_jail ;;
iocage_pkgs) jenkins_iocage_pkgs ;;
iocage_pkgs_push) jenkins_iocage_pkgs_push ;;
freenas) jenkins_freenas ;;
freenas-tn-docs) jenkins_truenas_docs ;;
freenas-docs) jenkins_freenas_docs ;;
freenas-push-docs) jenkins_freenas_push_docs "freenas" ;;
freenas-push-tn-docs) jenkins_freenas_push_docs "truenas" ;;
freenas-api) jenkins_freenas_api ;;
freenas-push-api) jenkins_freenas_push_api ;;
freenas-push-be) jenkins_freenas_push_be ;;
freenas-push-nightly) jenkins_freenas_push_nightly ;;
freenas-push) jenkins_freenas_push ;;
freenas-combo) jenkins_freenas
jenkins_freenas_tests
;;
mkcustard) jenkins_mkcustard ;;
mktrueview) jenkins_mktrueview ;;
ports-tests) jenkins_ports_tests ;;
*) echo "Invalid command: $1"
display_usage
exit 1
;;
esac