Skip to content

Instantly share code, notes, and snippets.

View andrewsmedina's full-sized avatar

Andrews Medina andrewsmedina

View GitHub Profile
#! /bin/bash
# tsuru wordpress <appname>
echo "criando app $1"
tsuru app-create $1 php
servicename="mysql-$1"
echo "criando mysql $servicename"
tsuru service-add mysql $servicename
#! /bin/bash
echo "plugin envs"
echo ""
env
echo ""
#! /bin/bash
curl -H "authorization: bearer $TSURU_TOKEN" "${TSURU_TARGET}apps"

Deploying Go applications in tsuru

Overview

class Post(models.Model):
pass
class Photo(models.Model):
pass
class Like(models.Model):
photo = models.ForeignKey(Photo)
class Like(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ...
File "<stdin>", line 1
...
^
SyntaxError: invalid syntax
>>> ^D
#! /bin/bash
echo $@
@register.simple_tag(takes_context=True)
def mytag(context, obj, user, as, name):
check_published = True
if user.is_staff or user.is_superuser:
check_published = False
context[name] = obj.all_images(check_published)
return ''
tsuru-admin platform-add python --dockerfile https://raw.githubusercontent.com/tsuru/basebuilder/master/python/Dockerfile