1212# bivio sql init_dbms
1313# ctd
1414# bivio httpd run
15+
1516container_bop_main () {
16- local root=$1 exe_prefix=$2 app_root=$3 facade_uri=$3
17- if (( $# != 4 )) ; then
18- install_err ' must supply args'
17+ local root=$1 exe_prefix=$2
18+ local app_root=${3:- $root }
19+ local facade_uri=${4:- ${root,,} }
20+ if (( $# < 2 )) ; then
21+ install_err ' must supply root and exe_prefix'
1922 fi
20- if (( $EUID != 0 )) ; then
21- install_err ' must be run as root'
23+ umask 077
24+ install_tmp_dir
25+ mkdir container-conf
26+ cp ~ /.netrc container-conf/netrc
27+ local base_image=bop
28+ if [[ $root == Bivio ]]; then
29+ base_image=perl
2230 fi
31+ {
32+ echo ' #!/bin/bash'
33+ declare -f container_bop_build
34+ cat << EOF
35+ build_image_base=biviosoftware/$base_image
36+ build_image_name=biviosoftware/${root,,}
37+ build_maintainer='Bivio Software <[email protected] >' 38+
39+ build_as_root() {
40+ install -m 400 \$ build_guest_conf/netrc ~/.netrc
41+ container_bop_build '$root ' '$exe_prefix ' '$app_root ' '$facade_uri '
42+ rm -f ~/.netrc
43+ }
44+
45+ build_as_run_user() {
46+ return
47+ }
48+ EOF
49+ } > container-conf/build.sh
50+ curl radia.run | bash -s container-build docker
51+ }
52+
53+ container_bop_build () {
54+ local root=$1 exe_prefix=$2 app_root=$3 facade_uri=$3
2355 umask 022
24- install_tmp_dir
56+ cd " $build_guest_conf "
2557 local build_dir=$PWD
2658 local javascript_dir=/usr/share/Bivio-bOP-javascript
2759 local flags=()
@@ -34,7 +66,7 @@ container_bop_main() {
3466 cd ..
3567 rm -rf javascript-Bivio
3668 # TODO(robnagler) move this to master when in production
37- flags=( --branch robnagler --single-branch)
69+ flags=( --branch robnagler --single-branch )
3870 fi
3971 local files_dir=${app_root//::/ \/ } /files
4072 git clone " ${flags[@]} " https://github.com/biviosoftware/perl-" $root " --depth 1
0 commit comments