Skip to content

Commit 5a674f5

Browse files
committed
Refine ssh-add-key
1 parent b681ad5 commit 5a674f5

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ ADD ssh-add-key /usr/bin/ssh-add-key
5555
RUN useradd -s /bin/bash git
5656
RUN echo "git ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
5757

58-
RUN mkdir -p /parse-cloud-code && \
59-
chown -R git:git /parse-cloud-code && \
60-
chown -R git:git /parse/cloud
61-
6258
ENV TINI_VERSION v0.9.0
6359
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
6460
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc

docker-entrypoint.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,20 @@ set -e
44

55
/etc/init.d/ssh start > /dev/null
66

7-
if [ ! -d /parse-cloud-code ]; then
8-
mkdir -p /parse-cloud-code
9-
fi
7+
mkdir -p /parse-cloud-code
108

11-
if [ ! -d /parse/cloud ]; then
12-
mkdir -p /parse/cloud
13-
fi
14-
15-
pushd /parse-cloud-code > /dev/null
16-
git init --bare > /dev/null
9+
git init --bare /parse-cloud-code > /dev/null
1710

1811
cat << EOF > /parse-cloud-code/hooks/post-receive
1912
#!/bin/bash
2013
unset GIT_INDEX_FILE
21-
git --work-tree=/parse/cloud clean -df
22-
git --work-tree=/parse/cloud checkout -f
14+
git --work-tree="${CLOUD_CODE_HOME}" clean -df
15+
git --work-tree="${CLOUD_CODE_HOME}" checkout -f
2316
EOF
2417

25-
chown -R git:git /parse-cloud-code > /dev/null
26-
chown -R git:git /parse/cloud > /dev/null
2718
chmod a+x /parse-cloud-code/hooks/post-receive > /dev/null
28-
popd > /dev/null
19+
20+
chown -R git:git /parse-cloud-code > /dev/null
21+
chown -R git:git "$CLOUD_CODE_HOME" > /dev/null
2922

3023
exec "$@"

0 commit comments

Comments
 (0)