Skip to main content

Upload to Nexus, Upload files to hooks, Modify version number, Sync to GitLab type repository, Extract command from Git commit message, Create SonarQube project, Generate template files and Create archives

Project description

Upload to Nexus, Upload files to hooks, Modify version number, Sync/Tagging of GitLab/GitHub type repository, Generate template files, Extract commands from Git commit messages, Create SonarQube projects, Archive file(s)

Downloads

Installation

You can download and install the latest version of this software from the Python package index (PyPI) as follows::

pip install --upgrade artify

Usage

python -m artify --help=

python -m artify --command <command> [Options]

or

python -m artify -c <command> [Options]

Params

command         nexus, syncrepo, deploy, deltav, create, extract, initialize, archive

Upload to Nexus

python -m artify -c nexus -f <format> -n <artifact_name> -h <nexus_repository_base_url>

Important

Artifact name should include artifact id and version number. E.g example-ws-1.0.0.war

Params

-f, --format                       Nexus upload format. Types supported: raw, npm, maven

-w, --workdirectory       Working directory of artifact to be uploaded to Nexus repository

-n, --artifactname         Artifact name

-r, --repository               Nexus repository to upload to: e.g -snapshots

-g, --groupid                 Group ID for Maven2 type repository, Environment variable: NEXUS_GROUP_ID

-d, --directory               Directory for RAW type repository

-u, --username             Username of nexus user, Environment variable: NEXUS_USERNAME

-p, --password              Password of nexus user, Environment variable: NEXUS_PASSWORD

--proxy                             Sets Http proxy

--proxysec                       Sets Https proxy

Optional Parameter(s)

--file2                         Allow second file to be upload, will be uploaded as a classifier


Environment variables (Optional if set with -u, -p, -g parameter above)

NEXUS_GROUP_ID           Group ID of the project e.g com.testing.testapplication

NEXUS_USERNAME         Username of nexus user that will upload artifact

NEXUS_PASSWORD         Password of nexus user that will upload artifact


Deploy App using custom AWX host

python -m artify -c deploy -f <manifest_file.yml> -h <awx_host>

Environment variables need

DEPLOY_TOKEN         Token used to deploy application


Change Package version

Artify uses semantic version 2.0.

python -m artify -c deltav -t patch -a npm

python -m artify -c version -t patch -a flutter

python -m artify -c deltav -t auto -a other --file=setup.py

python -m artify -c version -t minor -a gradle --file=version.properties

Params

-a, --archtype         npm, gradle, flutter, maven, dotnet, other

-t, --type                 major, minor, patch, prerelease, auto

Optional Params

--preValue         Prerelease version value e.g SNAPHOT, RELEASE, BUILD, beta, alpa

--getversion       Get the current application version

--nocommit       Does not create feature branch with version change

--file                     File name that you want to update version number. It should be relative to artify execution directory

--file2                   An additional file that you want to update version number. It should be relative to artify execution directory


Push changes to GitLab/GitHub repository

Recommendation: You can create a feature branch, then perform your code changes before pushing changes to remote

python -m artify -c syncrepo -m <message> -b 

Params

-c, --message         Commit message

-b, --branch           Optional, by default, it will push to 'develop' branch

Environment variables need

PRIVATE_TOKEN, popularly known as personal access token is needed to perform the push. This can be created by following this guide:

Creating a personal access token: GitLab

Creating a personal access token: GitHub

N.B   A commit is performed automatically followed by a push

Creating tags

python -m artify -c syncrepo -m tag       Creates a git tag of repository branch that task is executed on e.g v-1.0.0-a56def9

N.B Please set environment variable CI_COMMIT_SHORT_SHA


Generate Template files

Generate template .gitlab-ci.yml file

python -m artify -c create -f gitlabci

Geneate template manifest.yml file

python -m artify -c create -f manifest

Params -f, --file         File template to generate

Supported files

  • .gitlab-ci.yml
  • manifest.yml

Extract commands from GIT message

python -m artify -c extract

N.B If manifest.yml file is present, it will update version number in that file also.

Parameters

  • version/deltav - specifies type of version change e.g "version": "patch", "deltav": "patch", "version": "minor", "version": "auto"

  • archtype - specifies project architecture e.g "archtype": "npm", "archtype": "gradle", "archtype": "flutter", "archtype": "other"

