Sign inSign up

novitsh/gitlab-ci-git-push

By novitsh

•Updated almost 9 years ago

Automated build to push from gitlab to any remote git repository.

Image
0

956

novitsh/gitlab-ci-git-push repository overview

⁠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: novitsh/gitlab-ci-git-push

stages:
  - deploy

deploy to production:
  stage: deploy
  environment: production
  only:
    - master
  script: git-push [email protected]:myapp

Go to GitLab > Project > Settings > CI/CD Pipelines > 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 [email protected]:repo branch
⁠Pushing to Git running on a non-standard port
git-push ssh://[email protected]:8022/myapp

Tag summary

Content type

Image

Digest

Size

14.5 MB

Last updated

almost 9 years ago

docker pull novitsh/gitlab-ci-git-push