local-docker.sh now accepts env vars
This commit is contained in:
parent
bc13333f20
commit
1e3351f3f4
2 changed files with 13 additions and 6 deletions
|
@ -322,18 +322,18 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
'labels': {
|
'labels': {
|
||||||
'build': build_uuid,
|
'build': build_uuid,
|
||||||
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
||||||
'worker': socket.gethostname(),
|
'manager': socket.gethostname(),
|
||||||
'quay-sha': release.GIT_HEAD or 'none',
|
'quay-sha': release.GIT_HEAD or 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'spec' : {
|
'spec' : {
|
||||||
'activeDeadlineSeconds' : 7200,
|
'activeDeadlineSeconds': self.executor_config.get('MAXIMUM_JOB_TIME', 7200),
|
||||||
'template': {
|
'template': {
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'labels': {
|
'labels': {
|
||||||
'build': build_uuid,
|
'build': build_uuid,
|
||||||
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
'time': datetime.datetime.now().strftime('%Y-%m-%d-%H'),
|
||||||
'worker': socket.gethostname(),
|
'manager': socket.gethostname(),
|
||||||
'quay-sha': release.GIT_HEAD or 'none',
|
'quay-sha': release.GIT_HEAD or 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -378,7 +378,6 @@ class KubernetesExecutor(BuilderExecutor):
|
||||||
|
|
||||||
@coroutine
|
@coroutine
|
||||||
def stop_builder(self, builder_id):
|
def stop_builder(self, builder_id):
|
||||||
|
|
||||||
pods_path = '/api/v1/namespaces/%s/pods' % self.namespace
|
pods_path = '/api/v1/namespaces/%s/pods' % self.namespace
|
||||||
|
|
||||||
selectorString = "job-name=%s" % builder_id
|
selectorString = "job-name=%s" % builder_id
|
||||||
|
|
|
@ -7,7 +7,15 @@ REPO=quay.io/quay/quay-dev
|
||||||
d ()
|
d ()
|
||||||
{
|
{
|
||||||
docker build -t $REPO -f dev.df --build-arg src_subdir=$(basename `pwd`) .
|
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
|
case $1 in
|
||||||
|
|
Reference in a new issue