Environment variable(s) needed

CI_COMMIT_MESSAGE       This the variables that is used to extract dictionary formatted command

N.B For GitHub, you can set value using commands below pipeline line (*.yml):

env:

   CI_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}


Optional Parameters

  • branch - speficies branch you want to push changes. If branch is not specified, it push changes to 'develop' branch by default

  • nocommit - Does not create feature branch with version change

  • file - File name that you want to update version number. It should be relative to artify execution directory

  • file2 - An additional file that you want to update version number. It should be relative to artify execution directory

Sample commit messages

  1. Added login functionality {"version": "patch", "archtype": "npm", "branch": "release-1.0.0" } - Updates the patch version of npm type project, and push to branch called 'release-1.0.0' branch

  2. Added search functionality {"deltav": "major", "archtype": "gradle" } - Updates the major version of a java project with Gradle build tool

  3. Added edit functionality {"version": "minor", "a": "flutter" } - Updates the minor version of a flutter project

  4. Add filter functionality {"version": "prerelease", "archtype": "npm", "preValue": "beta"} - Updates the prerelease value i.e Version 1.0.0 would change to 1.0.0-beta

  5. Upgrade from Angular 11 to Angular 12 {"version": "auto", "archtype": "gradle", "branch": "feature/angular-12"} - Updates the pre-release integer value by 1 e.g 1.0.0-beta1 will change to 1.0.0-beta2


Initialize SonarQube project

python -m artify -c initialize -h <SonarQube_base_url> -k <project-key> -n <project-name> -u <username> -p <password> -a <arch_type/os> -l <language>

Sample command

python -m artify -c initialize -h <SonarQube_base_url> -k <project-key> -n <project-name> -u <username> -p <password> -l java -a gradle

python -m artify -c initialize -h <SonarQube_base_url> -k <project-key> -n <project-name> -u <username> -p <password> -l java -a maven


For Windows Runner, Other (JS, TS, Go, Python, PHP, ...)

python -m artify -c initialize -h <SonarQube_base_url> -k -n -u -p -l other -a windows


For Linux/macOS runner, Other (JS, TS, Go, Python, PHP, ...)

python -m artify -c initialize -h <SonarQube_base_url> -k -n -u -p -l other -a linux


Parameters

-l, --language => Possible values: JS, TS, Go, Python, PHP, other)

-a, --archtype => Architecture, OS (depends on usage)

-n, --projectname => Project name.

-k, --projectkey => Project key. This should be a unique identifier for project.

-u, --username => Username for SonarQube.

-p, --password => Password for SonarQube. The user should be able to create projects.

N.B. The user should have the permission to create/modify projects.

python -m artify -c initialize -h <SonarQube_base_url> -k -n -u -p -a php


Archive file(s)

Uses Shutil Python library to create archive file

python -m artify -c archive -n <archive_name> -f <archive_format> -w <root_dir> -d base_dir>

Parameters

-n, --archivename Name for the archive file that will be created.

-f, --format Format for the archive e.g zip, tar, gztar, bztar, xztar.

-w, --rootdir Root directory is a directory that will be the root directory of the archive.

-d, --basedir Base directory is the directory where we start archiving from.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

artify-1.10.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

artify-1.10.1-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file artify-1.10.1.tar.gz.

File metadata

  • Download URL: artify-1.10.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for artify-1.10.1.tar.gz
Algorithm Hash digest
SHA256 466d1530b48afe03e9003142283d039e8120a568659aff7b41a6de92fd3e3816
MD5 10251954edf5ddf82bb459a7be7b4d2e
BLAKE2b-256 aa83d1662f85acff020918964213f8a81bface385ac8ab3bb7c8461a00c60efd

See more details on using hashes here.

File details

Details for the file artify-1.10.1-py3-none-any.whl.

File metadata

  • Download URL: artify-1.10.1-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for artify-1.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db40fa0fec42f9d826b7d013bb27ab70aeeda528c31249fdb64451a775b68fab
MD5 fa280729cdd25b0dbe48486c91adc3bf
BLAKE2b-256 e1211be5a31f36f4cfa2a30ee7e7c5f438521ac33392706df22a8a864d904068

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