DevKey Documentation. Release 0.1. Colm O Connor



Similar documents
depl Documentation Release depl contributors

Memopol Documentation

Dry Dock Documentation

Nupic Web Application development

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

MATLAB & Git Versioning: The Very Basics

Remote Desktop With P2P VNC

AuShadha Documentation

Django on AppEngine Documentation

Source Code Review Using Static Analysis Tools

Extending Remote Desktop for Large Installations. Distributed Package Installs

Ettema Lab Information Management System Documentation

Mercury User Guide v1.1

Git - Working with Remote Repositories

Version Control with. Ben Morgan

Python and Google App Engine

Dove User Guide Copyright Virgil Trasca

Monitoring Clearswift Gateways with SCOM

A Pythonic Approach to Continuous Delivery

TEST AUTOMATION FRAMEWORK

django-cron Documentation

Server-side Development using Python and SQL

CS 2112 Lab: Version Control

Tuskar UI Documentation

Install guide for Websphere 7.0

Slides from INF3331 lectures - web programming in Python

Python DNS Failover Documentation

Hadoop Data Warehouse Manual

Creating a DUO MFA Service in AWS

ALERT installation setup

Zero-Touch Drupal Deployment

INASP: Effective Network Management Workshops

128 CERT Exercises Toolset Document for students

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

How to FTP (How to upload files on a web-server)

latest Release 0.2.6

Assessing BYOD with the Smarthpone Pentest Framework. Georgia Weidman

Web Hosting: Pipeline Program Technical Self Study Guide

CLEARSWIFT SECURE Web Gateway HTTPS/SSL decryption

Platform as a Service and Container Clouds

Embedded Based Web Server for CMS and Automation System

vmprof Documentation Release 0.1 Maciej Fijalkowski, Antonio Cuni, Sebastian Pawlus

MyMoney Documentation

Advantages and Disadvantages of Application Network Marketing Systems

Bubble Code Review for Magento

Putting It All Together. Vagrant Drush Version Control

Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica

FirstClass Synchronization Services Install Guide

Content Management System

Rapid Website Deployment With Django, Heroku & New Relic

monoseq Documentation

OS Installation: CentOS 5.8

install the extension:

Theorist HT Induc0on Course Lesson 1: Se6ng up your new computer (Mac OS X >= 10.6) As of 9/27/2012

Partek Flow Installation Guide

Continuous Integration and Delivery at NSIDC

Module developer s tutorial

Ansible. Configuration management tool and ad hoc solution. Marcel Nijenhof

Writing standalone Qt & Python applications for Android

PHP Debugging. Draft: March 19, Christopher Vickery

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

Introduction. Created by Richard Bell 10/29/2014

Building a Python Plugin

Quick Start Guide. Cerberus FTP is distributed in Canada through C&C Software. Visit us today at

OpenTOSCA Release v1.1. Contact: Documentation Version: March 11, 2014 Current version:

Version Control with Git. Kate Hedstrom ARSC, UAF

Introduction to FreeNAS development

CS 1133, LAB 2: FUNCTIONS AND TESTING

deploying meteor with meteor up

Koalix ERP. Release 0.2

Using New Relic to Monitor Your Servers

Tracking Network Changes Using Change Audit

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

HIPAA Compliance Use Case

EZcast Installation guide

Continuous Delivery on AWS. Version 1.0 DO NOT DISTRIBUTE

My review of Webfaction

System Management. Leif Nixon. a security perspective 1/37

IPPBX FAQ. For Firmware Version: V2.0/V

Network Management & Monitoring

BIRT Application and BIRT Report Deployment Functional Specification

File Transfer Protocol (FTP) & SSH

Windmill. Automated Testing for Web Applications

Deployment and Monitoring. Pascal Robert MacTI

BSA Best Practices Webinars Role Based Access Control Sean Berry Customer Engineering

Hypercosm. Studio.

Lab 2 : Basic File Server. Introduction

École des Ponts Paristech DSI. Installing OpenVPN

Double Feature Talk. 1) Intro to SSL 2) Git Basics for Devs & Designers

Automated Offsite Backup with rdiff-backup

Authorize Sauce Documentation

FEEG Applied Programming 3 - Version Control and Git II

How to test and debug an ASP.NET application

Installing a Symantec Backup Exec Agent on a SnapScale Cluster X2 Node or SnapServer DX1 or DX2. Summary

Transcription:

DevKey Documentation Release 0.1 Colm O Connor March 23, 2015

Contents 1 Quickstart 3 2 FAQ 5 3 Release Notes 7 i

ii

DevKey Documentation, Release 0.1 Github PyPI Contents 1

