7 Commits

Author SHA1 Message Date
Monty Taylor
ebae022d07 Use project-config from zuul instead of direct clones
We use project-config for gerrit, gitea and nodepool config. That's
cool, because can clone that from zuul too and make sure that each
prod run we're doing runs with the contents of the patch in question.

Introduce a flag file that can be touched in /home/zuulcd that will
block zuul from running prod playbooks. By default, if the file is
there, zuul will wait for an hour before giving up.

Rename zuulcd to zuul

To better align prod and test, name the zuul user zuul.

Change-Id: I83c38c9c430218059579f3763e02d6b9f40c7b89
2020-04-15 12:29:33 -05:00
Monty Taylor
caebf387b4 Translate gitea project creation to python
Sadly, as readable as the use of the uri module to do the interactions
with gitea is, more reent ansible changed how subprocesses are forked
and this makes iterating over all the projects in projects.yaml take
an incredibly long amount of time.

Instead of doing it in yaml, make a python module that takes the list
one time and does looping and requests calls. This should make it be
possible to run the actual gitea creation playbook in integration tests.

Change-Id: Ifff3291c1092e6df09ae339c9e7dddb5ee692685
2019-07-11 08:21:35 -04:00
Monty Taylor
e29a62d87f Filter setup-repos loop before include_tasks
Ansible task execution can be a bit slow - so the noop case where
we don't end up doing anything can still be costly. Instead, put
the when on the loop call, which will apply to each iteration of
the loop, not running the loop itself. This way we should only
include_tasks if we need to.

In order for the utility playbook to keep working, we also run all
of the iterations of the loop if gitea_always_update is true. This
will make a sync run take a long time but be comprehensive.

Change-Id: Ib60c736d46d8253e603de097eb80bc84b3366310
2019-03-04 20:39:17 +00:00
Monty Taylor
ef42937daf Parse the CRSF token before using
We're missing a step here.

Change-Id: I01ea5e1570afe8f59e96953dc7dc30372a490bf0
2019-03-03 17:57:31 +00:00
Monty Taylor
72c3904717 Use HTTP for repo settings
This uses the form post approach also used in repo renaming. There
is no official REST API for this yet, so the form post values were
taken from what the web ui does.

We should submit a patch upstream to get an actual api call for this.

Run it idempotently, submitting the settings for every repo every time.

Change-Id: I9265837039df962e85f11d16419e043fb9a56ff8
2019-03-03 15:47:15 +00:00
Monty Taylor
e836fb7af6 Remember that lookups are local
Go ahead and actually clone project-config on bridge, because
we're going to read the projects.yaml file with a lookup. Because
it's a local action, not a remote action.

Change-Id: I77454bcb10b797ce5b48018caef7fecb31947b97
2019-03-01 21:55:18 +00:00
Monty Taylor
a53f333162 Create git repos on gitea servers before gerrit
We need to make sure repos are created in gitea before gerrit so
that we can safely create to gerrit and have it replicate.

Change-Id: If3efc7ed0d7995f1ef6f52cd2eefb9260193e020
Story: 2004627
Task: 29703
2019-03-01 18:07:33 +00:00