Fossil SCM

Add support for Docker [http://www.docker.com/]

jan.nijtmans 2014-09-23 12:15 trunk merge
Commit 7aced530234a04e17a64a3b995a6e12886e5e9b5
+1
--- a/Dockerfile
+++ b/Dockerfile
@@ -0,0 +1 @@
1
+trunkVERSION}"
--- a/Dockerfile
+++ b/Dockerfile
@@ -0,0 +1 @@
 
--- a/Dockerfile
+++ b/Dockerfile
@@ -0,0 +1 @@
1 trunkVERSION}"
+1 -13
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1 @@
1
-###
2
-# (experimental)eadslineedityumyumRUN fossil new --docker -A admin && fossil user password -R a# RUN yum update -y
3
-RUNtubs && make;
4
-RUN cp fossi-devel
5
-RUNdockerlineedit=0 sqliteedit=0 --json
6
-RUN
7
-RUN
8
-RUN mkdir -p /opt/fossil
9
-RUNcl-develemptydityumyumRUNtrun
10
-RUNtrunk" or
11
-ENV VERSION}" adslineedityumyumRUN fossil new --docker -A admin && fossil user password -R a# RUN yumtrunkhreadslineedityumyumsqliteedit=0 --json
12
-RUN
13
-RUN
1
+trunkVERSION}"
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1 @@
1 ###
2 # (experimental)eadslineedityumyumRUN fossil new --docker -A admin && fossil user password -R a# RUN yum update -y
3 RUNtubs && make;
4 RUN cp fossi-devel
5 RUNdockerlineedit=0 sqliteedit=0 --json
6 RUN
7 RUN
8 RUN mkdir -p /opt/fossil
9 RUNcl-develemptydityumyumRUNtrun
10 RUNtrunk" or
11 ENV VERSION}" adslineedityumyumRUN fossil new --docker -A admin && fossil user password -R a# RUN yumtrunkhreadslineedityumyumsqliteedit=0 --json
12 RUN
13 RUN
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1 @@
1 trunkVERSION}"
 
 
 
 
 
 
 
 
 
 
 
 
+8 -4
--- src/db.c
+++ src/db.c
@@ -1469,23 +1469,25 @@
14691469
** Options:
14701470
** --template FILE copy settings from repository file
14711471
** --admin-user|-A USERNAME select given USERNAME as admin user
14721472
** --date-override DATETIME use DATETIME as time of the initial checkin
14731473
** (default: do not create an initial checkin)
1474
+** --empty create repository without project-id/server-id
14741475
**
14751476
** See also: clone
14761477
*/
14771478
void create_repository_cmd(void){
14781479
char *zPassword;
14791480
const char *zTemplate; /* Repository from which to copy settings */
14801481
const char *zDate; /* Date of the initial check-in */
14811482
const char *zDefaultUser; /* Optional name of the default user */
1483
+ int makeServerCodes;
14821484
14831485
zTemplate = find_option("template",0,1);
14841486
zDate = find_option("date-override",0,1);
14851487
zDefaultUser = find_option("admin-user","A",1);
1486
- find_option("empty", 0, 0); /* deprecated */
1488
+ makeServerCodes = find_option("empty", 0, 0)==0;
14871489
14881490
/* We should be done with options.. */
14891491
verify_all_options();
14901492
14911493
if( g.argc!=3 ){
@@ -1494,15 +1496,17 @@
14941496
db_create_repository(g.argv[2]);
14951497
db_open_repository(g.argv[2]);
14961498
db_open_config(0);
14971499
if( zTemplate ) db_attach(zTemplate, "settingSrc");
14981500
db_begin_transaction();
1499
- db_initial_setup(zTemplate, zDate, zDefaultUser, 1);
1501
+ db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes);
15001502
db_end_transaction(0);
15011503
if( zTemplate ) db_detach("settingSrc");
1502
- fossil_print("project-id: %s\n", db_get("project-code", 0));
1503
- fossil_print("server-id: %s\n", db_get("server-code", 0));
1504
+ if( makeServerCodes ){
1505
+ fossil_print("project-id: %s\n", db_get("project-code", 0));
1506
+ fossil_print("server-id: %s\n", db_get("server-code", 0));
1507
+ }
15041508
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
15051509
fossil_print("admin-user: %s (initial password is \"%s\")\n",
15061510
g.zLogin, zPassword);
15071511
}
15081512
15091513
--- src/db.c
+++ src/db.c
@@ -1469,23 +1469,25 @@
1469 ** Options:
1470 ** --template FILE copy settings from repository file
1471 ** --admin-user|-A USERNAME select given USERNAME as admin user
1472 ** --date-override DATETIME use DATETIME as time of the initial checkin
1473 ** (default: do not create an initial checkin)
 