DevKey Documentation, Release 0.1 2 Contents

CHAPTER 1 Quickstart Step 1: Install like so: sudo pip install projectkey Step 2: Create a key.py file in the root folder of your project like this: #!/usr/bin/python """Yourproject development environment commands.""" from projectkey import cd, run, run_return, runnable def runserver(): """Run django debug web server on port 8080.""" print "Running webserver..." # Run simple shell commands run("./venv/bin/python manage.py runserver_plus 8080 --traceback --settings=yourproject.special_s def upgrade(): """pip upgrade on all packages and freeze to requirements afterwards.""" # Copy and paste whole bash scripts if you like... run("""./venv/bin/pip freeze --local grep -v ^\-e cut -d = -f 1 xargs./venv/bin/pip instal./venv/bin/pip freeze >./requirements.txt """) def smtp(): """Run development smtp server on port 25025.""" print "Running SMTP server..." run("python -m smtpd -n -c DebuggingServer localhost:25025") def striptrailingwhitespace(): """strip the trailing whitespace from all files in your mercurial repo.""" # Get the output of shell commands... repofiles = run_return("hg locate *.py").split( \n ) #...and write simple, short, python scripts to do stuff with it. repofiles.remove( ) for filename in repofiles: with open(filename, r ) as fh: new = [line.rstrip() for line in fh] with open(filename, w ) as fh: [fh.write( %s\n % line) for line in new] def inspectfile(*filenames): """Inspect file(s) for pylint violations.""" # You can also change to the directory that the k command was run from, if you need that. 3

DevKey Documentation, Release 0.1 cd(cwd) run("{0}/venv/bin/pylint --rcfile={0}/pylintrc -r n {1}".format(KEYDIR,.join(filenames))) # Add this and you can run the file directly (e.g. python key.py smtp) as well as by running "k smtp" runnable( name ) Step 3: Run the k command in any folder in your project: $ k inspectfile onefile.py twofiles.py [ Runs pylint on those files ] Step 4: Add more commands. 4 Chapter 1. Quickstart

CHAPTER 2 FAQ What problem is this intended to solve? It is mainly intended to cut down these types of unnecessary team interactions: Can you Skype me the command to run lint using our config file? How do you run a test again? I keep forgetting. What s the exact command to run a development web server? I tried but it isn t working for me. You mean we actually do have a script to deploy docker? Where?? How do I run it? Are you sure the instructions on the wiki work? They re three years old. Help! My git repo is broken again! I don t really understand git and I think I might have used a command wrongly. It should also save you keystrokes for commonly run sets of commands on your own projects. Why do I need ProjectKey? I already have ant/fabric/nose/salt/ansible/docker/fabric ProjectKey is not a tool intended to replace these tools. It is a tool that is supposed to invoke all of these tools and more. Ok I installed it. What kind of commands do I write with it? Anything you like, but here s the kind of commands I created with it: Set up [development testing staging live] environments Run various lint tools Run tests Generate documentation Run builds Create skeleton code. Dump/load data from the database. Upgrade dependencies Upload or sync files. Tail logs on production. ssh into production servers. Run deployment scripts. 5

DevKey Documentation, Release 0.1 Perform common pulling/pushing/merging/rebasing workflows. Common interaction tasks with docker/vagrant/ansible/puppet/etc. Why is the script called k and not projectkey? Because you will probably be running it a lot. A one letter command means fewer keystrokes to wear you and your keyboard out. Is this just for python projects? No, you can use it on any project, you just have to create the commands in python (or translate shell commands). You don t even really need to know python to use this. Just use the template from quickstart. I already have a bunch of shell scripts. Why should I use this? Great! You can unite them in one place, and: 1. All of your project commands get united under one easy to use, discoverable, self documenting file that anybody on your team can invoke up with one key. 2. It can be run even if you are six levels deep inside of your project. 3. You can translate almost any line in your bash script to use this self.sc( your command here ) so it s not hard to switch. 4. You can use a programming language that doesn t suck to write some of the more complex automation tasks. Shouldn t I install this in a virtualenv? You can, but I wouldn t. I would install it on your system python and write commands for each individual project key that understand the virtualenv that your project runs in. It has one dependency, so it is unlikely to cause conflicts with other packages installed on your system python. 6 Chapter 2. FAQ

CHAPTER 3 Release Notes 0.5 sudo pip install now sets up argument completion automagically. 0.4 Made the default starting directory the directory that the key file is in. 0.3 Made the key file directly runnable with the runnable( name ) command. 0.2 Made ProjectKey a module function based runner rather than a class method based runner. 0.1.1 Fixed bug caused by missing docstring. 0.1 Initial release 7