Skip to content

Commit

Permalink
Upgrade the development run scripts (also add Restart and Stop)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Oct 23, 2024
1 parent 6172e5e commit cec8300
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .run/Build.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm run build" />
<option name="SCRIPT_TEXT" value="if [ -z &quot;$(docker compose ls | grep $(basename &quot;$PWD&quot;))&quot; ]; then docker stop $(docker ps -a -q) &amp;&amp; docker network prune -f &amp;&amp; docker compose up -d --force-recreate &amp;&amp; docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm run build; else docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm run build; fi " />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand Down
17 changes: 17 additions & 0 deletions .run/Restart.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Restart" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="docker stop $(docker ps -a -q) &amp;&amp; docker network prune -f &amp;&amp; docker compose up -d --force-recreate &amp;&amp; docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm start" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/SSH.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SSH" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 bash" />
<option name="SCRIPT_TEXT" value="if [ -z &quot;$(docker compose ls | grep $(basename &quot;$PWD&quot;))&quot; ]; then docker stop $(docker ps -a -q) &amp;&amp; docker network prune -f &amp;&amp; docker compose up -d --force-recreate &amp;&amp; docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 bash; else docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 bash; fi" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand Down
2 changes: 1 addition & 1 deletion .run/Start.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Start" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="docker stop $(docker ps -a -q) &amp;&amp; docker compose up -d &amp;&amp; docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm start" />
<option name="SCRIPT_TEXT" value="if [ -z &quot;$(docker compose ls | grep $(basename &quot;$PWD&quot;))&quot; ]; then docker stop $(docker ps -a -q) &amp;&amp; docker network prune -f &amp;&amp; docker compose up -d --force-recreate &amp;&amp; docker exec -it $(basename &quot;$PWD&quot;)-php-fpm-1 npm start; else echo &quot;Docker compose is already running!&quot;; fi " />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand Down
17 changes: 17 additions & 0 deletions .run/Stop.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Stop" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="docker stop $(docker ps -a -q)" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>

0 comments on commit cec8300

Please sign in to comment.