diff --git a/.github/workflows/create_new_tag.yml b/.github/workflows/create_new_tag.yml new file mode 100644 index 0000000..2b4f15d --- /dev/null +++ b/.github/workflows/create_new_tag.yml @@ -0,0 +1,25 @@ +name: Create new release tag +on: + workflow_dispatch: + push: + branches: [ "master" ] + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Configure git + run: | + git config user.name "SimpleRisk Updater" + git config user.email "support@simplerisk.com" + git config push.followTags true + git fetch --tags + - name: Check if tag does not exist, and generate/push one + run: | + TAG_NAME=$(grep "/tmp/version" simplerisk-minimal/php81/Dockerfile | cut -d ' ' -f 6) + if ! git rev-parse "$TAG_NAME" >/dev/null 2>&1; then + git tag -a $TAG_NAME -m "SimpleRisk $TAG_NAME Release" + fi + git push --tags diff --git a/README.md b/README.md index 7cc2dad..9a7e697 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ A `stack.yml` file is provided for a stack deployment of the application through Change its settings according to your needs. -[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/simplerisk/docker/master/stack.yml) - ## Build it yourself Click on the image name on the [Images Overview](#images-overview) section for more details. diff --git a/simplerisk-minimal/README.md b/simplerisk-minimal/README.md index 166b922..a8a3f1f 100644 --- a/simplerisk-minimal/README.md +++ b/simplerisk-minimal/README.md @@ -1,5 +1,7 @@ # SimpleRisk Minimal Image +[![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/simplerisk/docker/master/simplerisk-minimal/stack.yml) + This image is intended to run SimpleRisk in a 'microservices' approach (database is not included). It uses PHP 8.X with Apache as a base image. Also has the capability of setting properties of the `config.php` file through environment variables. For any of the executions, it is recommended to map the 80 and 443 ports to be able to access the application. @@ -37,17 +39,17 @@ You must provide the environment variable `DB_SETUP=automatic|automatic-only` an Another detail to consider is that if the database set up is being executed and the `SIMPLERISK_DB_PASSWORD` variable is not provided, the application will generate a random password and show it on the container logs. The way to run the container on this mode are the following: -``` +```bash # Automatic setup (set database and keep running) -docker run -d --name simplerisk -e DB_SETUP=automatic -e AUTO_DB_SETUP_PASS=test -e SIMPLERISK_DB_HOSTNAME=172.17.0.2 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal +docker run -d --name simplerisk -e DB_SETUP=automatic -e DB_SETUP_PASS=test -e SIMPLERISK_DB_HOSTNAME=172.17.0.2 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal # Automatic-only setup (set database and stop container) -docker run -d --name simplerisk -e DB_SETUP=automatic-only -e AUTO_DB_SETUP_PASS=test -e SIMPLERISK_DB_HOSTNAME=172.17.0.2 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal +docker run -d --name simplerisk -e DB_SETUP=automatic-only -e DB_SETUP_PASS=test -e SIMPLERISK_DB_HOSTNAME=172.17.0.2 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal ``` ### Normal execution -If the database is already set up for SimpleRisk to use it, run the container by just providing the `SIMPLERISK_DB_*` options. For example, if the database is located at `db-server.example.com` on port 45329, the command to run the container would be: +If the database is already set up for SimpleRisk to use it, there is no need to use the `DB_SETUP` variable; you can run the container by just providing the `SIMPLERISK_DB_*` options. For example, if the database is located at `db-server.example.com` on port 45329, the command to run the container would be: ``` docker run -d --name simplerisk -e SIMPLERISK_DB_PASSWORD=pass -e SIMPLERISK_DB_HOSTNAME=db-server.example.com -e SIMPLERISK_DB_PORT=45329 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal ``` @@ -56,7 +58,7 @@ docker run -d --name simplerisk -e SIMPLERISK_DB_PASSWORD=pass -e SIMPLERISK_DB_ | Variable Name | Default Value | Purpose | |:-------------:|:-------------:|:--------| -| `DB_SETUP` | `null` (Accepts any value) | The container will start as if the database has not been set up. The valid options here are `automatic` (in case you want the container to configure the database), `automatic-only` (the same as `automatic`, but stops the container after finishing the setup), `delete` (removes the SimpleRisk database and user from MySQL) or `manual` (allows the user to run the manual setup) | +| `DB_SETUP` | `null` (Accepts any value) | The container will start as if the database has not been set up. The valid options here are `automatic` (in case you want the container to configure the database), `automatic-only` (the same as `automatic`, but stops the container after finishing the setup), `delete` (removes the SimpleRisk database and user from MySQL) or `manual` (allows the user to run the manual installation) | | `DB_SETUP_USER` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. User name of database privileged user to install SimpleRisk schema and other components | | `DB_SETUP_PASS` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. Password for database privileged user to install SimpleRisk schema and other components | | `DB_SETUP_WAIT` | 20 | Used when `DB_SETUP=automatic\|automatic-only`. Time, in seconds, the application is going to wait to set up the database. Useful if you are deploying the database and SimpleRisk at the same time | diff --git a/stack.yml b/simplerisk-minimal/stack.yml similarity index 100% rename from stack.yml rename to simplerisk-minimal/stack.yml diff --git a/update_stack_and_workflows.sh b/simplerisk-minimal/update_stack_and_workflows.sh similarity index 100% rename from update_stack_and_workflows.sh rename to simplerisk-minimal/update_stack_and_workflows.sh