diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-29 23:59:53 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-29 23:59:53 -0400 |
commit | 183cc31c0b5f812c0f0fcd8a292e378a9695417f (patch) | |
tree | 555258b76a046e3bcaca313877668ca6e3a20654 /data | |
parent | 7d0f835f1da22ae6a0afcbae0db2bebe72ec1426 (diff) | |
download | guff-183cc31c0b5f812c0f0fcd8a292e378a9695417f.tar.bz2 guff-183cc31c0b5f812c0f0fcd8a292e378a9695417f.zip |
add backend for project tag prefix and hook secret, remove expires_at
Diffstat (limited to 'data')
-rw-r--r-- | data/assets/js/admin/dialogs/project-edit.js | 6 | ||||
-rw-r--r-- | data/init.yaml | 31 |
2 files changed, 34 insertions, 3 deletions
diff --git a/data/assets/js/admin/dialogs/project-edit.js b/data/assets/js/admin/dialogs/project-edit.js index 8df9364..bfb7334 100644 --- a/data/assets/js/admin/dialogs/project-edit.js +++ b/data/assets/js/admin/dialogs/project-edit.js @@ -7,6 +7,8 @@ jQuery(function($) { var r = ev.post_data; $(p + 'repo').val(r.repo_url); + $(p + 'tag-prefix').val(r.tag_prefix); + $(p + 'secret').val(r.hook_secret); }); $(p + 'confirm').click(function() { @@ -14,7 +16,9 @@ jQuery(function($) { type: 'guff.save', post_data: { - repo_url: $(p + 'repo').val(), + repo_url: $(p + 'repo').val(), + tag_prefix: $(p + 'tag-prefix').val(), + hook_secret: $(p + 'secret').val(), }, }); diff --git a/data/init.yaml b/data/init.yaml index 46a1e11..34a0595 100644 --- a/data/init.yaml +++ b/data/init.yaml @@ -272,7 +272,9 @@ init_sql: REFERENCES states(state_id), posted_at TIMESTAMP WITH TIME ZONE, - expires_at TIMESTAMP WITH TIME ZONE, + + -- TODO: add window for visibility + -- expires_at TIMESTAMP WITH TIME ZONE, name TEXT NOT NULL DEFAULT '', @@ -307,8 +309,33 @@ init_sql: post_id INTEGER PRIMARY KEY REFERENCES posts(post_id), + -- repository url repo_url TEXT NOT NULL DEFAULT '' - CHECK (repo_url NOT LIKE '% %') + CHECK (repo_url NOT LIKE '% %'), + + -- prefix to strip from release tags + tag_prefix TEXT NOT NULL DEFAULT '' + CHECK (tag_prefix NOT LIKE '% %'), + + -- secret string used for hooks + hook_secret TEXT NOT NULL DEFAULT '' + CHECK (hook_secret NOT LIKE '% %') + ) + + - | + CREATE TABLE project_releases ( + post_id INTEGER NOT NULL + REFERENCES posts(post_id), + + name TEXT NOT NULL CHECK ( + LENGTH(name) > 0 AND + name NOT LIKE '% %' + ), + + created_at TIMESTAMP WITH TIME ZONE + NOT NULL DEFAULT CURRENT_TIMESTAMP, + + PRIMARY KEY (post_id, name) ) - | |