aramboi / gitlab-ci-git-push

Gitlab CI runner image that pushes to a remote Git repo (Dokku, Heroku, Deis, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitLab CI runner that pushes to git

This GitLab CI runner image allows to deploy a GitLab project to a remote Git repo (useful for Dokku, Heroku, Deis, etc.)

How to use

Create .gitlab-ci.yml:

image: ilyasemenov/gitlab-ci-git-push

stages:
  - deploy

deploy to production:
  stage: deploy
  environment: production
  only:
    - master
  script: git-push dokku@dokku.me:myapp

Go to GitLab > Project > Settings > CI/CD > Secret Variables, and add a variable SSH_PRIVATE_KEY:

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

Pushing to a branch other than master

By default, git-push will push to branch master of a remote repository (that's what Dokku wants). You can override this with:

git-push user@git.host:repo branch

Pushing to Git running on a non-standard port

git-push ssh://dokku@dokku.me:8022/myapp

Not doing force push

By default, git push will be forced. You can disable force push by setting environment variable DISABLE_FORCE_PUSH to any value.

About

Gitlab CI runner image that pushes to a remote Git repo (Dokku, Heroku, Deis, etc.)

License:MIT License


Languages

Language:Shell 88.3%Language:Dockerfile 11.7%