Commit graph

300 commits

Author SHA1 Message Date
Brad Rydzewski
11251f1909 added tests for when creating / starting build container fails 2014-03-18 23:30:50 -07:00
Brad Rydzewski
d7096f7e66 added code for privileged mode with unit tests 2014-03-18 23:21:04 -07:00
Brad Rydzewski
f3530d76b2 Merge pull request #191 from fudanchii/deployment
Fix `artifact` env-var being replaced if only one entry is listed.
2014-03-18 22:46:29 -07:00
Nurahmadie
1dbef76780 Fix ARTIFACT env-var being replaced if only one entry is listed.
Also, use WriteEnv.
2014-03-19 09:02:35 +07:00
Brad Rydzewski
f363ce804b improved coverage of Builder.teardown function in pkg/build 2014-03-17 16:40:15 -07:00
Brad Rydzewski
854d3443d7 Merge branch 'example-fixture' 2014-03-17 12:06:48 -07:00
Brad Rydzewski
96c256b17d added some comments to describe the different test cases 2014-03-17 12:04:48 -07:00
Brad Rydzewski
7d52a4c4df Revert "query and show commits by branch"
This reverts commit 2d837cc3db.
2014-03-16 23:08:53 -07:00
Brad Rydzewski
5c848d647a Merge pull request #179 from arturhoo/feature/svg-badges
Use SVG badges instead of PNG
2014-03-16 22:33:53 -07:00
Nurahmadie
7eb06fc0d5 Use NullString instead of checking for error. 2014-03-16 12:26:45 +07:00
Nurahmadie
44ffb70813 Use variadic parameters for DropColumns.
Also add some comments.
2014-03-16 12:26:18 +07:00
Nurahmadie
571f7d02b0 Fix some column type to work with both mysql and sqlite.
Basically this is caused by sqlite actually doesn't have any
column type restriction. also save gob type column as blob to enforce
byte-string value, since varchar with utf8 collation type will take at
least 3 byte to store, this will break YAML-Gob decoding at `params`
column.

Also fix some typo, and clean up fixtures code.
2014-03-15 18:20:11 +07:00
Alex Suraci
2d837cc3db query and show commits by branch
This allows the same SHA to have different builds on different branches, each
separately viewable. This is useful for expressing a "pipeline" in terms of
branches, e.g. a commit starts on branch A and progress through B and C to
master, with the build script switching on branch name.

Previously viewing each build would arbitrarily choose which branch's commit
to show.
2014-03-14 12:13:34 -07:00
Brad Rydzewski
6f8bbf1d04 adding mocks for Builder.setup() 2014-03-14 11:52:24 -07:00
Brad Rydzewski
3d4e3168b7 ran gofmt 2014-03-13 18:49:49 -07:00
Brad Rydzewski
1a153b8e80 test coverage for dockerfile package 2014-03-13 17:07:33 -07:00
Brad Rydzewski
62ec8634f6 added code for testing buildfiles 2014-03-13 16:50:01 -07:00
Nurahmadie
7cf4f2eb89 Preliminary MySQL support. Barely tested.
Requirements:
MySQL/MariaDB need to be configured with this settings:

  innodb_file_format = Barracuda
  innodb_file_per_table = On
  innodb_large_prefix = On

to support key prefix length up to 3042 bytes.

MySQL/MariaDB DSN will need this parameter:

  parseTime=true

as per [1]

The migration system itself mostly inspired by Rails (ActiveRecord),
but it still rough at the edges. Could use some inputs.

Next Todo: more testing!

