mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
make script support docker
This commit is contained in:
@@ -9,6 +9,8 @@ WORKDIR /usr/src/app
|
||||
|
||||
COPY . /usr/src/app/
|
||||
|
||||
ENV IS_DOCKER=true
|
||||
|
||||
RUN bash install.sh
|
||||
|
||||
# Expose ports.
|
||||
|
||||
11
install.sh
11
install.sh
@@ -1,7 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Pull latest changes
|
||||
git pull
|
||||
|
||||
# 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,14 +61,21 @@ if [[ ! $(which git) ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
GIT_REPO_URL=$(git config --get remote.origin.url)
|
||||
|
||||
if [[ $GIT_REPO_URL != *oneuptime* ]] # * is used for pattern matching
|
||||
then
|
||||
git clone https://github.com/OneUptime/oneuptime.git || true
|
||||
cd oneuptime
|
||||
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
|
||||
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" ]
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user