Beta test of pull and push scripts
This commit is contained in:
@@ -63,6 +63,12 @@ RUN ln -s /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/defau
|
|||||||
ADD ./index.php /usr/share/nginx/html/index.php
|
ADD ./index.php /usr/share/nginx/html/index.php
|
||||||
RUN chown -Rf nginx.nginx /usr/share/nginx/html/
|
RUN chown -Rf nginx.nginx /usr/share/nginx/html/
|
||||||
|
|
||||||
|
# Add git commands to allow container updating
|
||||||
|
ADD ./pull /usr/bin/pull
|
||||||
|
ADD ./push /usr/bin/push
|
||||||
|
RUN chmod 755 /usr/bin/pull
|
||||||
|
RUN chmod 755 /usr/bin/push
|
||||||
|
|
||||||
# Supervisor Config
|
# Supervisor Config
|
||||||
RUN /usr/bin/easy_install supervisor
|
RUN /usr/bin/easy_install supervisor
|
||||||
RUN /usr/bin/easy_install supervisor-stdout
|
RUN /usr/bin/easy_install supervisor-stdout
|
||||||
|
|||||||
18
pull
Executable file
18
pull
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$GIT_EMAILi2" ]; then
|
||||||
|
echo "You need to pass the \$GIT_EMAIL variable to the container for this to work"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo $GIT_EMAIL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$GIT_NAME" ]; then
|
||||||
|
echo "You need to pass the \$GIT_NAME variable to the container for this to work"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo $GIT_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd /usr/share/nginx/html
|
||||||
|
git pull
|
||||||
20
push
Executable file
20
push
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
timestamp() {
|
||||||
|
date +"%D %T"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$GIT_EMAIL" ]; then
|
||||||
|
echo "You need to pass the \$GIT_EMAIL variable to the container for this to work"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$GIT_NAME" ]; then
|
||||||
|
echo "You need to pass the \$GIT_NAME variable to the container for this to work"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
ts=$(timestamp)
|
||||||
|
cd /usr/share/nginx/html
|
||||||
|
git add *
|
||||||
|
git commit -a -m "push from container $ts"
|
||||||
8
start.sh
8
start.sh
@@ -5,6 +5,14 @@
|
|||||||
mkdir -p -m 0700 /root/.ssh
|
mkdir -p -m 0700 /root/.ssh
|
||||||
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
|
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
|
||||||
|
|
||||||
|
# Setup git variables
|
||||||
|
if [ ! -z "$GIT_EMAIL" ]; then
|
||||||
|
git config --global user.email "$GIT_EMAIL"
|
||||||
|
fi
|
||||||
|
if [ ! -z "$GIT_NAME" ]; then
|
||||||
|
git config --global user.name "$GIT_NAME"
|
||||||
|
fi
|
||||||
|
|
||||||
# Pull down code form git for our site!
|
# Pull down code form git for our site!
|
||||||
if [ ! -z "$GIT_REPO" ]; then
|
if [ ! -z "$GIT_REPO" ]; then
|
||||||
rm /usr/share/nginx/html/*
|
rm /usr/share/nginx/html/*
|
||||||
|
|||||||
Reference in New Issue
Block a user