[1]  https://github.com/go-sql-driver/mysql#parsetime
2014-03-14 02:28:10 +07:00
Nurahmadie
5903eb8f04 Add wrapper for common column types for easier column type
transformation between databases.
2014-03-13 18:53:52 +07:00
Artur Rodrigues
2561d3a6db Merge branch 'master' into feature/svg-badges 2014-03-12 14:48:13 -03:00
Alex Suraci
5ce081ba72 git deploy pushes to given branch (default master)
Signed-off-by: David Varvel <dvarvel@pivotallabs.com>
2014-03-12 10:25:35 -07:00
Brad Rydzewski
d70a6bb5f7 adding github testing 2014-03-11 23:00:06 -07:00
Nurahmadie
97825cf6bf Add usage info at migration script generator.
Also suppress error at the latest migration script
for backward compatibility with existing database, in which
open_invitations column wasn't added via migration.
2014-03-12 08:33:04 +07:00
Nurahmadie
89a00bd448 Refactor tests, add test for ChangeColumn method. 2014-03-12 07:04:34 +07:00
Artur Rodrigues
3546a2a00d Use SVG icons in badges template 2014-03-11 16:01:42 -03:00
Artur Rodrigues
88cc8d6bdf Use SVG badges instead of PNG 2014-03-11 15:55:23 -03:00
Nurahmadie
9a0b29d8b1 Remove database.Set, all setup being done in database.Init now. 2014-03-11 15:10:13 +07:00
Nurahmadie
92dfcbfca9 Move database schema to migration script. 2014-03-10 20:28:04 +07:00
Nurahmadie
76ed21c40f Cleanup some leftover
Don't have to import mattn/go-sqlite3 at pkg/database/migrate/sqlite.go
Remove unused DriverFunction declaration at migrate.go
2014-03-10 11:30:39 +07:00
Nurahmadie
d61bb3ef6c Fix index operation tests 2014-03-10 07:17:47 +07:00
Nurahmadie
489e38908a Implement ChangeColumn, AddIndex, and DropIndex methods for Operation interface. 2014-03-10 07:11:15 +07:00
Nurahmadie
81cf496811 Refactor migration.
Add `ChangeColumn`, `AddIndex`, `DropIndex` method to
Operation interface.
2014-03-10 07:08:58 +07:00
Michael Elsdörfer
4130c013f1 Remove erroneous keystrokes. 2014-03-09 03:38:27 +01:00
Michael Elsdörfer
f437b490b5 Support DOCKER_HOST w/o protocol 2014-03-09 03:32:21 +01:00
Nurahmadie
28fef9e3f4 Returns error if driver name is not listed.
Also remove references to postgresql driver for now.
And add some comments for `database.Init` method.
2014-03-08 18:12:43 +07:00
Nurahmadie
51519b62dd Actually use --driver option to set database driver for drone.
This includes refactoring database setup, and migration system.

Remove setupDatabase from main and use `Init` method from database
package.

At database package, defines Init method which actually initiate
database with options given from comand line flag. I think `--path`
wont be used anywhere so I plan to remove it later.

Both meddler and migration initiated here, then we call `Set` method
to setup all the tables, etc. Here I think I want to separate database
schema and turn it into migration script instead, later maybe.

At migration package I made some tweak to `Operation` interface.
Realized that it's ludicrous to let migration driver re-implement `Exec`
and `Query`, I made migration script to receive The whole
migrationDriver struct which contains both Operation implementor, and
the Tx itself. This made possible thanks to Go struct being able to
promote its member, now our migration is more transparent.

There's also stub implementation for bot mysql and postgresql, will
implement this really soon.
2014-03-08 12:19:28 +07:00
Brad Rydzewski
2e528dea24 added unit tests for settings validation 2014-03-07 13:21:43 -07:00
Brad Rydzewski
1348f8f5fc added validations for settings screen 2014-03-07 12:10:40 -07:00
Benjamin Manns
4cd5e69e7b Remove unreachable return. 2014-03-06 10:50:48 -08:00
Benjamin Manns
baf468973f Format go code. 2014-03-06 10:45:21 -08:00
Kir Shatrov
5bf726d4d4 Autofocus on email field in login 2014-03-06 16:35:57 +04:00
Brad Rydzewski
686f755c5d Merge pull request #164 from ewr/SpecifyTmpDirViaEnv
Add ability to specify temp directory via DRONE_TMP environment variable
2014-03-05 14:42:59 -08:00
Eric Richardson
74f5a41a05 Add ability to specify temp directory via DRONE_TMP environment variable
* If not set, defaults to the previously-used `/tmp/drone`
* This is the directory used for storing cached volumes, so in some deployment
  scenarios the admin may wish to place it somewhere more resilient than /tmp.
