doc/nwl-ci: updated with latest fixed, changes and findings

Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmüller 2023-09-11 13:39:19 +02:00
parent 00aa79a537
commit 8561fe8df1
1 changed files with 89 additions and 0 deletions

View File

@ -2382,6 +2382,95 @@ note, the nightly trigger uses the ``pipelineTriggers`` as follows:
General/Other Changes
#####################
Fixing Java Issue with German Umlauts
*************************************
With one of the last changes I faced the following error:
.. code-block::
java.nio.charset.MalformedInputException: Input length = 1
at java.base/java.lang.StringCoding.throwMalformed(StringCoding.java:707)
at java.base/java.lang.StringCoding.throwMalformed(StringCoding.java:713)
at java.base/java.lang.StringCoding.newStringNoRepl1(StringCoding.java:1040)
at java.base/java.lang.StringCoding.newStringNoRepl(StringCoding.java:1015)
at java.base/java.lang.System$2.newStringNoRepl(System.java:2197)
at java.base/java.nio.file.Files.readString(Files.java:3287)
at hudson.FilePath$ReadToString.invoke(FilePath.java:2377)
at hudson.FilePath$ReadToString.invoke(FilePath.java:2372)
at hudson.FilePath.act(FilePath.java:1192)
at hudson.FilePath.act(FilePath.java:1175)
at hudson.FilePath.readToString(FilePath.java:2369)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:188)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
at hudson.model.ResourceController.execute(ResourceController.java:107)
at hudson.model.Executor.run(Executor.java:449)
All of a sudden this error popped up. I had absolutely no clue why suddenly this happened and I needed to search in the
web for a hint. **NOTE:** The funny thing is that the job passed successfully once before the error popped up.
After searching for a reason I found something about german umlauts (ä,ö,ü) in a yaml file causing/same a similar issue.
In the job updating the source revisions I had to configure the git user and my name holds a umlaut. This was not an
issue until the nightly pipeline triggered this update job...
After escaping the german umlaut the job ran again even in downstream mode, see an abstract of the diff here:
.. code-block::
- git config --global user.name "Marc Mattmueller"
+ git config --global user.name "Marc Mattm\u00fcller"
So, keep in mind about how to treat german umlauts.
Using Job Artifacts
*******************
To create a pulle/merge request when updating the source revisions a branch is created and pushed. The nightly fails in
such a case if we would run it on the original branch. Hence, it makes sense to provide the created branch to the
downstream jobs. Using job artifacts are an easy way of bringing some structure and clearness into that already complex
topic of CI/CD. The current NWL instance version 0.3.2 does not contain the copyArtifact plugin and thus we get this
issue:
.. code-block::
java.lang.NoSuchMethodError: No such DSL method 'copyArtifacts' found among steps [ ...
Therefore we will rebuild the NWL instance again after adding the plugin, see the diff of the repository *build-docker*:
.. code-block::
diff --git a/jenkins-ci/Dockerfile b/jenkins-ci/Dockerfile
index b30ee58..7f7f9be 100644
--- a/jenkins-ci/Dockerfile
+++ b/jenkins-ci/Dockerfile
@@ -68,7 +68,7 @@ RUN install-plugins.sh cloudbees-folder antisamy-markup-formatter \
pipeline-graph-analysis pipeline-milestone-step workflow-multibranch pipeline-utility-steps \
ssh-agent job-dsl cvs config-file-provider ant matrix-project pipeline-maven maven-plugin \
permissive-script-security uno-choice jdk-tool throttle-concurrents sidebar-link \
- generic-webhook-trigger publish-over-cifs metrics nexus-artifact-uploader
+ generic-webhook-trigger publish-over-cifs metrics nexus-artifact-uploader copyartifact
RUN JENKINS_VERSION=`java -jar /usr/share/jenkins/jenkins.war --version` && \
echo ${JENKINS_VERSION} > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state && \
And then we use the same procedure as used already multiple times before:
.. code-block::
# on your local machine:
DOCKER_BUILDKIT=1 ./build.sh nwl 0.3.3
docker save nwl-env-ci:latest | bzip2 | pv | ssh user@10.115.101.98 docker load
# on the build server:
docker image tag nwl-env-ci:latest nwl-env-ci:0.3.3
./manage.sh --name=nwl_0_3_2 destroy
./manage.sh --image=nwl-env-ci:0.3.3 --branch=main --name=nwl_0_3_3 --platform=nwl --config=/home/user/work/ci/config/config.xml --revision=0.3.3 --maintainer=TeamCHBE create
.. |nwlCiChain| image:: ./media/nwl-ci-jenkins-dashboard.png
:width: 700px
.. |ciSetupWorkflow| image:: ./media/ci-setupWorkflow.png