Skip to content

Instantly share code, notes, and snippets.

@charlesbullsd
charlesbullsd / git-deployment.md
Created September 30, 2018 14:09 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

// Link two topology components together via direct grouping to/from each other.
// EXAMPLE:
// TopologyBuilder builder = new TopologyBuilder()
// builder.setSpout("s0", new Spout());
// builder.setBolt("b1", new SomethingBolt()).shuffleGrouping("s0");
// builder.setbolt("b2", new WhoaAmazingBolt()); <-- There is no shuffle here...on purpose.
// StormTopology topo = builder.build();
// directLinkBolts(topo, "b1", Utils.DEFAULT_STREAM_ID, "b2", Utils.DEFAULT_STREAM_ID)
// submit(topo);
// Subscribe a bolt to a set of bolts directly.
// This is needed since there is a "system stream" of sorts that every bolt should
// be able to emit to, but saves the hastle of having to actually direct group all
// of the bolts to this one bolt.
public StormTopology directAllBoltsTo(StormTopology topo, Set<String> toSubscribe, int parallelismHint, IRichBolt bolt, String ComponentName) {
ComponentCommon common = new ComponentCommon();
common.set_inputs(new HashMap<GlobalStreamId, Grouping>());
OutputFieldsGetter getter = new OutputFieldsGetter();