Skip to content

Instantly share code, notes, and snippets.

Mathieu Poussin kedare

Block or report user

Report or block kedare

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kedare
kedare / main.py
Created Feb 20, 2019
py-ris-streamer.py
View main.py
import json
import websocket
import pymongo
from pprint import pprint
# Mongo Connect
mongo = pymongo.MongoClient("mongodb://ris:ris@localhost:27017")
db = mongo.ris
collection = db.changes
View gist:c147657caf55cb80dba7e68837aaac31
sudo salt -C '( G@roles:backend and G@environment:staging )' --batch-size 50% --batch-wait 0 state.apply ci.deploy.app queue=True 'pillar={"ci": {"revision":"HEAD", "to_deploy": "all"}}'
Executing run on [u'bcn6-web-staging-1']
bcn6-web-staging-1:
----------
View gist:b4220314458d0e18507345e46871cd97
2018/08/30 10:31:58 [INFO] Terraform version: 0.11.8
2018/08/30 10:31:58 [INFO] Go runtime version: go1.10.3
2018/08/30 10:31:58 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.8/bin/terraform", "apply"}
2018/08/30 10:31:58 [DEBUG] Attempting to open CLI config file: /Users/mathieu.poussin/.terraformrc
2018/08/30 10:31:58 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/08/30 10:31:58 [INFO] CLI command args: []string{"apply"}
2018/08/30 10:31:58 [INFO] command: backend initialized: *gcs.Backend
2018/08/30 10:31:58 [DEBUG] checking for provider in "."
2018/08/30 10:31:58 [DEBUG] checking for provider in "/usr/local/Cellar/terraform/0.11.8/bin"
2018/08/30 10:31:58 [DEBUG] checking for provider in ".terraform/plugins/darwin_amd64"
View gist:bcc2a8a338f2745f67be95d3152c10e9
# Standard packages
{% for package in pillar["ci"]["packages"]["standards"] %}
Destination directory for {{ package }} should exists:
file.directory:
- name: C:\inetpub\wwwroot\{{ pillar['application_environment'] }}\{{ package }}
- makedirs: True
{% if salt["file.file_exists"]("C:\\inetpub\\wwwroot\\{application_environment}\\{package}".format(application_environment=pillar["application_environment"], package=package)) %}
Clean {{ package }}:
View rabbitmq.sls
Make sure RabbitMQ is running on Docker:
dockerng.running:
- name: {{ pillar["application_environment"] }}-rabbitmq
- image: rabbitmq:management
- port_bindings: "5672:5672,15672:15672"
{% for vhost in pillar["rabbitmq"]["vhosts"] %}
Create the {{ vhost }} RabbitMQ VHost:
rabbitmq_vhost.present:
- name: vhost
View gac.sls
Get the Automapper module:
file.recurse:
- name: C:\temp\gac\automapper\
- source: salt://windows/automapper/
Get the IIS rewrite module:
file.recurse:
- name: C:\temp\gac\iis\
- source: salt://windows/iis/
View salt.log
----------
ID: Python should be installed
Function: pkg.installed
Name: xxx_python3
Result: False
Comment: The following packages failed to install/update: xxx_python3=3.6.1
Started: 16:48:34.459000
Duration: 57414.0 ms
Changes:
----------
View install.log
----------
ID: Python should be installed
Function: pkg.installed
Name: xxx-python3
Result: False
Comment: The following packages failed to install/update: xxx-python3=3.6.1
Started: 16:26:20.519000
Duration: 82535.0 ms
Changes:
----------
View gist:7564a9a02ead86701a888b313fb997c4
The error:
salt "bcn6-web-staging-1" state.apply windows.services.iis.sites
bcn6-web-staging-1:
Data failed to compile:
----------
Rendering SLS 'base:windows.services.iis.sites' failed: while parsing a block mapping
in "<unicode string>", line 3, column 1:
Create xxxstaging.com site:
^
View gist:32b6a7b4730af89c21efa2f78f1657f2
# Standard packages
{% for package in pillar["ci"]["packages"]["standards"] %}
Package {{ package }} should have the revision {{ pillar["ci"]["revision"] }} active for the {{ pillar['application_environment'] }} environment:
svn.latest:
- name: http://xxxx/{{ pillar['application_environment'] }}/{{ package }}/trunk
- target: C:\inetpub\wwwroot\{{ pillar['application_environment'] }}\{{ package }}
- rev: {{ pillar["ci"]["revision"] }}
- username: {{ pillar["ci"]["svn"]["username"] }}
- password: {{ pillar["ci"]["svn"]["password"] }}
You can’t perform that action at this time.