1474 **
1475 ** See also: clone
1476 */
1477 void create_repository_cmd(void){
1478 char *zPassword;
1479 const char *zTemplate; /* Repository from which to copy settings */
1480 const char *zDate; /* Date of the initial check-in */
1481 const char *zDefaultUser; /* Optional name of the default user */
 
1482
1483 zTemplate = find_option("template",0,1);
1484 zDate = find_option("date-override",0,1);
1485 zDefaultUser = find_option("admin-user","A",1);
1486 find_option("empty", 0, 0); /* deprecated */
1487
1488 /* We should be done with options.. */
1489 verify_all_options();
1490
1491 if( g.argc!=3 ){
@@ -1494,15 +1496,17 @@
1494 db_create_repository(g.argv[2]);
1495 db_open_repository(g.argv[2]);
1496 db_open_config(0);
1497 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1498 db_begin_transaction();
1499 db_initial_setup(zTemplate, zDate, zDefaultUser, 1);
1500 db_end_transaction(0);
1501 if( zTemplate ) db_detach("settingSrc");
1502 fossil_print("project-id: %s\n", db_get("project-code", 0));
1503 fossil_print("server-id: %s\n", db_get("server-code", 0));
 
 
1504 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1505 fossil_print("admin-user: %s (initial password is \"%s\")\n",
1506 g.zLogin, zPassword);
1507 }
1508
1509
--- src/db.c
+++ src/db.c
@@ -1469,23 +1469,25 @@
1469 ** Options:
1470 ** --template FILE copy settings from repository file
1471 ** --admin-user|-A USERNAME select given USERNAME as admin user
1472 ** --date-override DATETIME use DATETIME as time of the initial checkin
1473 ** (default: do not create an initial checkin)
1474 ** --empty create repository without project-id/server-id
1475 **
1476 ** See also: clone
1477 */
1478 void create_repository_cmd(void){
1479 char *zPassword;
1480 const char *zTemplate; /* Repository from which to copy settings */
1481 const char *zDate; /* Date of the initial check-in */
1482 const char *zDefaultUser; /* Optional name of the default user */
1483 int makeServerCodes;
1484
1485 zTemplate = find_option("template",0,1);
1486 zDate = find_option("date-override",0,1);
1487 zDefaultUser = find_option("admin-user","A",1);
1488 makeServerCodes = find_option("empty", 0, 0)==0;
1489
1490 /* We should be done with options.. */
1491 verify_all_options();
1492
1493 if( g.argc!=3 ){
@@ -1494,15 +1496,17 @@
1496 db_create_repository(g.argv[2]);
1497 db_open_repository(g.argv[2]);
1498 db_open_config(0);
1499 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1500 db_begin_transaction();
1501 db_initial_setup(zTemplate, zDate, zDefaultUser, makeServerCodes);
1502 db_end_transaction(0);
1503 if( zTemplate ) db_detach("settingSrc");
1504 if( makeServerCodes ){
1505 fossil_print("project-id: %s\n", db_get("project-code", 0));
1506 fossil_print("server-id: %s\n", db_get("server-code", 0));
1507 }
1508 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
1509 fossil_print("admin-user: %s (initial password is \"%s\")\n",
1510 g.zLogin, zPassword);
1511 }
1512
1513
+7
--- src/main.c
+++ src/main.c
@@ -2197,10 +2197,17 @@
21972197
}else{
21982198
zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
21992199
}
22002200
if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
22012201
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2202
+ }else if( db_get("server-code", 0)==0 ){
2203
+ db_multi_exec(
2204
+ "INSERT INTO config(name,value,mtime)"
2205
+ " VALUES('server-code', lower(hex(randomblob(20))),now());"
2206
+ "INSERT INTO config(name,value,mtime)"
2207
+ " VALUES('project-code', lower(hex(randomblob(20))),now());"
2208
+ );
22022209
}
22032210
db_close(1);
22042211
if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
22052212
fossil_fatal("unable to listen on TCP socket %d", iPort);
22062213
}
22072214
--- src/main.c
+++ src/main.c
@@ -2197,10 +2197,17 @@
2197 }else{
2198 zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
2199 }
2200 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2201 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
 
 
 
 
 
 
 
2202 }
2203 db_close(1);
2204 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2205 fossil_fatal("unable to listen on TCP socket %d", iPort);
2206 }
2207
--- src/main.c
+++ src/main.c
@@ -2197,10 +2197,17 @@
2197 }else{
2198 zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
2199 }
2200 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2201 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2202 }else if( db_get("server-code", 0)==0 ){
2203 db_multi_exec(
2204 "INSERT INTO config(name,value,mtime)"
2205 " VALUES('server-code', lower(hex(randomblob(20))),now());"
2206 "INSERT INTO config(name,value,mtime)"
2207 " VALUES('project-code', lower(hex(randomblob(20))),now());"
2208 );
2209 }
2210 db_close(1);
2211 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2212 fossil_fatal("unable to listen on TCP socket %d", iPort);
2213 }
2214

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button