This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible | Puppet | ||
---|---|---|---|
Modules | Ships with a lot of modules | Modules have to be installed from Puppet Forge. | |
Syntax | Uses YAML | Custom DSL | |
Architecture | Only SSH connection required Push change | Client - server architecture Pull catalogs from the master | |
Programming approach or style | Procedural | Declarative | |
Templating | Uses Jinja 2 | Possibility for both Puppet and Ruby templates | |
Reporting | Limited | Extensive reporting with dashboard available | |
Node classification | Simple and straightforward | More complicated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node ‘orion-ug-africell-staging.staging.com’ { | |
$data_folder = ‘scala-deploy’ | |
$config = { | |
project => ‘orion’, | |
environment => ‘staging’, | |
network => ‘AfricellUganda’, | |
bind_ip => $facts[‘ipaddress_eth0’], | |
service_name => ‘orion-web’, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orion: | |
time: now # time to deploy — now for now, 4 a.m for 4 a.m EAT | |
branch: master # branch to pull from and listen for notifications on | |
channel: orion-deploy | |
production: false # immediate deployment on staging — not prod | |
owner: [user1,ian] # users allowed to interact with slack requests for orion | |
separate-build: true # to be built/compiled on diff machine — for all scala projects | |
many: true # if many is false — many is > 1 | |
concurrent: no | |
instances: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node ‘orion-ug-staging.staging.com’ { | |
$data_folder = ‘scala-deploy’ # if in hydra group — set type to hydra | |
$config = { | |
project => ‘orion’, | |
environment => ‘staging’, | |
network => ‘MtnUganda’, | |
bind_ip => $facts[‘ipaddress_eth0’], | |
service_name => ‘orion-web’, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$from = $_POST['from']; | |
$to = $_POST['to']; | |
$text = $_POST['text']; | |
$date = $_POST['date']; | |
$id = $_POST['id']; | |
$linkId = $_POST['linkId']; | |
if(!empty($_POST['from'])) { | |
require_once('AfricasTalkingGateway.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
app = Flask('the-box-library') | |
books = [{ | |
'name': 'Harry Potter and the prisoner of Azkaban', | |
'author': 'JK. Rowling', | |
'category': 'Magic / Fiction', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val aopMerge = new sbtassembly.MergeStrategy { | |
val name = "aopMerge" | |
import scala.xml._ | |
import scala.xml.dtd._ | |
def apply(tempDir: File, path: String, files: Seq[File]): Either[String, Seq[(File, String)]] = { | |
val dt = DocType("aspectj", PublicID("-//AspectJ//DTD//EN", "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"), Nil) | |
val file = MergeStrategy.createMergeTarget(tempDir, path) | |
val xmls: Seq[Elem] = files.map(XML.loadFile) | |
val aspectsChildren: Seq[Node] = xmls.flatMap(_ \\ "aspectj" \ "aspects" \ "_") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Scala and sbt Dockerfile | |
# | |
# https://github.com/hseeberger/scala-sbt | |
# | |
# Pull base image | |
FROM java:8 | |
ENV SCALA_VERSION 2.11.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'AfricasTalkingGateway' | |
# gateway = AfricasTalkingGateway.new("username", "apikey"); | |
post '/ussd' do | |
@sessionId = params[:sessionId] | |
@serviceCode = params[:serviceCode] | |
@phoneNumber = params[:phoneNumber] | |
@text = params[:text] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/api/voice/callback/', methods=['POST']) | |
def voice_callback(): | |
is_active = request.values.get('isActive', None) | |
session_id = request.values.get('sessionId', None) | |
caller_number = request.values.get('callerNumber', None) | |
direction = request.values.get('direction', None) | |
destination = request.values.get('destination', None) | |
if isActive: | |
r.hset(destination, 'phoneNumber', caller_number) |
NewerOlder