2014-03-05 17:10:29 -05:00
Vsevolod Strukchinsky
0c9dafc5c9 Remove unnecessary appending identicon in template 2014-03-05 16:25:27 +06:00
Vsevolod Strukchinsky
fae4adaffc Add identicon query param to GravatarPattern 2014-03-05 16:19:44 +06:00
Brad
4333d62c37 added yml config for custom /etc/hosts entries 2014-03-04 11:08:13 -08:00
Brad
f5d142a4b5 moved environment variables from Dockerfile to build script 2014-03-04 11:07:41 -08:00
Brad
cecef21d4f fixed merge issue with template.go and duplicate fmt import 2014-03-04 10:50:53 -08:00
Brad Rydzewski
791f7b0652 Merge pull request #153 from movableink/js-in-external-files
JS in external files
2014-03-04 10:27:40 -08:00
Red Daly
dbbbe325c3 Improve error messages in template parsing init(). 2014-03-04 04:47:47 -08:00
Brad
c1b9353943 added code to persist directories between builds. see issue #147 2014-03-02 22:54:09 -08:00
Brad
18d5421706 a bit of prep-work for adding caching 2014-03-02 22:35:01 -08:00
Brad
600bcdea38 added section to yaml for custom hostnames 2014-03-02 18:55:28 -08:00
Nurahmadie
fe3bb97231 Fix pull-request checkout not working for Git >=1.8
Explicitly create pr branch from origin
2014-03-02 20:03:05 +07:00
Nurahmadie
cd5126d8c9 Set author for pull request 2014-03-02 19:09:14 +07:00
Michael Nutt
f468203e23 add jasmine specs for javascript 2014-03-02 02:08:30 -05:00
Michael Nutt
b2965bf432 extract commit update js into a separate file 2014-03-02 00:43:20 -05:00
Brad Rydzewski
c69e9d3ab7 Merge remote-tracking branch 'origin/master' 2014-03-01 20:25:22 -07:00
Brad Rydzewski
f33ebcc21c ability to use custom badges. standard badges now using shields.io 2014-03-01 20:25:10 -07:00
Nurahmadie
6b8e86fd02 Fix gravatar size at build page to fit the stylesheet. 2014-03-02 02:34:15 +00:00
Michael Nutt
6e92e73a98 logline output buffers rather than updating on every ws message
In builds with lots of output, trying to reload the page partway
through the build results in thousands of websocket messages (one
per line) that each update the DOM.  This can cause the browser to
freeze.  Instead, use requestAnimation frame to delay the DOM
updates.
2014-03-01 19:51:14 -05:00
Brad Rydzewski
77ff7971d3 Merge pull request #138 from zond/master
Added a button to turn auto tail on/off
2014-02-27 16:01:11 -08:00
Brad Rydzewski
252a8a9e68 Merge pull request #139 from jordane/jordane/add_irc_plugin
properly quit irc after sending failure/success
2014-02-27 16:00:21 -08:00
Jordan Evans
bab544261a properly quit irc after sending failure/success 2014-02-27 12:00:15 -08:00
Martin Bruse
bc2043d4cf instead of doing magic on scroll events, move the button to the bottom of the stdout pre. 2014-02-27 12:04:51 +00:00
Martin Bruse
0c9a9f6d63 added a button to turn auto tail on/off 2014-02-27 10:28:24 +00:00
Brad Rydzewski
80c42309d3 Merge remote-tracking branch 'origin/master' 2014-02-26 15:24:35 -07:00
Brad Rydzewski
21d1bcc551 fixed typo in admin template causing issue #108 2014-02-26 15:24:18 -07:00
Brad Rydzewski
404f7784bc Merge pull request #133 from zond/master
DRONE_BRANCH and DRONE_PR env variables
2014-02-26 13:50:44 -08:00
Brad Rydzewski
deba709d87 added exit code to builds 2014-02-26 14:24:48 -07:00
Martin Bruse
90681986fe More discriminate env setting 2014-02-26 14:18:09 +01:00
Martin Bruse
7bb3358b63 Added more Environment variables. 2014-02-26 13:43:31 +01:00
Brad Rydzewski
e62cdce37f added echo statement to print when S3 deployment is starting 2014-02-26 00:58:50 -07:00
Brad Rydzewski
fa9d3c8277 Merge remote-tracking branch 'origin/master' 2014-02-26 00:01:51 -07:00
Alex Suraci
a198657a7e Runner -> BuildRunner to be more descriptive
also kill some stale comments
2014-02-25 17:14:14 -08:00
Alex Suraci
9e1c4e60e5 remove docker/queue singletons; inject in main 2014-02-25 17:10:04 -08:00
Brad Rydzewski
987e53eb39 ability to view public repos without authentication 2014-02-25 17:13:59 -07:00
Brad Rydzewski
73c03dc2e0 publicly display private projects 2014-02-25 16:50:49 -07:00
Brad Rydzewski
5673c4d2ac only inject private parameters for non-pull requests, for security purposes 2014-02-25 16:48:43 -07:00
Brad Rydzewski
c0adf459f9 Merge pull request #125 from vito/injectable-builder
Injectable builder (and friends)
2014-02-25 15:42:37 -08:00
Brad Rydzewski
70732c341a Merge pull request #124 from vito/fix-tests
fix handler/testing test imports
2014-02-24 21:22:59 -08:00
Alex Suraci
4b52fcad1a provide runner to workers, use it for all builds
Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
2014-02-24 17:51:25 -08:00
Alex Suraci
ddc8e7a56f split build construction out of worker
(todo: inject runner into worker)

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
2014-02-24 17:34:22 -08:00
Alex Suraci
acc51e83fd inject docker client into Builder
Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
2014-02-24 17:02:57 -08:00
Alex Suraci
12989b187c introduce Queue object
this is an intermediate step towards pushing configuration up.

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
2014-02-24 16:53:28 -08:00
Alex Suraci
fc01782554 add constructor for Builder
this makes it easier to track required dependencies as they change

