Skip to main content

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!

Metadata

Release files for gitlab-deployer 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitlab-deployer 0.1.8
File Size Uploaded
gitlab-deployer-0.1.8.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitlab-deployer 0.1.8
File Interpreter ABI Platform
gitlab_deployer-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / gitlab-deployer-0.1.8.tar.gz

Download URL gitlab-deployer-0.1.8.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a80e442fd5e1fadfeeaf34599b686e010629942f5aac0b9f28b8cfecd9b87ebe
BLAKE2b-256 checksum
How to use checksums
fec167a0213828c849a33f4767df4529afc311ce62e39f3e473d14cc6bff00f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.3 CPython/2.7.16 Darwin/19.6.0

Release files / gitlab_deployer-0.1.8-py3-none-any.whl

Download URL gitlab_deployer-0.1.8-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a12d03439b0819d9e5af00cdfcb059bd8651677bade5b69b1cc96a683879a360
BLAKE2b-256 checksum
How to use checksums
22ef3acfcb01fa86c7e0a2143b829ae07109bcff74d1c0dbe9da7df7f5207b70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.3 CPython/2.7.16 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page