Skip to content

cleargray/git_commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

git_commit

git_commit module for Ansible

Ansible-styled documentation

Summary

The 'git_commit' module creates new branch by 'git checkout -b', adds files by 'git add --all', commits it and pushes changes to remote.
Check mode is working.

OPTIONS (= is mandatory)

    options:
      repo:
        description:
          - Path to local repo for working with.
      branch:
        description:
          - Name of branch for creation
      commit_msg:
        description:
          - Commit message.
      add_files:
        description:
          - Add or not untracked files.
        type: bool
        default: 'false'
      commit:
        description:
          - Commit or not changes.
        type: bool
        default: 'false'
      push:
        description:
          - Push or not changes.
        type: bool
        default: 'false'

REQUIREMENTS: git

AUTHOR: Sergei Nikitin (@cleargray)

      METADATA:
          status:
          - preview
          supported_by: community

EXAMPLES

Add untracked files to commit and push

- git_commit:
    repo: path/to-local/repo
    branch: feature/new-branch
    commit_msg: "Test commit"
    add_files: true
    commit: true
    push: true

Just commit changes

- git_commit:
    repo: path/to-local/repo
    branch: feature/new-branch
    commit_msg: "Test commit"
    commit: true

Create or checkout existent branch

- git_commit:
    repo: path/to-local/repo
    branch: feature/new-branch

RETURN VALUES

pushed:
  description: Push or not changes
  returned: success
  type: bool
commited:
  description: Commit or not changes
  returned: success
  type: bool
files_added:
  description: Add or not files
  returned: success
  type: bool
branch:
  description: Branch name
  returned: success
  type: str
repo:
  description: Path to repo
  returned: success
  type: str
commit_message:
  description: Commit message
  returned: success
  type: str

About

git_commit module for Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages