la_pipes is for automating la_eu projects
Meant to reduce efforts and increase reusability we centralize pipelines.
Currently we have a own pipeline definition file per project to include.
Instead of putting .gitlab-ci.yml
into every repo we just reference them:
https://git.drupalcode.org/project/$PROJECT/-/settings/ci_cd#js-general-pipeline-settings
CI/CD configuration file: la_fr.gitlab-ci.yml@project/la_pipes:main
Create SSH key for GitLab repo automation
Create a ED25519 type SSH key pair with $PROJECT@drupalcode.org
:
$ ssh-keygen -t ed25519 -C la_fr@drupalcode.org -f id_la_fr
Generating public/private ed25519 key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_la_fr
Your public key has been saved in id_la_fr.pub
The key fingerprint is:
SHA256:S59FHlaW5kqIQ31vwVd5HgN6En7fbsRB8wN62O35GLM la_fr@drupalcode.org
The key's randomart image is:
+--[ED25519 256]--+
| . . ++++|
| . o BoO+=|
| . . O+O B=|
| o .+*.*.*|
| S. .ooo++|
| . o o. B.|
| . o E +|
| . |
| |
+----[SHA256]-----+
Convert the private key to BASE64 and to store as GitLab variable:
$ cat id_la_fr | base64 | tr -d '\n'
Add CI/CD variable on the project and with the key SSH_PRIVATE_KEY_BASE64
:
https://git.drupalcode.org/project/$PROJECT/-/settings/ci_cd#js-cicd-variables-settings
Select option Masked and Hidden
and deselect Expand variable reference
:
Add the public key as deploy key in the repository settings under Deploy keys
:
https://git.drupalcode.org/project/$PROJECT/-/settings/repository#js-deploy-keys-settings
Select Grant write permissions to this key
to grant the GitLab CI write access.
Add public key via la_eu maintainer
To enable the upstream automation the public key needs access to la_eu
.
If you're not an la_eu
maintainer ask one to add it writeable here:
https://git.drupalcode.org/project/la_eu/-/settings/repository#js-deploy-keys-settings
We need to inially create the branch downstream/$PROJECT
in the la_eu
repo.
Also in the downstream repo ensure Git shallow clone
option is deactivated by 0
https://git.drupalcode.org/project/$PROJECT/-/settings/ci_cd#js-general-pipeline-settings