-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dummy scripts to test integration in other projects
- Loading branch information
Showing
9 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Deploy GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
# fuzzy-guide | ||
scripts to help deployment of symfony projects usually within docker ecosystem | ||
# Fuzzy Guide | ||
|
||
This repository provides a Symfony bundle to copy scripts to the project root. It also includes documentation for each script. | ||
|
||
## Installation | ||
|
||
To install the bundle, add the following to your `composer.json`: | ||
|
||
```json | ||
{ | ||
"require": { | ||
"houseofagile/fuzzy-guide": "dev-main" | ||
}, | ||
"extra": { | ||
"symfony-root-dir": "." | ||
} | ||
} | ||
``` | ||
|
||
Then run `composer install` or `composer update`. | ||
|
||
## Documentation | ||
|
||
The documentation for each script can be found on the [GitHub Pages site](https://houseofagile.github.io/fuzzy-guide/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "houseofagile/fuzzy-guide", | ||
"description": "A Symfony bundle to copy usefull scripts to the project root, to help with deployment, typically with docker.", | ||
"type": "library", | ||
"require": { | ||
"composer-plugin-api": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"HouseOfAgile\\FuzzyGuide\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"symfony-root-dir": ".", | ||
"script-target-dir": "scripts" | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"HouseOfAgile\\FuzzyGuide\\Composer\\ScriptHandler::copyScripts" | ||
], | ||
"post-update-cmd": [ | ||
"HouseOfAgile\\FuzzyGuide\\Composer\\ScriptHandler::copyScripts" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# instance_config | ||
|
||
This script set proper rights for user in symfony projects | ||
|
||
## Usage | ||
|
||
```bash | ||
./instance_config.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Another script | ||
|
||
This script prints "This is another script" to the console. | ||
|
||
## Usage | ||
|
||
```bash | ||
./other_script.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Fuzzy Guide | ||
|
||
Welcome to the Fuzzy Guide documentation. | ||
|
||
## Scripts | ||
|
||
- [Script 1](docs/script1.md) | ||
- [Script 2](docs/script2.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace HouseOfAgile\FuzzyGuide\Composer; | ||
|
||
use Composer\Script\Event; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
class ScriptHandler | ||
{ | ||
public static function copyScripts(Event $event) | ||
{ | ||
$extra = $event->getComposer()->getPackage()->getExtra(); | ||
$rootDir = isset($extra['symfony-root-dir']) ? $extra['symfony-root-dir'] : '.'; | ||
|
||
// Read the configuration from the Symfony config file | ||
$configFile = $rootDir . '/config/packages/fuzzy_guide.yaml'; | ||
if (file_exists($configFile)) { | ||
$config = Yaml::parseFile($configFile); | ||
$scriptTargetDir = $config['fuzzy_guide']['script_target_dir']; | ||
} else { | ||
$scriptTargetDir = isset($extra['script-target-dir']) ? $extra['script-target-dir'] : 'scripts'; | ||
} | ||
|
||
$sourceDir = __DIR__ . '/../../scripts'; | ||
$targetDir = $scriptTargetDir; | ||
|
||
if (!is_dir($targetDir)) { | ||
mkdir($targetDir, 0755, true); | ||
} | ||
|
||
foreach (glob($sourceDir . '/*') as $file) { | ||
$fileName = basename($file); | ||
copy($file, $targetDir . '/' . $fileName); | ||
} | ||
|
||
$event->getIO()->write('<info>Scripts copied to ' . $targetDir . '</info>'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
THIS_USER=`whoami` | ||
sudo chown -R ${THIS_USER}.nginx /app/ | ||
sudo chown -R ${THIS_USER}.nginx /app/var /app/public | ||
mkdir -p /app/public/uploads | ||
sudo chmod -R 775 /app/var /app/public /app/translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo "This is another script" |