← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Left some suggestions and questions.

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

Should this be https://jenkins.ols.canonical.com instead?

> +on code merge.
> +
> +
> +-------------
> +Steps to take
> +-------------
> +
> +1. **Open an IS ticket to create swift credentials for your new project**

`s/swift/Swift/` since that is the project's name?

> +
> +   * 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:

It is a good idea to mention that this should be created in the Launchpad queue.

> +
> +        `"We need a new Swift user and project whose credentials we'll

We need a new Swift user and a project whose credentials we'll use in a Jenkins job to build deployment artifacts and publish them to Swift.

> +        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

Launchpad projects including Launchpad itself) ...

> +     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

Is it 'assuming the new role is created by running'? Otherwise 'assuming the new role IS created and running ``load_creds openstack``' sounds incomplete.

> +     ``load_creds openstack``.
> +     This will load your credentials into your environmental variables (run

'into environment variables'.

> +     ``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``.

'To share them with the person responsible'?

And who is the person responsible here?



-- 
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