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
def upload(dbx, data, path, overwrite=False): | |
"""Upload a file. | |
Return the request response, or None in case of error. | |
""" | |
mode = (dropbox.files.WriteMode.overwrite | |
if overwrite | |
else dropbox.files.WriteMode.add) | |
try: | |
res = dbx.files_upload(data, path, mode) |
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
def main(): | |
tempFile = ''.join(sys.stdin.readlines()) | |
try: | |
token = os.environ["TOKEN"] | |
dest_path = os.environ["FILE"] | |
except KeyError as err: | |
print "One or more environment variable are missing, %s" % err | |
return |
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
#!/usr/local/bin/python | |
import dropbox | |
import os | |
import sys |
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 python:2.7.12-alpine | |
RUN wget -O- "http://s3.amazonaws.com/babl/babl-server_linux_amd64.gz" | gunzip > /bin/babl-server && chmod +x /bin/babl-server | |
ADD app /data/ | |
RUN ln -s /data/app /bin/app | |
RUN chmod +x /bin/app | |
WORKDIR /data | |
RUN pip install -U pip | |
RUN pip install dropbox | |
CMD ["babl-server"] |
NewerOlder