- Issue created by @marcus_johansson
- First commit to issue fork.
- π©πͺGermany breidert
Idea:
- In the Gitlab pipeline we build the js artifacts for ai_ckeditor and push them to the repository
- Gitlab is configured not to run the pipleline again because of the commit message
[ci skip]
Todo:
The build runner needs access permissions to push to the Gitlab repository.
Future:
The process should be generic for all sub-modules of ai.
Something like this:
.gitlab-ci.yml
js_build: stage: build script: -| modules=$(find modules -maxdepth 1 -mindepth 1 -type d) for module in ${modules[@]}; do pushd ${module} if [ -f ./build.sh ]; then ./build.sh; rm -rf node_modules; fi popd done
- π©πͺGermany marcus_johansson
Added one comment, but I'm not sure if it works with Drupal Gitlab. Otherwise looks good - Kevin would setup the access token.
- πΊπΈUnited States kevinquillen
I've added the access token under the CI variable "ACCESS_TOKEN", but there is also this in the logs on the failed job:
Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository.
Can we set that to a dummy Drupal CI user since it should have access via the access token to commit back?
But yes the cache key for jobs should 'work' since it is just GitLab underneath.
- π©πͺGermany marcus_johansson
Actually, one thing I just realized looking at the order of the jobs - this job should run after the testing is done correctly, correct? Since its skipping CI, it would otherwise go ahead and push a build even if testing failed, if I'm not mistaken?
Or build during the build process, but not commit until after the tests.
- π©πͺGermany breidert
IMO the jobs run like this:
Issue fork repository:
- js_build - Rebuilds JS but does not commit changes and pushes, because there is no access token.
- phpunit - Run test with rebuilt JS
The build JS is saved as an artifact and used for testing.
Main repository (after merging, or with direct commits):
- js_build - Rebuilds JS, commits and pushes changes (if any) with an access token. The commit is run with option
-o ci.skip
to prevent the same pipeline from being triggered. - phpunit - Run test with rebuilt JS
I think this is correct. Tests are always run with the latest JS code. The latest JS code becomes part of the repository and will be part of releases.
-
marcus_johansson β
committed 1e6e73f2 on 1.2.x authored by
breidert β
Resolve #3525289 "Add ci job"
-
marcus_johansson β
committed 1e6e73f2 on 1.2.x authored by
breidert β
-
marcus_johansson β
committed dc04f3e0 on 1.2.x
Follow up test for #3525289
-
marcus_johansson β
committed dc04f3e0 on 1.2.x
-
marcus_johansson β
committed dac7a832 on 1.2.x
Follow up test for #3525289
-
marcus_johansson β
committed dac7a832 on 1.2.x
-
marcus_johansson β
committed f6ef3193 on 1.2.x
Follow up test for #3525289, revert
-
marcus_johansson β
committed f6ef3193 on 1.2.x
-
marcus_johansson β
committed bd2cc200 on 1.2.x
Follow up test for #3525289, revert
-
marcus_johansson β
committed bd2cc200 on 1.2.x
- π©πͺGermany marcus_johansson
After some testing we got it working. Huge thank you to @breidert!
Automatically closed - issue fixed for 2 weeks with no activity.