Commit Graph

33 Commits

Author SHA1 Message Date
Simone Gotti
8242dc3a9d gateway: move create run to own action
* Move all run creation logic to the action handler.
* Cleanup webhook to use it
2019-06-11 09:31:12 +02:00
Simone Gotti
5b22ebc2d3 webhook: add run creation trigger type 2019-06-10 17:04:50 +02:00
Simone Gotti
1938c2daaf webhook: use runRefType instead of webhook Event 2019-06-10 16:52:51 +02:00
Simone Gotti
28ddfb1781 webhook: add runRefType and convert webhook event
Introduce a runRefType that represent the ref type of the Run (branch/tag/PR)
Convert the webhook event type to the runRefType and use it to generate the run
group.
2019-06-10 16:49:39 +02:00
Simone Gotti
38b54b092c webhook: remove annotation virtual branch 2019-06-10 16:37:32 +02:00
Simone Gotti
5c4dff0fd9 webhook: export git branch and tag env vars
export AGOLA_GIT_BRANCH and AGOLA_GIT_TAG env vars. They will be mutually empty
if on a branch or tag.
2019-05-24 16:17:00 +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
02e0deec15 service: move gateway/common to common
Yes, I know that common and utils are bad package names...
2019-05-15 09:38:27 +02:00
Simone Gotti
1e34dca95d runservice: split and simplify scheduler and executor naming
Also if they are logically part of the runservice the names runserviceExecutor
and runserviceScheduler are long and quite confusing for an external user

Simplify them separating both the code parts and updating the names:

runserviceScheduler -> runservice
runserviceExecutor -> executor
2019-05-07 23:56:10 +02:00
Simone Gotti
e4e7de4ad2 runservice/gateway: return run on run action 2019-05-07 23:23:58 +02:00
Simone Gotti
649c42f75b gitsources: create secret and webhook secret
Use the webhook secret on webhook creation and check it and webhook receive
2019-05-07 18:29:31 +02:00
Simone Gotti
4154be3370 *: set sshhostkey and skip check on remote source 2019-05-07 15:59:08 +02:00
Simone Gotti
081ac8a44f gateway: move webhook genGroup to common as GenRunGroup 2019-05-05 23:58:40 +02:00
Simone Gotti
f73f0ba434 gateway: move variable logic from api to actions 2019-05-04 15:16:49 +02:00
Simone Gotti
3f7e554f04 gateway: rename command(handler) to action(handler)
Since we're going to migrate all actions (also queries that now are implemented
in the api handlers) there
2019-05-03 23:48:49 +02:00
Simone Gotti
984efb539e configstore: use augmented types for vars/secrets dynamic values 2019-04-30 16:28:01 +02:00
Simone Gotti
1820e7c477 types: rename user UserName field to Name 2019-04-30 12:56:43 +02:00
Simone Gotti
cbd971619b gateway: refresh oauth2 token when needed
refresh the oauth2 access token when needed and update the related linked
account.
2019-04-29 15:42:10 +02:00
Simone Gotti
4c30a5af1c runservice: handle jsonnet and json config files
Handle config files with name `config.jsonnet`, `config.json` and
`config.yml` and take the first from the repository in this order

For a jsonnet file execute it and use the generated output as the config
2019-04-16 15:00:37 +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
ca1d837ecd webhook: use hook provided ssh url for cloning
Additionally don't save a CloneURL field inside the project type.

If in future some git source doesn't provide a clone url we could just calculate
it from project.RepoPath or call the remote api to retrieve it.
2019-04-11 16:49:07 +02:00
Simone Gotti
782750e51e project: save remote repository id 2019-04-11 17:11:17 +02:00
Simone Gotti
da27348a1d runservice: implement run setup errors
Add the ability to define a run with a setuperror phase.

When the run setup has errors client could submit a run with a list of setup
errors. In such case the run will be created in the setuperror phase.

Setup errors are currently generated by the webhook receiver and the run service
when it checks the run config for possible issues.
2019-04-09 16:51:37 +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
58a77ad221 gateway: handle skipped webhook 2019-04-03 17:05:50 +02:00
Simone Gotti
4cf72748b4 gitsources: update api
* Generalize to use repopath instead of (owner, reponame)
2019-04-03 15:01:21 +02:00
Simone Gotti
a2cd92c70b webhook: use provided userID 2019-04-03 15:11:50 +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
3c5eb71ba8 runservice: make and check that group paths are absolute 2019-03-29 12:09:32 +01:00
Simone Gotti
61b454d4da config environment from variable 2019-03-18 15:02:32 +01:00
Simone Gotti
6f38c48066 *: initial implementation of when conditions 2019-03-07 18:01:34 +01:00
Simone Gotti
715596e650 Add user local runs feature 2019-02-21 23:01:17 +01:00
Simone Gotti
021a0465ce gateway: initial implementation 2019-02-21 17:58:25 +01:00