Commit Graph

703 Commits

Author SHA1 Message Date
Simone Gotti 6dd9a12e87 *: update to go 1.13
* agola run: Remove go 1.11 and use go 1.12 and go 1.13 with debian buster image.

* Dockerfile: Use go 1.13 debian buster image.
2019-09-10 14:08:55 +02:00
Simone Gotti 33c860e78c
Merge pull request #103 from sgotti/gitserver_dont_write_on_error
gitserver: don't return http response/error when calling external git process
2019-09-09 16:43:40 +02:00
Simone Gotti 30192d5f0f
Merge pull request #102 from sgotti/fix_path_list_ending_slash
util: Fix PathList output when path ends with slashes
2019-09-09 16:12:08 +02:00
Simone Gotti 0e61aa4e39 gitserver: don't return http response/error when calling external git process
On a git process error don't write the error message to the response body since
it'll break the git protocol and don't try to write the status header (since it's not
possible as it was automatically written by the go http server before writing
the body).
2019-09-09 15:46:32 +02:00
Simone Gotti 9f580863da util: Fix PathList output when path ends with slashes
Fix PathList when a path ends with one or more slashes and add related tests.
2019-09-09 14:49:00 +02:00
Simone Gotti 6ca985c641
Merge pull request #100 from sgotti/update_dep_agola-web_v0.2.0
agola run: update to agola-web v0.2.0
2019-09-06 10:32:40 +02:00
Simone Gotti ed071efbda agola run: update to agola-web v0.2.0 2019-09-06 09:48:45 +02:00
Simone Gotti 0f78c81400
Merge pull request #99 from sgotti/types_global_when
types: use a global When type
2019-09-05 11:19:26 +02:00
Simone Gotti 70eeddb719 types: use a global When type
Currently we are using different `When` types for every service and convert
between them. This is a good approach if we want to keep isolated all the
services (like if we were using different repos for every service instead of the
current monorepo).

But currently, since When is identical between all the services, simplify this by
using a common When type.
2019-09-05 09:37:27 +02:00
Simone Gotti 60df886ad9
Merge pull request #95 from sgotti/update_dep_agola-web_v0.1.2
agola run: update to agola-web v0.1.2
2019-09-03 15:33:40 +02:00
Simone Gotti 4e8399391e
Merge pull request #96 from sgotti/readme_update_screenshots
README.md: update screenshots
2019-09-03 15:14:49 +02:00
Simone Gotti b3cac61703 README.md: update screenshots 2019-09-03 15:12:49 +02:00
Simone Gotti e5e7c63cda agola run: update to agola-web v0.1.2 2019-09-03 12:47:01 +02:00
Simone Gotti 0dbca095d1
Merge pull request #94 from sgotti/agolarun_test_build_images
agola run: build images and push them when on a v.* tag
2019-09-03 11:21:50 +02:00
Simone Gotti 6dc7307dfd agola run: build images and push them when on a v.* tag 2019-09-02 10:28:23 +02:00
Simone Gotti c54d2de4d1
Merge pull request #93 from sgotti/runservice_fix_gettaskstorun
runservice: fix get tasks to run
2019-08-30 16:38:47 +02:00
Simone Gotti bfc42ef60e runservice: fix get tasks to run
Currently `advanceRunTasks` isn't deterministic and doesn't calculate the final
state in one call. So could happen that `getTasksToRun` will select a task to be
executed since its parent are finished (marked as skipped in advanceRunTasks)
but the task isn't marked to be skipped (because advanceRunTasks has calculated
this task before its parents).

Currently fix this doing the same task selection logic done in `advanceRunTasks`
and add a TODO to make `advanceRunTasks` be deterministic by processing tasks by
their level (from level 0).
2019-08-30 15:59:25 +02:00
Simone Gotti 9ac03ec235
Merge pull request #92 from sgotti/tests_wait_function
tests: add wait function in place of sleep
2019-08-30 14:51:12 +02:00
Simone Gotti 6d1f159500 tests: add wait function in place of sleep
Add a function to wait for a specific condition instead of sleeping for a fixed
number of seconds.
2019-08-30 12:50:49 +02:00
Simone Gotti 409033c9a8
Merge pull request #91 from sgotti/cmd_fix_variable_create_update
cmd: fix variable create/update
2019-08-29 18:06:28 +02:00
Simone Gotti 53dad95cd0 cmd: fix variable create/update
In c1ff28ef9f we exported various types. Unfortunately the types used by cmd
variable create/update are the wrong types and marshalling fails. Fix it using
the right type. In future this internal types should be exported.
2019-08-29 16:38:19 +02:00
Simone Gotti afcd05244f
Merge pull request #89 from camandel/update_doc_devel
update example in devel doc
2019-08-20 09:55:37 +02:00
Carlo Mandelli 985c17f66b update example in devel doc 2019-08-19 10:16:54 +02:00
Simone Gotti 8a05513db6
Merge pull request #88 from sgotti/fix_check_task_and_parent_common_deps
config: fix check on task and parents with common deps
2019-08-12 23:34:37 +02:00
Simone Gotti 79c74e9423 config: fix check on task and parents with common deps 2019-08-12 23:11:19 +02:00
Simone Gotti b113018283
Merge pull request #86 from sgotti/user_direct_run_variables
userdirectrun: add options to define variables
2019-08-07 11:22:12 +02:00
Simone Gotti 488007fcf3
Merge pull request #85 from sgotti/update_dockerfile
Dockerfile: update to debian buster
2019-08-07 11:21:21 +02:00
Simone Gotti 2676770336 userdirectrun: add options to define variables
Add a --var and --var-file options (repeatable multiple times) to define the
variables to be used in the run.
2019-08-06 16:58:00 +02:00
Simone Gotti b9cf9d7a9c Dockerfile: update to debian buster 2019-08-06 15:20:25 +02:00
Simone Gotti 252bd95a58
Merge pull request #84 from sgotti/executor_listen_wildcard
executor: listen on wildcard address
2019-08-06 15:18:46 +02:00
Simone Gotti e31b0b47ef executor: listen on wildcard address
Since the current logic is to use the first available private ip address as the
advertized address we have to listen on wildcard since a different host provided
in web.ListenAddress will make the executor unreachable.

