Skip to main content

Gitlab artifact manager

Project description

art - cross-project Gitlab artifact dependencies

art solves a burning problem of pulling artifacts from different repositories.

Quickstart

  1. Create a Gitlab private token and save it in art configuration:

    art configure https://gitlab.example.com/ --token-type private 'as1!df2@gh3#jk4$'
    
  2. Create artifacts.yml with definitions of needed artifacts:

    - project: kosma/foobar-documentation
      ref: branches/stable
      job: doc
      install:
        build/apidoc/html/: docs/api/
        VERSION: docs/VERSION
    - project: kosma/foobar-firmware
      ref: 1.4.0
      job: firmware-8051
      install:
        build/8051/release/firmware.bin: blobs/firmware-8051.blob
    - project: kosma/foobar-icons
      ref: 69881ebc852f5e02b8328c6b9da615e90b7184b2
      job: icons
      install:
        .: icons/
    
  3. Run art update to automatically determine latest versions and job numbers of needed projects and save them into artifacts.lock.yml. Commit both files to version control system.

  4. Run art download to fetch required artifacts to your local cache and art install to install them to the project directory.

The Lockfile

The artifacts.lock.yml is conceptually similar to Ruby's Gemfile.lock: it allows locking to exact revisions and jobs while still semantically tracking tags or branches and allowing easy updates when needs arise. The following good practices should be followed:

  • Always run art update after editing artifacts.yml.
  • Always commit both files to version control.
  • Do not run art update automatically unless you enjoy breaking the build.

Continuous integration

Add the following commands to your .gitlab-ci.yml:

before_script:
  - sudo pip install https://github.com/kosma/art
  - art configure <url> --token-type {private,job} <token>
  - art download
  - art install
cache:
  paths:
    - .art-cache/

File locations

art uses appdirs to store configuration and cache files. When running under CI environment, the default cache directory is automatically set to .art-cache so it can be preserved across jobs.

Bugs and limitations

  • Multiple Gitlab instances are not supported (and would be non-trivial to support).
  • Error handling is very rudimentary: any non-trivial exceptions simply propagate until Python dumps a stack trace.
  • Logging could be improved.
  • Format of the artifacts.yml file is not checked and is barely documented.
  • Some breakage may occur with non-trivial use cases.
  • Like with any other build system, security depends on trusting the developer not to do anything stupid. In particular, paths are not sanitized; with enough ingenuity one could probably escape the build directory and wreak havoc.
  • There is no uninstall command. If you changed artifact versions and need to have a clean slate, it's highly recommended to run git clean -dfx (beware, however: any local changes to your working copy will be lost without warning).
  • There are probably cleaner solutions to this problem, like using some sort of cross-language package manager; however, I didn't find any that would satisfy my needs.

Licensing

art is open source software; see COPYING for amusement. Email me if the license bothers you and I'll happily re-license under anything else under the sun.

Author

art was written by Kosma Moczek <kosma@kosma.pl>, with bugfixes thankfully contributed by countless good people. See git log for full authorship information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlab-art-0.4.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

gitlab_art-0.4.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file gitlab-art-0.4.0.tar.gz.

File metadata

  • Download URL: gitlab-art-0.4.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.31.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for gitlab-art-0.4.0.tar.gz
Algorithm Hash digest
SHA256 96e22de557b875a843b70241c993245776aa674a9d72e1c3e656a90995fb9bc9
MD5 b355d39787358a34c9e4d266be50b5a0
BLAKE2b-256 02a9c882d81c6cde066856f06019b6308418e16fcae874a0afe59c9d18325cbd

See more details on using hashes here.

File details

Details for the file gitlab_art-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: gitlab_art-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.31.0 setuptools/40.8.0 requests-toolbelt/1.0.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for gitlab_art-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f0730f771183816550f1c98d0bfb8b068bc91c5cc9a9e6d71e47b2963a49b1
MD5 a9fd058907f112995aceac5dd53edc59
BLAKE2b-256 d6704a854fa186491f5858b62716c2d2df84a9b2936b1ab22629331970ee9d4a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page