mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
make script support docker
This commit is contained in:
parent
396e44cb75
commit
696e3c71c2
@ -9,6 +9,8 @@ WORKDIR /usr/src/app
|
||||
|
||||
COPY . /usr/src/app/
|
||||
|
||||
ENV IS_DOCKER=true
|
||||
|
||||
RUN bash install.sh
|
||||
|
||||
# Expose ports.
|
||||
|
@ -1,7 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
# If its not environment IS_DOCKER then exit
|
||||
|
||||
if[[ $IS_DOCKER == "true" ]]; then
|
||||
echo "This script should run in the docker container."
|
||||
else
|
||||
# Pull latest changes
|
||||
git pull
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -61,6 +61,10 @@ if [[ ! $(which git) ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if[[ $IS_DOCKER == "true" ]]; then
|
||||
echo "This script should run in the docker container."
|
||||
else
|
||||
GIT_REPO_URL=$(git config --get remote.origin.url)
|
||||
|
||||
if [[ $GIT_REPO_URL != *oneuptime* ]] # * is used for pattern matching
|
||||
@ -68,6 +72,9 @@ then
|
||||
git clone https://github.com/OneUptime/oneuptime.git || true
|
||||
cd oneuptime
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# if this script is not running in CI/CD
|
||||
if [ -z "$CI_PIPELINE_ID" ]
|
||||
|
Loading…
Reference in New Issue
Block a user