Skip to content

Instantly share code, notes, and snippets.

@shabbychef
Created July 18, 2017 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shabbychef/bf96d65160a503b5c4c3d0d28e2a7dc2 to your computer and use it in GitHub Desktop.
Save shabbychef/bf96d65160a503b5c4c3d0d28e2a7dc2 to your computer and use it in GitHub Desktop.
soundcloud sync a user with Docker
#
# docker build --rm -t shabbychef/sc .
#
# docker run -it --rm -v $(pwd)/muzak:/srv:rw shabbychef/sc "-u" "shabbychef" "-o" "/srv" "-c" "THIS IS YOUR API KEY THINGY AA43"
#
# Created: 2016.03.07
# Copyright: Steven E. Pav, 2016
# Author: Steven E. Pav
# Comments: Steven E. Pav
#####################################################
# preamble# FOLDUP
FROM python:3.4-onbuild
MAINTAINER Steven E. Pav, shabbychef@gmail.com
USER root
# UNFOLD
ENV DOCKFILE_REFRESHED_AT 2017.01.23
# see http://crosbymichael.com/dockerfile-best-practices.html
#RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN (apt-get clean -y ; \
apt-get update -y -qq; \
apt-get update --fix-missing );
RUN (DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -y --no-install-recommends -q libav-tools ; \
apt-get clean -q -y )
#####################################################
# entry and cmd# FOLDUP
# always use array syntax:
ENTRYPOINT ["sc-syncer"]
# ENTRYPOINT and CMD are better together:
CMD ["--help"]
# UNFOLD
#for vim modeline: (do not edit)
# vim:nu:fdm=marker:fmr=FOLDUP,UNFOLD:cms=#%s:syn=Dockerfile:ft=Dockerfile:fo=croql
stagger
pydub
python-dateutil
python-magic
tox
mock
nose
pep8
soundcloud-syncer
#!/bin/bash -e
#
# Created: 2016.03.08
# Copyright: Steven E. Pav, 2016
# Author: Steven E. Pav
# Comments: Steven E. Pav
VERBOSE=""
APIKEY="WHATEVER YOUR API KEY IS GO HERE"
SOUNDCLOUD_USER=shabbychef
HELP_STRING="$0 [-v]";
while getopts "A:U:vh" flag
do
case "$flag" in
(h) echo "$HELP_STRING output_dir";
exit 0;;
(A) APIKEY=$OPTARG;;
(U) SOUNDCLOUD_USER=$OPTARG;;
(v) VERBOSE='--verbose';;
esac
done
shift $((OPTIND-1))
function finish() {
echo doing cleanup here
times
}
trap finish EXIT
docker run -i --rm -v $1:/srv:rw shabbychef/sc "-u" "$SOUNDCLOUD_USER" "-o" "/srv" "-C" "-c" "$APIKEY"
#for vim modeline: (do not edit)
# vim:ts=2:sw=2:tw=129:fdm=marker:fmr=FOLDUP,UNFOLD:cms=#%s:syn=sh:ft=sh:ai:si:cin:nu:fo=croql:cino=p0t0c5(0:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment