WF is a minimalist and procedural language designed to simplify the automation of common tasks, such as building, installing, or deploying applications.
|
|
11 ヶ月 前 | |
|---|---|---|
| .github | 11 ヶ月 前 | |
| .gitignore | 11 ヶ月 前 | |
| LICENSE | 11 ヶ月 前 | |
| README.md | 11 ヶ月 前 | |
| build.sh | 11 ヶ月 前 | |
| go.mod | 11 ヶ月 前 | |
| go.sum | 11 ヶ月 前 | |
| main.go | 11 ヶ月 前 |
WF is a minimalist and procedural language designed to simplify the automation of common tasks, such as building, installing, or deploying applications.
WF is a minimalist and procedural language designed to simplify the automation of common tasks, such as building, installing, or deploying applications.
The wf binary is a command-line interface that automatically detects .wf files in the current directory. These files are structured into sections, containing sequentially organized commands to execute workflows efficiently and reproducibly.
With WF, you can centralize and standardize your automation processes while maintaining a clear and accessible syntax.
.wf FileA .wf file is organized into sections, each corresponding to a specific step in your workflow. Each section contains a list of commands to execute in a precise order.
[section-name] # Comment: Description of the section
SET VARIABLE=value
run command
.wf File[prepare-env] # Prepare environment variables and system clock
SET SYMFONY_CONSOLE=php bin/console
sync_time
echo "Environment preparation complete"
[install-dependencies] # Install dependencies
run composer install --no-dev --optimize-autoloader
run ${SYMFONY_CONSOLE} doctrine:database:create --if-not-exists
run ${SYMFONY_CONSOLE} doctrine:migrations:migrate --no-interaction
echo "Dependencies installed and database is up to date"
[build-assets] # Build and optimize assets
run npm install
run npm run build
run ${SYMFONY_CONSOLE} assets:install --symlink --relative
echo "Assets built and installed"
[set-permissions] # Set required permissions
set_permissions var/cache 775
set_permissions var/log 775
echo "Permissions set"
[deploy] # Full deployment workflow
wf prepare-env
wf install-dependencies
wf build-assets
wf set-permissions
notify_success "Symfony application deployed successfully"
[prepare-docker] # Prepare Docker environment
SET DOCKER_COMPOSE=docker compose
sync_time
echo "Docker environment prepared"
[build-containers] # Build Docker containers
run ${DOCKER_COMPOSE} build
echo "Docker containers built"
[start-containers] # Start Docker containers
run ${DOCKER_COMPOSE} up -d
echo "Docker containers started"
[cleanup] # Clean up old images
run ${DOCKER_COMPOSE} prune --force
echo "Old Docker images removed"
[deploy] # Full deployment workflow
wf prepare-docker
wf build-containers
wf start-containers
wf cleanup
notify_success "Dockerized application deployed successfully"
prepare-env or set-permissions can be reused in different projects.notify_success or other notifications to indicate the completion or status of deployments.SYMFONY_CONSOLE or DOCKER_COMPOSE simplify command reuse.SET VARIABLE=value: Defines an environment variable to be used in commands.run command: Executes a system command or script.copy src dest: Copies a file or directory.sync_time: Synchronizes the system clock with a time server.set_permissions path mode: Changes the permissions of a file or directory.echo message: Prints a message to the standard output.exit: Immediately terminates the script execution with an exit code of 0.touch file: Creates an empty file unless it already exists.mkdir folder: Creates a directory, including any missing parent directories.docker_compose command: Executes a docker compose or docker-compose command, depending on availability.wf workflow_name: Executes a workflow defined in the .wf file.notify message: Displays a generic notification.notify_success message: Displays a success notification.notify_error message: Displays an error notification.notify_warning message: Displays a warning notification.notify_info message: Displays an informational notification.Scanning .wf Files:
wf scans the current directory and identifies all files with the .wf extension..wf file is read, and all defined sections are collected.Structure of Sections:
.wf file is divided into sections marked by a section header, such as [section-name].Executing a Section:
Once all sections from the .wf files are loaded, you can execute a specific section using the command:
wf section-name
WF will then execute all commands defined in that section.
.wf File[docker-build] # Build Section: Build the application with Docker
SET DOCKER_COMPOSE=docker compose exec -T app-gaia
run ${DOCKER_COMPOSE} ./wf build
[build] # Build Section: Build the application
sync_time
run php -v
SET SYMFONY_CONSOLE=php bin/console
copy .env .env.local
run composer install --optimize-autoloader
run ${SYMFONY_CONSOLE} doctrine:migrations:migrate --no-interaction
When the wf binary is executed, the sections are detected and listed as available commands.
NAME:
wf - A new CLI application
USAGE:
wf [global options] command [command options]
COMMANDS:
build Build Section: Build the application
docker-build Build Section: Build the application with Docker
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
List Available Sections
To display all available sections in the .wf files in the current directory:
wf --help
Execute a Specific Section
To execute a specific section, simply use its name as a command:
wf docker-build
This will execute all commands defined in the [docker-build] section.
.wf files.With wf, you can efficiently automate your build, installation, or deployment tasks by unifying everything in a simple and readable tool.
WF is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
For the full license text, see the LICENSE file.
WF est un langage minimaliste et procédural conçu pour simplifier l'automatisation des tâches courantes, telles que la construction, l'installation ou le déploiement d'applications.
Le binaire wf est une interface en ligne de commande qui détecte automatiquement les fichiers .wf présents dans le répertoire courant. Ces fichiers sont structurés en sections, contenant des commandes organisées de manière séquentielle pour exécuter des workflows de manière efficace et reproductible.
Avec WF, vous pouvez centraliser et standardiser vos processus d'automatisation tout en gardant une syntaxe claire et accessible.
.wfUn fichier .wf est organisé en sections, chacune correspondant à une étape spécifique de votre workflow. Chaque section contient une liste de commandes à exécuter dans un ordre précis.
[section-name] # Commentaire : Description de la section
SET VARIABLE=value
run command
.wf[prepare-env] # Préparation des variables d'environnement et de l'horloge système
SET SYMFONY_CONSOLE=php bin/console
sync_time
echo "Préparation de l'environnement terminée"
[install-dependencies] # Installation des dépendances
run composer install --no-dev --optimize-autoloader
run ${SYMFONY_CONSOLE} doctrine:database:create --if-not-exists
run ${SYMFONY_CONSOLE} doctrine:migrations:migrate --no-interaction
echo "Les dépendances sont installées et la base de données est à jour"
[build-assets] # Construction et optimisation des assets
run npm install
run npm run build
run ${SYMFONY_CONSOLE} assets:install --symlink --relative
echo "Les assets ont été construits et installés"
[set-permissions] # Définition des permissions nécessaires
set_permissions var/cache 775
set_permissions var/log 775
echo "Les permissions ont été configurées"
[deploy] # Workflow complet de déploiement
wf prepare-env
wf install-dependencies
wf build-assets
wf set-permissions
notify_success "Application Symfony déployée avec succès"
[prepare-docker] # Préparation de l'environnement Docker
SET DOCKER_COMPOSE=docker compose
sync_time
echo "Environnement Docker prêt"
[build-containers] # Construction des conteneurs Docker
run ${DOCKER_COMPOSE} build
echo "Les conteneurs Docker ont été construits"
[start-containers] # Démarrage des conteneurs Docker
run ${DOCKER_COMPOSE} up -d
echo "Les conteneurs Docker sont démarrés"
[cleanup] # Nettoyage des anciennes images
run ${DOCKER_COMPOSE} prune --force
echo "Les anciennes images Docker ont été supprimées"
[deploy] # Workflow complet de déploiement
wf prepare-docker
wf build-containers
wf start-containers
wf cleanup
notify_success "Application Dockerisée déployée avec succès"
prepare-env ou set-permissions peuvent être réutilisées dans différents projets.notify_success ou d'autres notifications pour indiquer l'état ou la réussite des déploiements.SYMFONY_CONSOLE ou DOCKER_COMPOSE simplifient la réutilisation des commandes.SET VARIABLE=value : Définit une variable d'environnement utilisée dans les commandes.run command : Exécute une commande système ou un script.copy src dest : Copie un fichier ou répertoire.sync_time : Synchronise l'horloge système avec un serveur de temps.set_permissions path mode : Change les permissions d'un fichier ou répertoire.echo message : Affiche un message sur la sortie standard.exit : Termine immédiatement l'exécution du script avec un code de sortie 0.touch file : Crée un fichier vide, sauf s'il existe déjà.mkdir folder : Crée un répertoire, y compris les parents inexistants.docker_compose command : Exécute une commande docker compose ou docker-compose, selon ce qui est disponible.wf workflow_name : Exécute un workflow défini dans le fichier .wf.notify message : Affiche une notification générique.notify_success message : Affiche une notification de succès.notify_error message : Affiche une notification d'erreur.notify_warning message : Affiche une notification d'avertissement.notify_info message : Affiche une notification d'information.Recherche des Fichiers .wf :
wf scanne le répertoire courant et identifie tous les fichiers avec l'extension .wf..wf est lu, et toutes les sections définies sont collectées.Structure des Sections :
.wf est divisé en sections délimitées par un en-tête de section, comme [section-name].Exécution d'une Section :
Une fois que toutes les sections des fichiers .wf ont été chargées, vous pouvez exécuter une section spécifique en utilisant la commande :
wf section-name
WF exécute alors toutes les commandes définies dans cette section.
.wf[docker-build] # Section Build : Build de l'application avec Docker
SET DOCKER_COMPOSE=docker compose exec -T app-gaia
run ${DOCKER_COMPOSE} ./wf build
[build] # Section Build : Build de l'application
sync_time
run php -v
SET SYMFONY_CONSOLE=php bin/console
copy .env .env.local
run composer install --optimize-autoloader
run ${SYMFONY_CONSOLE} doctrine:migrations:migrate --no-interaction
Lors de l'exécution du binaire wf, les sections sont détectées et listées comme des commandes disponibles.
NAME:
wf - A new cli application
USAGE:
wf [global options] command [command options]
COMMANDS:
build Section Build : Build de l'application
docker-build Section Build : Build de l'application on Docker
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
Lister les Sections Disponibles
Pour afficher toutes les sections disponibles dans les fichiers .wf du répertoire courant :
wf --help
Exécuter une Section
Pour exécuter une section spécifique, utilisez simplement son nom comme commande :
wf docker-build
Cela exécutera toutes les commandes définies dans la section [docker-build].
.wf.Avec wf, vous pouvez automatiser efficacement vos tâches de build, d’installation, ou de déploiement en unifiant tout dans un outil simple et lisible.
WF est distribué sous la GNU Affero General Public License v3.0 (AGPL-3.0).
Pour consulter le texte complet de la licence, veuillez vous référer au fichier LICENSE.