Commit Graph

26 Commits

Author SHA1 Message Date
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 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 8d67844cc4 *: use vanity url
use agola.io domain
2019-07-01 11:40:20 +02:00
Simone Gotti 863277af2d runservice types: refactor unmarshal
* Don't use a complex UnmarshalJSON for RunConfigTask and ExecutorTask but
introduce a Steps type as a slice of Step (where Step is an empty interface)
and declare an UnmarshalJSON method on the Step type.
2019-06-08 16:30:36 +02:00
Simone Gotti 96c0fa9aea config: refactor config unmarshal
* Don't use a complex UnmarshalJSON for Task but use specific UnmarshalJSON for
every type that requires custom unmarshaling
2019-06-08 16:07:15 +02:00
Simone Gotti 7658c44694 config: make runtime type pod the default
In this way users are not forced to always set it in the config file.
2019-05-23 23:23:54 +02:00
Simone Gotti 9b2ce717c7 *: migrate to "golang.org/x/xerrors"
Just a raw replace of "github.com/pkg/errors".

Next steps will improve errors (like remote errors, api errors, not exist errors
etc...) to leverage its functionalities
2019-05-23 11:23:14 +02:00
Simone Gotti ba5399b97e config/runconfig: add global docker registries auth 2019-05-10 11:45:00 +02:00
Simone Gotti 4154be3370 *: set sshhostkey and skip check on remote source 2019-05-07 15:59:08 +02:00
Simone Gotti dfeba334f6 runservice: update docker registry auth 2019-04-22 14:38:25 +02:00
Simone Gotti 22f0865aa3 runconfig: add and populate Runtime.Arch 2019-04-17 15:23:50 +02:00
Simone Gotti 03451535c8 runservice: rework config format
The current config format was thought for future extensions for reusing runtimes
and job definitions adding some parameters.

After a lot of thoughts this looks like a complex approach: the final result
will be a sort of templating without a lot of powers.

Other approach like external templating should be an alternative but I really
don't think templating yaml is the way to go.

A much better approach will to just use jsonnet when we need to create matrix
runs and a lot of other use cases.

So just make the config a simple yaml/json. User can generate their config using
any preferred tool and in future we'll leverage jsonnet automated parsing and
provide a lot of jsonnet based examples for most use cases.

Main changes:

* Runs are now an array and not a map. The run name is in the Name field
* Tasks are now an array and not a map. The task name is in the Name field
* Use https://github.com/ghodss/yaml so we'll use json struct tags and unmarshall functions
2019-04-16 11:01:02 +02:00
Simone Gotti 6066221136 runservice: rename config pipeline(s) to run(s)
No need for different names. We are always talking about a run. In the config
it's the run definition, in the service is the run execution.
2019-04-15 23:42:10 +02:00
Simone Gotti 8bde2f2bc0 runservice: implement caching
Add `save_cache` and `restore_cache steps`
2019-04-13 14:58:56 +02:00
Simone Gotti 68e95ad3be runservice: implement task dependencies conditions
Handle the task dependencies conditions:
* on_success (default if no conditions are specified)
* on_failure
* on_skipped

Not the runservice won't stop run but continue executing tasks that depends on a
parent also if this is failed
2019-04-12 16:46:04 +02:00
Simone Gotti 5165984030 runservice: convert RunConfigTask.Depends to a map 2019-04-12 17:04:07 +02:00
Simone Gotti 634a8a543c runservice: implement docker registry auth
By now just support default username/password login

In future also support additional container registries with their own credential
helpers
2019-04-10 17:13:51 +02:00
Simone Gotti 298ffc3529 config: generalize and simplify value string/from_variable parsing 2019-04-10 17:12:39 +02:00
Simone Gotti 671b89d391 runservice: merge RunConfig and RunData
* Use just RunConfig
* Use StaticEnvironment vs Environment in RunConfig to distinguish between env
that won't change at run recreation from env that could change at every
recreation
* The RunCreate api will just receive the runtasks instead of a runconfig (more
right)
2019-04-09 18:11:00 +02:00
Simone Gotti 7d787c5f77 *: implement task approval 2019-04-08 17:29:57 +02:00
Simone Gotti 9d559d49d7 webhook: correctly handle git host and port
* split host and port from the git url
* also set the port in the generated ssh config
2019-04-03 12:27:09 +02:00
Simone Gotti 61b454d4da config environment from variable 2019-03-18 15:02:32 +01:00
Simone Gotti b05b377d31 runservice: add option to define custom container entrypoint 2019-03-13 12:12:32 +01:00
Simone Gotti 16ac6ada66 runservice: add privileged containers options 2019-03-13 12:11:46 +01:00
Simone Gotti 6f38c48066 *: initial implementation of when conditions 2019-03-07 18:01:34 +01:00
Simone Gotti 36fc79dfc6 runservice: initial commit 2019-02-21 15:54:50 +01:00