Skip to main content

GitLab Deployer

Project description

GitLab deployer 🚀

Installation

pip install gitlab-deployer

Usage

deployer <command> <arguments>

Commands:

  deploy       - start deploy daemon 
  download     - download single artifact 

Arguments:

deploy

Options:
  --url TEXT             GitLab url
  --private_token TEXT   GitLab private token
  --project_id INTEGER   Project id
  --slack_web_hook TEXT  Slack web hook api
  --slack_channel TEXT   Slack channel (#deploy)
  --slack_username TEXT  Slack channel
  --deploy_script TEXT   Execute after download and unpack artifact
                         (./deploy.sh)
  --last_job_file TEXT   Last job file (last.txt)
  --interval INTEGER     Pull interval (5)
  --error_sleep INTEGER  Sleep on error (25)
  --verbosity TEXT       Verbosity (log.level=DEBUG)
  --ref TEXT             Git Branch
  --web_url TEXT         HTTP GET web hook
  --result_script TEXT   Result shell script. Execute after deployment.
  --test_slack           Test Slack Send Info
  --help                 Show this message and exit.


download

Options:
  --url TEXT            GitLab url
  --private_token TEXT  GitLab private token
  --project_id INTEGER  Project id
  --verbosity TEXT      Verbosity (log.level=DEBUG)
  --ref TEXT            Git Branch
  --help                Show this message and exit.

Example

Command line


deployer deploy --ref master \
	--slack_web_hook=https://hooks.slack.com/services/xxxxxx/yyyyyy/zzzzzzzzzzzzz \
	--slack_channel="#deploy"  --slack_username="deploy-user"  --url http://gitlab.com \
	--private_token=tttttttttttttt --project_id=00

system.d example

[Unit]
Description=Deployer Service

[Service]
ExecStart=deployer deploy --ref master \
	--slack_web_hook=https://hooks.slack.com/services/xxxxxx/yyyyyy/zzzzzzzzzzzzz \
	--slack_channel="#deploy"  --slack_username="deploy-user"  --url http://gitlab.com \
	--private_token=tttttttttttttt --project_id=00


Restart=always
WorkingDirectory=/myproject/
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=default.target

deploy.sh

#!/bin/bash

unzip ./artifacts.zip
mv ./simple-java-project/target/simple-java-project.jar ./
systemctl restart simplejavaproject

echo "OK"

Develop

Using poetry

cd ./gitlab-deployer/
poetry install

Run with poetry

poetry run deployer <command> <args>

poetry run deployer deploy --help

Enjoy!

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-deployer-0.1.8.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

gitlab_deployer-0.1.8-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file gitlab-deployer-0.1.8.tar.gz.

File metadata

  • Download URL: gitlab-deployer-0.1.8.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/2.7.16 Darwin/19.6.0

File hashes

Hashes for gitlab-deployer-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a80e442fd5e1fadfeeaf34599b686e010629942f5aac0b9f28b8cfecd9b87ebe
MD5 3e67e1f8510f6f6bcb69d718228e7d2d
BLAKE2b-256 fec167a0213828c849a33f4767df4529afc311ce62e39f3e473d14cc6bff00f3

See more details on using hashes here.

File details

Details for the file gitlab_deployer-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: gitlab_deployer-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/2.7.16 Darwin/19.6.0

File hashes

Hashes for gitlab_deployer-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a12d03439b0819d9e5af00cdfcb059bd8651677bade5b69b1cc96a683879a360
MD5 d75bbbf9575bd94f272a0d4650888290
BLAKE2b-256 22ef3acfcb01fa86c7e0a2143b829ae07109bcff74d1c0dbe9da7df7f5207b70

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