@@ -29,6 +29,7 @@ const DEFAULT_PASSWORD: &str = "password";
2929struct Config {
3030 quick_setup : Option < bool > ,
3131 compose_profiles : Option < Vec < String > > ,
32+ lila_ws_container : Option < String > ,
3233 setup_database : Option < bool > ,
3334 setup_bbppairings : Option < bool > ,
3435 mock_email : Option < bool > ,
@@ -77,6 +78,7 @@ impl Config {
7778 let Self {
7879 quick_setup,
7980 compose_profiles,
81+ lila_ws_container,
8082 setup_database,
8183 setup_bbppairings,
8284 mock_email,
@@ -96,6 +98,7 @@ impl Config {
9698 vec ! [
9799 to_env!( quick_setup) ,
98100 to_env!( compose_profiles, compose_profiles_string) ,
101+ to_env!( lila_ws_container) ,
99102 to_env!( setup_database) ,
100103 to_env!( setup_bbppairings) ,
101104 to_env!( mock_email) ,
@@ -336,6 +339,17 @@ fn setup(mut config: Config, first_setup: bool, noninteractive: bool) -> std::io
336339 . iter ( )
337340 . any ( |service| service. compose_profile == Some ( vec ! [ "monitoring" ] ) ) ,
338341 ) ;
342+
343+ config. lila_ws_container = Some (
344+ if services
345+ . iter ( )
346+ . any ( |service| service. compose_profile == Some ( vec ! [ "lila-ws-build" ] ) )
347+ {
348+ "build" . to_string ( )
349+ } else {
350+ "image" . to_string ( )
351+ } ,
352+ ) ;
339353 }
340354
341355 if Gitpod :: is_host ( )
@@ -379,10 +393,7 @@ fn setup(mut config: Config, first_setup: bool, noninteractive: bool) -> std::io
379393 if !is_quick_setup {
380394 create_placeholder_dirs ( ) ;
381395
382- let mut repos_to_clone: Vec < Repository > = vec ! [
383- Repository :: new( "lichess-org" , "lila" ) ,
384- Repository :: new( "lichess-org" , "lila-ws" ) ,
385- ] ;
396+ let mut repos_to_clone: Vec < Repository > = vec ! [ Repository :: new( "lichess-org" , "lila" ) ] ;
386397
387398 if config. setup_database . unwrap_or_default ( ) {
388399 repos_to_clone. push ( Repository :: new ( "lichess-org" , "lila-db-seed" ) ) ;
@@ -517,6 +528,14 @@ fn prompt_for_services() -> Result<Vec<OptionalService<'static>>, Error> {
517528 "Database admin interface" ,
518529 "Mongo Express for viewing database structure and data" ,
519530 )
531+ . item (
532+ OptionalService {
533+ compose_profile : vec ! [ "lila-ws-build" ] . into ( ) ,
534+ repositories : vec ! [ Repository :: new( "lichess-org" , "lila-ws" ) ] . into ( ) ,
535+ } ,
536+ "Websocket source code" ,
537+ "Only needed if you want to make changes, otherwise a prebuilt lila-ws image will be used" ,
538+ )
520539 . item (
521540 OptionalService {
522541 compose_profile : vec ! [ "email" ] . into ( ) ,
@@ -787,6 +806,7 @@ mod tests {
787806 let contents = Config {
788807 quick_setup : Some ( true ) ,
789808 compose_profiles : Some ( vec ! [ "foo" . to_string( ) , "bar" . to_string( ) ] ) ,
809+ lila_ws_container : Some ( "image" . to_string ( ) ) ,
790810 setup_database : Some ( true ) ,
791811 setup_bbppairings : Some ( false ) ,
792812 mock_email : Some ( false ) ,
@@ -805,6 +825,7 @@ mod tests {
805825 vec![
806826 "QUICK_SETUP=true" ,
807827 "COMPOSE_PROFILES=foo,bar" ,
828+ "LILA_WS_CONTAINER=image" ,
808829 "SETUP_DATABASE=true" ,
809830 "SETUP_BBPPAIRINGS=false" ,
810831 "MOCK_EMAIL=false" ,
@@ -825,6 +846,7 @@ mod tests {
825846 let contents = Config {
826847 quick_setup : None ,
827848 compose_profiles : None ,
849+ lila_ws_container : None ,
828850 setup_database : None ,
829851 setup_bbppairings : None ,
830852 mock_email : None ,
0 commit comments