Skip to content

Commit

Permalink
update file-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Aug 2, 2017
1 parent cd416fa commit ab97dff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docker/file-sync/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker build -t dockerhub.qingcloud.com/qingcloud/file-sync:0.6 .
docker build -t dockerhub.qingcloud.com/qingcloud/file-sync:0.7 .
30 changes: 14 additions & 16 deletions docker/file-sync/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#!/usr/bin/env bash


function sync_file(){
local F=$1
local T=$2
local d=$(dirname ${T})
mkdir -p "${d}"
cat ${F} > ${T}
if [ "$?" -ne 0 ]
then
echo "copy file fail."
else
echo "${T} in sync with ${F}"
fi
}

echo "sync ${FROM_FILE} to ${TO_FILE} "
while [ ! -f ${FROM_FILE} ]
Expand Down Expand Up @@ -40,18 +52,4 @@ do
echo "from file symlink is change, convert to real path: ${REAL_FILE}"
fi
fi
done

function sync_file(){
local F=$1
local T=$2
local d=$(dirname ${T})
mkdir -p "${d}"
cat ${F} > ${T}
if [ "$?" -ne 0 ]
then
echo "copy file fail."
else
echo "${T} in sync with ${F}"
fi
}
done
2 changes: 1 addition & 1 deletion sample/ssh-authkey-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: file-sync
image: dockerhub.qingcloud.com/qingcloud/file-sync:0.6
image: dockerhub.qingcloud.com/qingcloud/file-sync:0.7
imagePullPolicy: IfNotPresent
env:
- name: FROM_FILE
Expand Down

0 comments on commit ab97dff

Please sign in to comment.