Giter Site home page Giter Site logo

octoleo / octojpack Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 173 KB

mirror of https://git.vdm.dev/octoleo/octojpack

Home Page: https://www.octoleo.com/showcase/octojpack

License: GNU General Public License v2.0

Shell 100.00%
joomla-package namibia octoleo octojpack

octojpack's Introduction

OCTOSYNC

The option to move files or whole folders from repository to another is what Octosync does. You can with configurations setup multiple syncing relationships which you can run in multiple workflow actions.

Octosync Bot Setup

Help menu

	Options
	======================================================
   --conf=<path>
	set all the config properties with a file

	properties examples are:
		source.repo.path=[org]/[repo]
		source.repo.branch=[branch]
		source.repo.folders=[folder/path_a;folder/path_b]
		source.repo.files=[0;a-file.js,b-file.js]
		target.repo.path=[org]/[repo]
		target.repo.branch=[branch]
		target.repo.folders=[folder/path_a;folder/path_b]
			# To merge or just make a PR (0 = PR; 1 = Merge)
		target.repo.merge=1
			# Target fork is rebased then updated and used to make a PR or Merge
		target.repo.fork=[org]/[repo]
	see: conf/example

	example: ./src/sync.sh --conf=/home/llewellyn/.config/repos-to-sync.conf
	======================================================
   --source-path=[org]/[repo]
	set the source repository path as found on github (for now)

	example: ./src/sync.sh --source-path=Octoleo/Octosync
	======================================================
   --source-branch=[branch-name]
	set the source repository branch name

	example: ./src/sync.sh --source-branch=master
	======================================================
   --source-folders=[folder-path]
	set the source folder path
	separate multiple paths with a semicolon

	example: ./src/sync.sh --source-folders=folder/path1;folder/path2
	======================================================
   --source-files=[files]
	set the source files
		omitting this will sync all files in the folders
		separate multiple folders files with a semicolon
		separate multiple files in a folder with a comma
		each set of files will require the same number(position) path in the --source-folders
		[dynamic options]
			setting a 0 in a position will allow all files & sub-folders of that folder to be synced
			setting a 1 in a position will allow only all files in that folder to be synced
			setting a 2 in a position will allow only all sub-folders in that folder to be synced
		see: conf/example (more details)

	example: ./src/sync.sh --source-files=file.txt,file2.txt;0
	======================================================
   --target-path=[org]/[repo]
	set the target repository path as found on github (for now)

	example: ./src/sync.sh --target-path=MyOrg/Octosync
	======================================================
   --target-branch=[branch-name]
	set the target repository branch name

	example: ./src/sync.sh --target-branch=master
	======================================================
   --target-folders=[folder-path]
	set the target folder path
	separate multiple paths with a semicolon

	example: ./src/sync.sh --target-folders=folder/path1;folder/path2
	======================================================
   --target-fork=[org]/[repo]
	set the target fork repository path as found on github (for now)
	the target fork is rebased then updated and used to make a PR or Merge

	example: ./src/sync.sh --target-fork=MyOrg/Octosync
	======================================================
   -m | --target-repo-merge | --target-merge
	force direct merge behaviour if permissions allow
	example: ./src/sync.sh -m
	======================================================
   -pr | --target-repo-pull-request | --target-pull-request
	create a pull request instead of a direct merge if permissions allow
	example: ./src/sync.sh -pr
	======================================================
   --target-token=xxxxxxxxxxxxxxxxxxxxxxx
	pass the token needed to merge or create a pull request on the target repo
	example: ./src/sync.sh --target-token=xxxxxxxxxxxxxxxxxxxxxxx
	======================================================
   --test
	activate the test behaviour
	example: ./src/sync.sh --test
	======================================================
   --dry
	To show all configuration, and not update repos
	example: ./src/sync.sh --dry
	======================================================
   -h|--help
	display this help menu
	example: ./src/sync.sh -h
	example: ./src/sync.sh --help

How To SETUP gitHub User

You will need to setup a list of secrets in your account. You can do this per/repository or per/organization.

The github user email being used to build

  • GIT_EMAIL

The github username being used to build

  • GIT_USER

gpg -a --export-secret-keys >myprivatekeys.asc The whole key file text from the above myprivatekeys.asc This key must be linked to the github user being used

  • GPG_KEY

The name of the myprivatekeys.asc user

  • GPG_USER

A id_ed25519 ssh private key liked to the github user account

  • SSH_KEY

A id_ed25519.pub ssh public key liked to the github user account

  • SSH_PUB

All these secret values are needed to fully automate the setup to easily interact with gitHub.

Yet you can rely on just the target repo internal (workflow) token. more info to follow...

Workflows

In your workflows action script you will need to add the following as an example:

jobs:
  build:
    runs-on: [ubuntu-20.04]
    steps:
      - name: Setup gitHub User Details
        env:
          GIT_USER: ${{ secrets.GIT_USER }}
          GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
          GPG_USER: ${{ secrets.GPG_USER }}
          GPG_KEY: ${{ secrets.GPG_KEY }}
          SSH_KEY: ${{ secrets.SSH_KEY }}
          SSH_PUB: ${{ secrets.SSH_PUB }}
        run: |
          /bin/bash <(/bin/curl -s https://raw.githubusercontent.com/vdm-io/github-user/master/src/setup.sh) --gpg-key "$GPG_KEY" --gpg-user "$GPG_USER" --ssh-key "$SSH_KEY" --ssh-pub "$SSH_PUB" --git-user "$GIT_USER" --git-email "$GIT_EMAIL"
      - name: Clone Sync Bot Repo
          # this is the repo that does the work
          run: |
            /bin/git clone -b master --single-branch [email protected]:[org]/github-sync-bot.git bot
      - name: Sync The Repo Files
        run: |
          cd bot
          /bin/bash ./src/sync.sh --conf=./conf/[config]

Free Software License

@copyright  Copyright (C) 2021 Llewellyn van der Merwe. All rights reserved.
@license    GNU General Public License version 2 or later; see LICENSE.txt

octojpack's People

Contributors

llewellynvdm avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

imsnamibia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.