git2pantheon

command module
v0.0.0-...-fbb87f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 13 Imported by: 0

README

Initial work for the Pantheon git integration microservice. This repo is now archived as the code now lives in: https://github.com/redhataccess/pantheon/tree/master/tools/git2pantheon

Setting up your development environment

  1. Install golang

For fedora follow: https://developer.fedoraproject.org/tech/languages/go/go-installation.html

For any other OS, reffer to the golang website: https://golang.org/doc/install

  1. Install go-git dependency
go get gopkg.in/src-d/go-git.v4
  1. Clone this repo on your go root. Assuming the default go root... do this:
cd ~/go
git clone YOUR_FORK_OF_THIS_REPO
  1. Build the project
cd git2pantheon
go build
  1. run the service
./git2pantheon
  1. Running go tests
go test

To build and use the application on a container using buildah and podman

  1. Build the container
buildah -t YOURTAG bud .
  1. To run the container using podman
podman run --network=host --rm -p 9666:9666 YOURTAG

Notice the --network flag this is only needed if you are running pantheon on the same localbox, that way this service can upload files to "localhost".

  1. To get inside the container and debug

get the container process

podman ps
podman exec -it PROCESS bash

Submitting a request

The service expects only POST REST calls to http://:9666/clone

The payload must include a repo and branch to be cloned.

The repository is expected to have a pantheon2.yml file defining the pantheon enpoint and general configuration on how to handle the documentation in the repository. Without it no upload will happen.

An example of the payload is:

curl -d '{"repo":"https://github.com/jmarrero/test-adocs.git", "branch":"master"}' -H "Content-Type: application/json" -X POST http://localhost:9666/clone

For information about pantheon see: https://github.com/redhataccess/pantheon

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL