Skip to content

Commit

Permalink
#28 the complete correct repo has to be here before we continue
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Oct 29, 2024
1 parent 29ff0c6 commit 8f80308
Showing 1 changed file with 46 additions and 44 deletions.
90 changes: 46 additions & 44 deletions setup_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,50 @@ fi
printf "start installation\n\n"



# stop and remove old containers
printf " \n${YELLOW}stopping and removing old containers${NC}\n"
# stop running container(s)
docker ps -aq | xargs -r docker stop
# remove existing container(s)
docker ps -aq | xargs -r docker rm

# Remove all volumes (to avoid cert generation issues)
printf " \n${YELLOW}removing all volumes${NC}\n"
docker volume ls -qf dangling=true | xargs -r docker volume rm

# Remove all images
printf " \n${YELLOW}removing all images${NC}\n"
docker images -a -q | xargs -r docker rmi

# and finally, cleanup Docker
printf " \n${YELLOW}finally cleanup Docker${NC}\n"
docker system prune -f

# Clone the repository and its submodules
printf " \n${YELLOW}cloning oih-ui-docker to $installDir${NC}\n"
git clone --recurse-submodules [email protected]:iodepo/oih-ui-docker.git $installDir

# Navigate to the project directory
cd $installDir

# Fetch the latest changes and check out the 'release' branch
printf " \n${YELLOW}fetching and checking out the 'release' branch${NC}\n"
git fetch
git checkout release

# Navigate to the 'frontend' directory, fetch the latest changes, and check out the 'feature/restyling' branch
printf " \n${YELLOW}navigating to 'frontend' directory and fetching and checking out the 'feature/restyling' branch${NC}\n"
cd $installDir/frontend
git fetch
git checkout feature/restyling

# Return to the main directory and navigate to the 'api' directory, fetch the latest changes, and check out the 'feature/restyling' branch
printf " \n${YELLOW}navigating to 'api' directory and fetching and checking out the 'feature/restyling' branch${NC}\n"
cd $installDir/api
git fetch
git checkout feature/restyling

# Create the .env file in the project directory
cd $installDir
touch $installDir/.env
Expand All @@ -135,6 +179,7 @@ else
dockerComposeFile="docker-compose.workflow.yml"

#copy the old file and add a date to the name
printf "make backup of ${YELLOW}letsencrypt_user_data.conf${NC}\n"
cp $installDir/nginx/conf.d/letsencrypt_user_data.conf $installDir/nginx/conf.d/letsencrypt_user_data.conf_$(date +%Y%m%d%H%M%S)

#add the correct lines for the SSL certificates
Expand All @@ -145,6 +190,7 @@ else
echo "LETSENCRYPT_workflow_HOST=('$workflowHost')" >> $installDir/nginx/conf.d/letsencrypt_user_data.conf

#copy the old proxy file and add a date to the name
printf "make backup of ${YELLOW}proxy.conf${NC}\n"
cp $installDir/nginx/conf.d/proxy.conf $installDir/nginx/conf.d/proxy.conf_$(date +%Y%m%d%H%M%S)

#add the correct lines for the nginx proxy
Expand Down Expand Up @@ -183,50 +229,6 @@ else

fi

exit 0

# stop and remove old containers
printf " \n${YELLOW}stopping and removing old containers${NC}\n"
# stop running container(s)
docker ps -aq | xargs -r docker stop
# remove existing container(s)
docker ps -aq | xargs -r docker rm

# Remove all volumes (to avoid cert generation issues)
printf " \n${YELLOW}removing all volumes${NC}\n"
docker volume ls -qf dangling=true | xargs -r docker volume rm

# Remove all images
printf " \n${YELLOW}removing all images${NC}\n"
docker images -a -q | xargs -r docker rmi

# and finally, cleanup Docker
printf " \n${YELLOW}finally cleanup Docker${NC}\n"
docker system prune -f

# Clone the repository and its submodules
printf " \n${YELLOW}cloning oih-ui-docker to $installDir${NC}\n"
git clone --recurse-submodules [email protected]:iodepo/oih-ui-docker.git $installDir

# Navigate to the project directory
cd $installDir

# Fetch the latest changes and check out the 'release' branch
printf " \n${YELLOW}fetching and checking out the 'release' branch${NC}\n"
git fetch
git checkout release

# Navigate to the 'frontend' directory, fetch the latest changes, and check out the 'feature/restyling' branch
printf " \n${YELLOW}navigating to 'frontend' directory and fetching and checking out the 'feature/restyling' branch${NC}\n"
cd $installDir/frontend
git fetch
git checkout feature/restyling

# Return to the main directory and navigate to the 'api' directory, fetch the latest changes, and check out the 'feature/restyling' branch
printf " \n${YELLOW}navigating to 'api' directory and fetching and checking out the 'feature/restyling' branch${NC}\n"
cd $installDir/api
git fetch
git checkout feature/restyling

# Copy Solr data to the target directory and change its permissions (change the root with the right one)
printf " \n${YELLOW}copying Solr data to the target directory and changing its permissions${NC}\n"
Expand Down

0 comments on commit 8f80308

Please sign in to comment.