(todo: actually, like, use it for required dependencies)
2014-02-24 16:45:01 -08:00
Alex Suraci
0e98f294a3 fix handler/testing test imports
Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
2014-02-24 14:55:05 -08:00
Andrew Karpow
8f139daec2 add github ping hook handler 2014-02-24 13:56:42 +01:00
Brad Rydzewski
dc478a4ca8 Merge pull request #116 from fiveisprime/modulus-deployments
Adds support for Modulus deployments
2014-02-23 15:28:55 -08:00
Matt Hernandez
40296fbd93 Corrected project usage. 2014-02-23 18:10:01 -05:00
Matt Hernandez
492ac956ca Fixes.
Fixed the WriteEnv usage and updated to allow for sudo if necessary.
2014-02-23 18:07:25 -05:00
Matt Hernandez
77e2837ff0 Add Modulus to deployment class.
Allow the Modulus deployment type to be used.
2014-02-23 12:08:44 -05:00
Matt Hernandez
3920fd92fe Added Modulus deployment.
Uses the configuration options of: Token (the user's Modulus API token) and
project (the project to deploy to).
2014-02-23 12:02:53 -05:00
Nurahmadie
20bf390dc2 Enable deployment via ssh 2014-02-23 20:19:00 +07:00
Brad Rydzewski
d6b6506a5b Merge pull request #104 from shaunduncan/master
Fix form for full width of column
2014-02-22 15:35:58 -08:00
Brad Rydzewski
24df6277b1 Merge pull request #113 from jordane/jordane/add_irc_plugin
add irc notify plugin
2014-02-22 15:33:58 -08:00
Jordan Evans
25749802ac add irc notify plugin
It is based on github.com/fluffle/goirc
2014-02-21 16:10:04 -08:00
Brad Rydzewski
6410bdbe9d added validation for settings 2014-02-21 15:25:05 -07:00
Brad Rydzewski
3c25a4a00a fixed issue updating team member roles 2014-02-21 13:26:50 -07:00
Shaun Duncan
bf999a82b0 Fix form for full width of column 2014-02-20 20:55:56 -05:00
Nurahmadie
d9e4f3f509 Add shell script to generate migration script. 2014-02-19 08:15:51 +07:00
Nurahmadie
7b4c698e79 Refactor columns matching method 2014-02-19 07:38:53 +07:00
Nurahmadie
21f7fcb853 Fix index operations:
- Pass args as variadic params
- Tests for index operations
- Refactor fetchColumns
2014-02-19 01:11:41 +07:00
Nurahmadie
8d7cf16a89 Add func to fetch SQL definition for indices.
Also rearrange sql.Result and err declaration.
2014-02-18 21:22:22 +07:00
Nurahmadie
7a75c2d004 Keep indices when dropping/renaming columns. 2014-02-18 18:32:04 +07:00
Brad Rydzewski
2867818679 removed github domain and url from schema.go for unit tests 2014-02-17 23:10:20 -07:00
Brad Rydzewski
a200c7a0a2 altered migration to set default github domain and url 2014-02-17 23:08:06 -07:00
Brad Rydzewski
cb042e1c1a fixed compile error in migration script 2014-02-17 22:48:31 -07:00
Brad Rydzewski
bbb4bf48e0 Merge remote-tracking branch 'origin/master' 2014-02-17 22:42:01 -07:00
Brad Rydzewski
0e83e76ef4 removed unused migration sample file 2014-02-17 22:41:56 -07:00
Brad Rydzewski
85e60e4ee2 Merge pull request #75 from floatdrop/github-enterprise-support
GitHub Enterprise Support
2014-02-17 21:38:28 -08:00
Brad Rydzewski
7ce1e55ac3 Merge pull request #83 from fudanchii/migration
Migration system for sqlite
2014-02-17 20:46:13 -08:00
Brad Rydzewski
ed33bf7fbe fixed broken link on repo dashboard page to refresh page 2014-02-17 20:33:58 -07:00
Brad Rydzewski
cda6cef5ec fixed template issue with install screen, not using correct base 2014-02-17 12:40:03 -07:00
Andrew Karpow
d18fc8fc35 make smtp-auth optional 2014-02-16 22:36:01 +01:00
Colin Gemmell
5d9d367b78 Add form tag to make install work.
There seems to be no javascript to post this form and no form tag to make the form work so added one
2014-02-16 17:40:23 +00:00
Vsevolod Strukchinsky
1505175288 Migration file based on #83
I choosed Rev3, because Rev2 will be about "open invitations" feature.
2014-02-16 11:57:16 +06:00
Vsevolod Strukchinsky
407faca612 Fixed another github client instance in code 2014-02-16 11:45:15 +06:00
Vsevolod Strukchinsky
b113b2ac33 Make IsGit check less strict 2014-02-16 11:45:15 +06:00
Vsevolod Strukchinsky
87cc740e8a Fixed identation 2014-02-16 11:45:15 +06:00
Vsevolod Strukchinsky
833563763c Added settings to github_add page (fix redirect) 2014-02-16 11:45:15 +06:00
Vsevolod Strukchinsky
44d5f3baca Update all github clients in code 2014-02-16 11:45:15 +06:00
Vsevolod Strukchinsky
425cbbc324 Use custom github domain for webhook 2014-02-16 11:45:14 +06:00
Vsevolod Strukchinsky
6c9ff00f99 Put values from settings into handler/auth.go 2014-02-16 11:45:14 +06:00
Vsevolod Strukchinsky
7208d95a76 Added GitHubApiUrl and GitHubDomain to settings and template 2014-02-16 11:45:14 +06:00
Brad Rydzewski
423abdf17d Merge pull request #33 from phusion/master
Fix HTML closing errors
2014-02-15 18:14:32 -08:00
Brad Rydzewski
4b412d3a26 added code to prevent panic if /login is reached but no settings exist
minor styling. added success and fail message to top of /signup screen
modified open_registration to boolean value in database
2014-02-15 18:56:48 -07:00
Brad Rydzewski
828cb84c6d Merge pull request #67 from floatdrop/open-invitations
Open invitation setting
2014-02-15 17:22:54 -08:00
Nurahmadie
4ef0f1b437 Integrate migrations with drone.
Also add migration to tests.
2014-02-16 03:47:30 +07:00
Nurahmadie
da8d4346ee Add tests to migrate existing database without migration attributes. 2014-02-16 02:23:26 +07:00
Nurahmadie
8ce87f0d2c More tests for alter columns migration
Also change the way we handle columns rename migration.
SQLite restrict column addition not to have PRIMARY KEY and/or
UNIQUE attribute, so we have to change from:

add new column -> migrate data from old column to new column ->
rename old table -> create new table with old columns removed ->
migrate data from old table to the new table -> drop old table

to directly:
rename old table -> create new table with renamed columns ->
migrate data from old table to the new table -> drop old table
2014-02-16 00:56:17 +07:00
Nurahmadie
4465b2654d Fix migration step not checked against current version.
Add tests for DropColumns.
2014-02-15 22:17:22 +07:00
Nurahmadie
54a9544044 Integrate MigrationDriver to migrate.go 2014-02-15 20:16:54 +07:00
Nurahmadie
d2eed594ea Migration Driver for SQLite
Need more tests.
2014-02-15 19:29:53 +07:00
Vsevolod Strukchinsky
460ec90049 Fixup behavior on uninstalled state 2014-02-15 18:17:29 +06:00
yosssi
bc5c508bc2 Updated README.md to show all services.
Update pkg/build/images.go to use the latest version of CouchDB if
`couchdb` was set to `services`.
2014-02-14 09:37:43 +00:00
Vsevolod Strukchinsky
0bd8ef28dd Fixup signup and settings template 2014-02-14 10:53:22 +06:00
Vsevolod Strukchinsky
6937b7b21e Open invitation setting
Closes #64
2014-02-14 10:53:22 +06:00
Brad Rydzewski
aac473d689 Merge pull request #68 from yosssi/params-injection
Inject params into .drone.yml.
2014-02-13 18:50:15 -08:00
Brad Rydzewski
9e7d196e30 Merge pull request #65 from floatdrop/fix-status-url
Fixup back url in commit status
2014-02-13 15:34:30 -08:00
Keith Thornhill
cfa9082761 enable use of docker-standard DOCKER_HOST environment variable to allow drone to run builds on remote docker hosts. 2014-02-13 15:20:43 -08:00
Brad Rydzewski
f88171d433 branch is using url param on all pages now, until we get wildcard routing 2014-02-13 15:43:40 -07:00
yosssi
5895e364c1 Inject params into .drone.yml. 2014-02-13 15:30:27 +00:00
Vsevolod Strukchinsky
79ccd56960 Fixup back url in commit status 2014-02-13 14:36:40 +06:00
Brad Rydzewski
bb90a492cf Merge pull request #62 from yosssi/add-git-depth-option
Implemented a function for developers to specify the `--depth` option of the `git clone` command
2014-02-12 22:45:48 -08:00
yosssi
074de9d3b3 Implemented a function for developers to specify the --depth option of
the `git clone` command. refs #55
2014-02-13 02:22:43 +00:00
Brad Rydzewski
901d48ee82 Merge remote-tracking branch 'origin/master' 2014-02-12 12:23:19 -07:00
Brad Rydzewski
28fda64326 workaround for #51 2014-02-12 12:22:56 -07:00
Brad Rydzewski
0a8ef525e9 fix for issue #51 2014-02-12 12:15:59 -07:00
Brad Rydzewski
60765d6b37 Merge pull request #57 from yosssi/fix-alert-layout-adding-user
Fixed the overflow of the url when adding an admin user or a team member.
2014-02-11 23:14:17 -08:00