Skip to content

Commit 622c5e8

Browse files
committed
fix is public
1 parent 512c0b5 commit 622c5e8

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

deploy.vsh

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,34 @@
33
import os
44
import term
55

6-
const server = 'gitly'
6+
const server = 'gitly'
77
const remote_path = '/var/www/gitly'
88

99
fn main() {
10-
println('Step 1: Syncing files...')
11-
// -a: archive mode (preserves permissions, recursive, etc.)
12-
// -v: verbose
13-
// -z: compress
14-
exec_safe('rsync -avz src translations ${server}:${remote_path}/')
15-
16-
println('\nStep 2: Remote compilation and restart...')
17-
remote_cmds := [
18-
'cd $remote_path',
19-
'/root/v2/v -d new_veb -d use_openssl .',
20-
'sudo systemctl restart gitly'
21-
].join(' && ')
22-
23-
println('ssh $server "$remote_cmds"')
24-
exec_safe('ssh $server "$remote_cmds"')
25-
26-
println(term.green('\nDeployment successful!'))
10+
println('Step 1: Syncing files...')
11+
// -a: archive mode (preserves permissions, recursive, etc.)
12+
// -v: verbose
13+
// -z: compress
14+
exec_safe('rsync -avz src translations ${server}:${remote_path}/')
15+
16+
println('\nStep 2: Remote compilation and restart...')
17+
remote_cmds := [
18+
'cd ${remote_path}',
19+
'/root/v2/v -keepc -d trace_pg_error -d new_veb -d use_openssl .',
20+
'sudo systemctl restart gitly',
21+
].join(' && ')
22+
23+
println('ssh ${server} "${remote_cmds}"')
24+
exec_safe('ssh ${server} "${remote_cmds}"')
25+
26+
println(term.green('\nDeployment successful!'))
2727
}
2828

2929
fn exec_safe(cmd string) {
30-
// os.system streams output directly to stdout/stderr,
31-
// which is better for seeing rsync progress and compiler errors.
32-
if os.system(cmd) != 0 {
33-
eprintln(term.red('\n Error executing command.'))
34-
exit(1)
35-
}
30+
// os.system streams output directly to stdout/stderr,
31+
// which is better for seeing rsync progress and compiler errors.
32+
if os.system(cmd) != 0 {
33+
eprintln(term.red('\n Error executing command.'))
34+
exit(1)
35+
}
3636
}
37-

src/repo.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn (mut app App) save_repo(repo Repo) ! {
7272
views_count := repo.views_count
7373
webhook_secret := repo.webhook_secret
7474
tags_count := repo.tags_count
75-
is_public := if repo.is_public { 1 } else { 0 }
75+
is_public := repo.is_public // if repo.is_public { 1 } else { 0 } // SQLITE hack
7676
open_issues_count := repo.nr_open_issues
7777
open_prs_count := repo.nr_open_prs
7878
branches_count := repo.nr_branches

src/repo_routes.v

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,9 @@ pub fn (mut app App) handle_new_repo(mut ctx Context, name string, clone_url str
299299
pub fn (mut app App) clone_repo(mut new_repo Repo) {
300300
new_repo.clone()
301301
app.debug('cloning done')
302-
app.update_repo_from_fs(mut new_repo) or {}
303-
app.set_repo_status(new_repo.id, .done) or {}
302+
app.update_repo_from_fs(mut new_repo) or { eprintln('cannot update repo from fs ${err}') }
303+
eprintln('setting repo status to done after cloning xxx')
304+
app.set_repo_status(new_repo.id, .done) or { eprintln('cannot set repo status ${err}') }
304305
// git.clone(valid_clone_url, repo_path)
305306
}
306307

@@ -311,6 +312,7 @@ pub fn (mut app App) kekw(mut ctx Context) veb.Result {
311312
@['/:username/:repo_name/tree/:branch_name/:path...']
312313
pub fn (mut app App) tree(mut ctx Context, username string, repo_name string, branch_name string, path string) veb.Result {
313314
mut repo := app.find_repo_by_name_and_username(repo_name, username) or {
315+
eprintln('tree() repo ${repo_name} not found')
314316
return ctx.not_found()
315317
}
316318
eprintln('!!! REPO STATUS = ${repo.status}')

0 commit comments

Comments
 (0)