In future improve this to let the user to manually define the bind and the
advertized address (perhaps using go-sockaddr templates like done by consul) to
also support nat between the schedulers and the executors.
2019-08-06 13:42:42 +02:00
Simone Gotti 7623202048
Merge pull request #78 from sgotti/config_run_when
config: add run when field
2019-08-06 11:25:22 +02:00
Simone Gotti db742a6cd6 config: add run when field
Don't create a run if a when condition is defined and it doesn't match.
2019-08-05 16:07:47 +02:00
Simone Gotti 4fe4631729
Merge pull request #83 from sgotti/user_direct_run_custom_branch_tag_ref
userdirectrun: allow setting destination branch/tag/ref
2019-08-05 16:06:44 +02:00
Simone Gotti 4ec0b33eb4 userdirectrun: allow setting destination branch/tag/ref
Allow setting the destination branch/tag/ref so users can test the run
conditions based on the branch/tag/ref.

To simulate a pull request an user can define a ref that matches one of these
regular expressions: `refs/pull/(\d+)/head`, `refs/merge-requests/(\d+)/head`
2019-08-05 14:45:34 +02:00
Simone Gotti 0da52e2d8a
Merge pull request #82 from sgotti/tests_test_also_clone_step
tests: test also clone step
2019-08-05 14:33:19 +02:00
Simone Gotti c17772040b tests: test also clone step
Also test clone step so we are sure that the clone url is correct.
2019-08-05 13:33:58 +02:00
Simone Gotti 1c96b5fbff
Merge pull request #81 from sgotti/docker_driver_use_fixed_client_api_version
docker driver: use fixed client api version
2019-08-04 23:56:17 +02:00
Simone Gotti f082ee52db
Merge pull request #80 from sgotti/docker_driver_use_toolbox_exec
docker driver: use toolbox exec
2019-08-04 23:55:57 +02:00
Simone Gotti df66cfc736 docker driver: use fixed client api version
Set the client required api version to 1.26. In this way we'll work with docker
>= 1.13.1
2019-08-04 23:38:20 +02:00
Simone Gotti b3672bf927 docker driver: use toolbox exec
Older version of docker doesn't support the exec api Env and WorkingDir options.

Support these versions by doing the same we already do with the k8s driver: use
the `toolbox exec` command that will set the provided Env, change the cwd to the
WorkingDir and the exec the wanted command.
2019-08-04 18:09:34 +02:00
Simone Gotti b333b6f423
Merge pull request #77 from sgotti/export_api_client_types
*: export clients and related types
2019-08-02 14:41:50 +02:00
Simone Gotti c1ff28ef9f *: export clients and related types
Export clients and related packages.

The main rule is to not import internal packages from exported packages.

The gateway client and related types are totally decoupled from the gateway
service (not shared types between the client and the server).

Instead the configstore and the runservice client currently share many types
that are now exported (decoupling them will require that a lot of types must be
duplicated and the need of functions to convert between them, this will be done
in future when the APIs will be declared as stable).
2019-08-02 12:02:01 +02:00
Simone Gotti a52b52865c
Merge pull request #76 from sgotti/configstore_internal_types
configstore: move configstore types inside configstore package
2019-08-02 10:58:26 +02:00
Simone Gotti 9371e407ee
Merge pull request #75 from sgotti/remove_util_time
util: remove time.go
2019-08-02 10:42:37 +02:00
Simone Gotti fd26e617b3 configstore: move configstore types inside configstore package
Since they're not types common to all the services but belongs to the
configstore.

Next step will be to make them local to the configstore and not directly used by
other services since these types are also stored.
2019-08-02 10:05:47 +02:00
Simone Gotti d0c5621201 util: remove time.go
The same function is already provided by pointer.go
2019-08-01 14:14:56 +02:00
Simone Gotti e48a28d5b9
Merge pull request #71 from sgotti/executor_set_task_endtime_when_marking_task_failed
executor: set task endTime when marking as failed
2019-07-29 14:43:13 +02:00
Simone Gotti 43e445f3aa
Merge pull request #70 from sgotti/executor_fix_task_endtime_setup_step_failed
executor: fix typo in setting task endTime when setup failed
2019-07-29 14:43:02 +02:00
Simone Gotti fe90eecf62
Merge pull request #69 from sgotti/runservice_fix_executor_delete
runservice: fix/improve executor delete logic
2019-07-29 14:42:41 +02:00