← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~ines-almeida/launchpad:add-doc-publishing-tarball into launchpad:master

 

Thank you for your comments Guruprasad!

I addressed all of them except explaining who the person responsible for adding the credentials to Jenkins is, simply because I'm not sure there is a particular person/team responsible - I just went to someone directly for that. But I updated the phrasing earlier to clarify one should ask who that person is

Diff comments:

> diff --git a/doc/how-to/create-job-publish-artifact.rst b/doc/how-to/create-job-publish-artifact.rst
> new file mode 100644
> index 0000000..5f641f9
> --- /dev/null
> +++ b/doc/how-to/create-job-publish-artifact.rst
> @@ -0,0 +1,71 @@
> +
> +.. _create_job_to_publish_artifacts:
> +
> +==============================
> +Create job to publish artifact
> +==============================
> +
> +Often we need to publish our project's artifacts so they can be accessed by
> +other entities. When building a charm with the launchpad-base layers, for
> +example, you will want your code to be published in Swift as a tarball, so
> +that the right version of your code is downloaded when building the charm.
> +
> +We also want the artifact building to be automated. This can be achieved by
> +having `Jenkins <https://jenkins.canonical.com/>`_ jobs building your artifact

It should actually be https://jenkins.ols.canonical.com/online-services/, updated!

> +on code merge.
> +
> +
> +-------------
> +Steps to take
> +-------------
> +
> +1. **Open an IS ticket to create swift credentials for your new project**
> +
> +   * Your new `IS ticket <https://portal.admin.canonical.com/requests/new>`_
> +     should have a title along the lines of `"Swift credentials for
> +     <project name> builds"` and have information along the lines of:
> +
> +        `"We need a new Swift user and project whose credentials we'll
> +        give to a Jenkins instance to build deployment artifacts and publish
> +        them to PS5 Swift. The user can be named 'stg-<project name>-builds'
> +        and the project 'stg-<project name>-builds_project'."`
> +
> +     Open this ticket as early as possible since it might take a while until
> +     IS can go through it.
> +
> +2. **Create 'build-tarball' and 'publish-tarball' commands in your project's
> +   Makefile**
> +
> +   * The ``build-tarball`` command should rebuild the virtual environment anew,
> +     create a wheel with all the necessary dependencies, and then build a
> +     tarball into a given path (``build/<commit-id>/<name-of-tar>.tar.gz`` for
> +     example) - see existing examples in the Launchpad suite!
> +
> +   * For the publishing, copy ``publish-to-swift.py`` script (found in a few
> +     launchpad projects including launchpad-itself) to your project's
> +     directory. The ``publish-tarball`` command should be dependent on
> +     ``build-tarball`` and should run the ``publish-to-swift`` script - again
> +     see existing examples.
> +
> +3. **Create or update jenkins job to run the publishing command**
> +
> +   * Check if there is already a file for your project within the
> +     `ols-jenkaas <https://code.launchpad.net/ols-jenkaas>`_ repo in the
> +     ``/jobs`` folder. If there isn't, create one based on an existing one.
> +
> +   * The important sections to make the job publish your tarball are the
> +     ``build-command`` - it should run your ``make publish-tarball`` command -
> +     and the ``jobs`` list, which should have at least the
> +     ``{name}-build-charm`` and ``trigger-{name}-build-charm-on-changes``.
> +
> +4. **Get the new credentials into Jenkins**
> +
> +   * Someone responsible for Jenkins (ask IS or team) will need to add the
> +     new credentials IS created to your Jenkins jobs.
> +   * After IS creates your credentials, you can find them by SSH'ing into
> +     ``launchpad-bastion-ps5``, assuming the new role IS created and running

Yeah, the phrasing wasn't clear, I updated it - let me know if it's better now!

> +     ``load_creds openstack``.
> +     This will load your credentials into your environmental variables (run
> +     ``env`` to list all env variables). To share them, with the person
> +     responsible, ask what they might need. The most relevant credentials are
> +     ``OS_USERNAME``, ``OS_TENANT_NAME`` and ``OS_PASSWORD``.

I don't want to write names here, because I don't know :)
That's why I wrote "Someone responsible for Jenkins (ask IS or your team who that person is)" - updated the phrasing there as well. In my case, I just asked Guillermo directly because they had handled it before when Colin asked something similar!



-- 
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/444865
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:add-doc-publishing-tarball into launchpad:master.



References