local-docker.sh now accepts env vars

This commit is contained in:
Colin Hom 2016-07-07 14:25:16 -07:00 committed by Joseph Schorr
parent bc13333f20
commit 1e3351f3f4
2 changed files with 13 additions and 6 deletions

View file

@ -322,18 +322,18 @@ class KubernetesExecutor(BuilderExecutor):
'labels': {
'build': build_uuid,
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
'worker': socket.gethostname(),
'manager': socket.gethostname(),
'quay-sha': release.GIT_HEAD or 'none',
},
},
'spec' : {
'activeDeadlineSeconds' : 7200,
'template' : {
'activeDeadlineSeconds': self.executor_config.get('MAXIMUM_JOB_TIME', 7200),
'template': {
'metadata': {
'labels': {
'build': build_uuid,
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
'worker': socket.gethostname(),
'manager': socket.gethostname(),
'quay-sha': release.GIT_HEAD or 'none',
},
},
@ -378,7 +378,6 @@ class KubernetesExecutor(BuilderExecutor):
@coroutine
def stop_builder(self, builder_id):
pods_path = '/api/v1/namespaces/%s/pods' % self.namespace
selectorString = "job-name=%s" % builder_id

View file

@ -7,7 +7,15 @@ REPO=quay.io/quay/quay-dev
d ()
{
docker build -t $REPO -f dev.df --build-arg src_subdir=$(basename `pwd`) .
docker -- run --rm -v /var/run/docker.sock:/run/docker.sock -it --net=host -v $(pwd)/..:/src $REPO $*
#ENV_VARS="foo=bar key=value name=joe"
local envStr=""
if [[ "$ENV_VARS" != "" ]];then
for envVar in $ENV_VARS;do
envStr="${envStr} -e \"${envVar}\""
done
fi
docker -- run --rm $envStr -v /var/run/docker.sock:/run/docker.sock -it --net=host -v $(pwd)/..:/src $REPO $*
}
case $1 in