Skip to content

Commit 1fe9398

Browse files
Replaced toothpaste with simpleRepair and fix tests (#20)
* Replaced toothpaste with simpleRepair and fix tests * Added sugar folder * Fixed docker compose command * removing sugar9 workflows no longer supported
1 parent ea9f254 commit 1fe9398

File tree

8 files changed

+23
-48
lines changed

8 files changed

+23
-48
lines changed

.github/workflows/sugar9.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sugar Dockerized [![Build Status](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar12.yml/badge.svg)](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar12.yml) [![Build Status](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar13.yml/badge.svg)](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar13.yml)
1+
# Sugar Dockerized [![Build Status](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar12.yml/badge.svg)](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar12.yml) [![Build Status](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar13.yml/badge.svg)](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar13.yml) [![Build Status](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar14.yml/badge.svg)](https://github.com/sugarcrm-developers/SugarDockerized/actions/workflows/sugar14.yml)
22

33
This repository will help you deploy a Docker based **development only** full stack for Sugar, meeting all the platform requirements for a different set of platform combinations.
44

@@ -11,7 +11,6 @@ If you find this software useful, please consider supporting the work that went
1111
## Requirements
1212
* linux platform - it can be a virtual machine
1313
* docker
14-
* docker-compose
1514
* curl
1615
* rsync
1716
* zip
@@ -21,12 +20,13 @@ If you find this software useful, please consider supporting the work that went
2120

2221
## Stacks available
2322
There are few stacks available, with in itself multiple platform combinations. You can read more about the specific stacks on the links below:
24-
* [Sugar 13](stacks/sugar13/README.md) - This stack is valid from version 13 for local developement also of Sugar Cloud only versions
25-
* [Sugar 12](stacks/sugar12/README.md) - This stack is valid from version 12 for local developement also of Sugar Cloud only versions
26-
* [Sugar 11](stacks/sugar11/README.md) - This stack is valid from version 11 for local developement also of Sugar Cloud only versions
23+
* [Sugar 14](stacks/sugar14/README.md) - This stack is valid for version 13 for local developement also of Sugar Cloud only versions
24+
* [Sugar 13](stacks/sugar13/README.md) - This stack is valid for version 13 for local developement also of Sugar Cloud only versions
25+
* [Sugar 12](stacks/sugar12/README.md) - This stack is valid for version 12 for local developement also of Sugar Cloud only versions
26+
* [Sugar 11](stacks/sugar11/README.md) - This stack is valid for version 11 for local developement also of Sugar Cloud only versions
2727

2828
You will find additional stacks within the [stack directory of the project](stacks).
29-
For most stacks, there are both the pre-built version (eg on Sugar 13: `./stacks/sugar13/php82.yml`) and a locally built version (eg on Sugar 13: `./stacks/sugar13/php82-local-build.yml`). The locally built version will be built run-time, and therefore those stacks will let you specify additional changes you might require to the docker images provided. Local builds will take much longer to deploy than pre-built ones.
29+
For most stacks, there are both the pre-built version (eg on Sugar 14: `./stacks/sugar14/php83.yml`) and a locally built version (eg on Sugar 14: `./stacks/sugar14/php83-local-build.yml`). The locally built version will be built run-time, and therefore those stacks will let you specify additional changes you might require to the docker images provided. Local builds will take much longer to deploy than pre-built ones.
3030

3131
### Types of stacks
3232
There are mainly three types of stack:
@@ -66,7 +66,7 @@ For details about the hostnames and credentials of each of the infrastructure co
6666
* Run the utility `build/build.sh`. Read more about [build/build.sh](#buildbuildsh)
6767

6868
## Current version support
69-
The main stacks work with [Sugar version 13.0 and all its platform requirements](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_13.0.x_Supported_Platforms/). Additional stacks are aligned with the platform requirements of version [12.x](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_12.0.x_Supported_Platforms/), [11.x](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_11.0.x_Supported_Platforms/) and stacks for Sugar Cloud only versions for local development only.
69+
The main stacks work with [Sugar version 14.0 and all its platform requirements](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_14.0.x_Supported_Platforms/). Additional stacks are aligned with the platform requirements of version [13.x](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_13.0.x_Supported_Platforms/), [12.x](https://support.sugarcrm.com/Resources/Supported_Platforms/Sugar_12.0.x_Supported_Platforms/) and stacks for Sugar Cloud only versions for local development only.
7070

7171
## System's details
7272

@@ -481,7 +481,7 @@ To run the repair from the docker host, assuming that the repository has been ch
481481
cd sugardocker
482482
./utilities/repair.sh
483483
```
484-
The actual code for `repair.sh` leverages the [`toothpaste.sh`](#toothpastesh) script mentioned above.
484+
This script will use [simpleRepair.php](utilities/build/simpleRepair.php) created to QRR (repair and rebuild) local instances. The script itself will clear cache and warmup services in the local instance.
485485

486486
### Setup Sugar instance to leverage Redis object caching
487487
Add on `config_override.php` the following options:

data/app/sugar/.gitkeep

Whitespace-only changes.

stacks/reverseproxy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This container will help you do just that, when deployed within your OSX environ
77
* Make sure no web server is running locally on your OSX environment, and port 80 and 8080 are not in use
88
* Clone the git repository into your OSX environment
99
* While leveraging this functionality, temporarily disable your OSX firewall by navigating to: System Preferences, Security & Privacy, Firewall, Turn Off Firewall
10-
* Start the container with: `docker-compose -f stacks/reverseproxy/docker-compose.yml up -d`
10+
* Start the container with: `docker compose -f stacks/reverseproxy/docker-compose.yml up -d`
1111
* Find out your local ip address by navigating to: System Preferences, Network and choosing the active network available in your specific scenario
1212

1313
It would then be possible for your local network to access your Sugar environment by navigating to the url: `http://<local ip address>/sugar/` (make sure to add the `/` at the end of the url)

tests/stop.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ then
55
exit 1
66
else
77
echo Stopping environment $1
8-
docker-compose -f $1 down
9-
docker-compose -f $1 rm
8+
docker compose -f $1 down
9+
docker compose -f $1 rm
1010
fi

tests/web_tests.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ then
44
echo PHP version not provided
55
else
66
echo Installing composer dependencies if any
7-
# add web_tests to sugar-cron after it becomes available through 'pwd'
8-
./utilities/runcli.sh "pwd"
9-
docker cp ./tests/web_tests sugar-cron:/var/www/html/sugar
10-
117
./utilities/runcli.sh "cd ./web_tests/$3/ && composer install"
128

139
echo Confirming that Apache, MySQL and Elasticsearch are available
@@ -29,10 +25,6 @@ else
2925
fi
3026
done
3127

32-
# add web_tests to sugar-web1
33-
docker cp ./tests/web_tests sugar-web1:/var/www/html/sugar/
34-
docker exec sugar-web1 chown sugar:sugar -R /var/www/html/sugar/web_tests
35-
3628
while [ `./utilities/runcli.sh "(echo >/dev/tcp/sugar-mysql/3306) &>/dev/null && echo 1 || echo 0"` != "1" ] ; do
3729
echo MySQL is not ready... sleeping...
3830
sleep $INTERVAL
@@ -77,18 +69,18 @@ else
7769
echo Script ./web_tests/$3/test_$i.php executed successfully via CLI
7870
fi
7971

80-
OUTPUT_WEB=`./utilities/runcli.sh "curl -s http://sugar-web1/sugar/web_tests/$3/test_$i.php | grep ok | wc -l"`
72+
OUTPUT_WEB=`curl -s http://docker.local/sugar/web_tests/$3/test_$i.php | grep ok | wc -l`
8173
if [ $OUTPUT_WEB != '1' ]
8274
then
8375
echo Error for web script test_$i.php
8476
echo Output:
85-
echo `curl -s http://sugar-web1/sugar/web_tests/$3/test_$i.php`
77+
echo `curl -s http://docker.local/sugar/web_tests/$3/test_$i.php`
8678
echo
8779
echo Retrieving complete logs from the web server:
8880
docker logs sugar-web1
8981
exit 1
9082
else
91-
echo Script http://sugar-web1/sugar/web_tests/$3/test_$i.php executed successfully via web
83+
echo Script http://docker.local/sugar/web_tests/$3/test_$i.php executed successfully via web
9284
fi
9385
done
9486
fi

utilities/repair.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
# get into the correct directory
44
REPO="$( dirname ${BASH_SOURCE[0]} )/../"
55
cd $REPO
6-
./utilities/toothpaste.sh "local:system:repair --instance ../sugar"
6+
echo Repairing system
7+
if [ ! -f ./data/app/sugar/simpleRepair.php ]; then
8+
cp ./utilities/build/simpleRepair.php ./data/app/sugar
9+
fi
10+
./utilities/runcli.sh "php simpleRepair.php"
11+
echo System repaired

utilities/stack.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ else
4848
then
4949
echo The stack is already down, skipping
5050
else
51-
docker-compose -f $STACKFILE down
52-
docker-compose -f $STACKFILE rm
51+
docker compose -f $STACKFILE down
52+
docker compose -f $STACKFILE rm
5353
fi
5454
else
5555
if [ $2 == 'up' ]
5656
then
57-
docker-compose -f $STACKFILE up -d --build
57+
docker compose -f $STACKFILE up -d --build
5858
else
5959
echo The action $2 is not applicable
6060
fi

0 commit comments

Comments
 (0)