diff --git a/doc/src/setup/nwl-ci.rst b/doc/src/setup/nwl-ci.rst index 8b2d5f5..01c6794 100644 --- a/doc/src/setup/nwl-ci.rst +++ b/doc/src/setup/nwl-ci.rst @@ -1178,10 +1178,7 @@ We have now prepared the repository for the setup of the CI environment. Let's i .. code-block:: bash - # on your local machine enter the directory - - within the cloned repository build-docker on branch - # on the local machine in build-docker, run: + # on your local machine in build-docker, run: DOCKER_BUILDKIT=1 ./build.sh nwl 0.3.0 # upload the newly created images to the build server: @@ -1239,6 +1236,32 @@ We have now prepared the repository for the setup of the CI environment. Let's i # add the nginx webserver to known_hosts: ssh-keyscan 10.115.101.100 >> ~/work/ci/config/known_hosts + + Adapt *~/work/ci/config/config.xml* on the server (10.115.101.98) according this snippet: + + .. code-block:: bash + + diff --git a/config/config.xml b/config/config.xml + index 3913680..4e39085 100644 + --- a/config/config.xml + +++ b/config/config.xml + @@ -24,13 +24,13 @@ + + --> + + - + + + + - + + + + ssh user@10.115.101.98 + # tag the uploaded images: + docker image tag nwl-env-ci:latest nwl-env-ci:0.3.1 + +* Adapt the manage script on the build server (10.115.101.98) by adding the new git access key: + + .. code-block:: bash + + diff --git a/manage.sh b/manage.sh + index bf3435c..7e1d8e1 100755 + --- a/manage.sh + +++ b/manage.sh + @@ -203,6 +203,7 @@ create_instance() + extras="-v $here/config/maven.xml:/var/lib/ci/config/maven.xml --env JDKDIR=/opt/jdk1.11" + elif [ "$platform" == "nwl" ]; then + extras="-v $here/keys/$platform/nginx-nwl:/var/lib/ci/keys/nginx-nwl:ro" + + extras="-v $here/keys/$platform/nginx-nwl:/var/lib/ci/keys/nginx-nwl:ro \ + + -v $here/keys/$platform/nmgit:/var/lib/ci/keys/nmgit:ro" + fi + + # start container + +* Adapt *~/work/ci/config/jenkins.xml* on the server (10.115.101.98) with the jobdsl configuration and the Gitea SSH + access password: + + .. code-block:: bash + + # NOTE: this is not a properly formatted git diff. It just illustrates the necessary changes: + + diff --git a/config/jenkins.xml b/config/jenkins.xml + --- a/config/jenkins.xml + +++ b/config/jenkins.xml + + + + + + + + + + + + + + +* We use the same SSH key for the Gitea access as the Ansible instance (testvm@testenv), thus copy this SSH key to + *~/work/ci/keys/nwl/* on the server (10.115.101.98): + + .. code-block:: bash + + scp user@10.115.101.101:/home/user/.ssh/testvm_ed25519 keys/nwl/nmgit + +* Add the public key of this SSH key (testvm_ed25519.pub) to the build user account on Gitea (in our case it is + svc-git-ci) +* Add the hostkey of the Gitea server to know_hosts on the server (10.115.101.98): + + .. code-block:: bash + + ssh-keyscan git.netmodule.intranet >> ~/work/ci/config/known_hosts + +* Setup the new instance on the build server: + + .. code-block:: bash + + # assuming you are on the server in the directory ~/work/ci + + # stop and destroy the current running instance + ./manage.sh --name=nwl_0_3_0 destroy + + # remove the residing file system content + rm -rf instances/nwl/main + + # create and launch the new instance: + ./manage.sh --image=nwl-env-ci:0.3.1 --branch=main \ + --name=nwl_0_3_1 --platform=nwl \ + --config=/home/user/work/ci/config/config.xml \ + --revision=0.3.1 --maintainer=TeamCHBE create + Creating new instance... + Done! + + # check the entry: + ./manage.sh -p + +-----------+----------------------------+-------+---------+--------+----------+------------+----------+------------------+--------------+---------+ + | name | host | port | status | branch | revision | maintainer | platform | image | container | display | + +-----------+----------------------------+-------+---------+--------+----------+------------+----------+------------------+--------------+---------+ + | nwl_0_3_1 | netmodule-03.tcn.gad.local | 32780 | running | main | 0.3.1 | TeamCHBE | nwl | nwl-env-ci:0.3.1 | 1164df794c42 | NULL | + +-----------+----------------------------+-------+---------+--------+----------+------------+----------+------------------+--------------+---------+ + +* Run a pipeline for tests, e.g. *nwl-target* aka *2. NWL Yocto Build* + +.. note:: + So far the pipeline nwl-target (NWL Yocto Build) runs. There is currently an issue in NWL that the ci artifact file + is not generated and thus the pipeline fails. + + +Some side information about the directory structure of the JENKINS_HOME. The tree is often structured as follows: + +.. code-block:: + + JENKINS_HOME + +- builds (build records) + +- [BUILD_ID] (subdirectory for each build) + +- build.xml (build result summary) + +- changelog.xml (change log) + +- config.xml (Jenkins root configuration file) + +- *.xml (other site-wide configuration files) + +- fingerprints (stores fingerprint records, if any) + +- identity.key.enc (RSA key pair that identifies an instance) + +- jobs (root directory for all Jenkins jobs) + +- [JOBNAME] (sub directory for each job) + +- config.xml (job configuration file) + +- [FOLDERNAME] (sub directory for each folder) + +- config.xml (folder configuration file) + +- jobs (subdirectory for all nested jobs) + +- plugins (root directory for all Jenkins plugins) + +- [PLUGIN] (sub directory for each plugin) + +- [PLUGIN].jpi (.jpi or .hpi file for the plugin) + +- secret.key (deprecated key used for some plugins' secure operations) + +- secret.key.not-so-secret (used for validating _$JENKINS_HOME_ creation date) + +- secrets (root directory for the secret+key for credential decryption) + +- hudson.util.Secret (used for encrypting some Jenkins data) + +- master.key (used for encrypting the hudson.util.Secret key) + +- InstanceIdentity.KEY (used to identity this instance) + +- userContent (files served under your https://server/userContent/) + +- workspace (working directory for the version control system) + .. |nwlCiChain| image:: ./media/nwl-ci-jenkins-dashboard.png