Skip to content
Snippets Groups Projects
Select Git revision
  • ca2415a05a1918fb177b5dc0c4ee5c1d1555d971
  • master default protected
  • feat/npm-publish
  • feat/demo-deploy
  • change-demo-deploy
  • remove-smoke
  • feat/acceptance-tests
  • feature/deploy-composer.json
  • feature/mysql-bin-logs
  • skip-codecept-for-libs
  • include-composer-json
  • exclude-wp-assets
  • update_codecept_image
  • fix/silenced-copy
  • remove-free-translations
  • codeception-with-optional-step
  • improve-parallelization
  • linter-exit
  • change-images
  • fix/linter
  • globally-raise-mem-limit
  • no-symlink2
22 results

gitlab-ci-1.2.yml

Blame
    • Bartek Jaskulski's avatar
      d89dae89
      feat: add npm registry configuration · d89dae89
      Bartek Jaskulski authored
      This commit introduces a new npm registry configuration file and updates the prepare script to support npm package publishing.
      
      The new `includes/nodejs/registry.yml` file defines variables and a job for publishing npm packages to the GitLab package registry. It allows specifying the npm registry scope and configures the `.npmrc` file with the necessary authentication token.
      
      The `includes/prepare.yml` file is updated to configure the npm registry for both `octolize` and `wpdesk` scopes, ensuring that npm packages can be properly installed and published
      Verified
      d89dae89
      History
      feat: add npm registry configuration
      Bartek Jaskulski authored
      This commit introduces a new npm registry configuration file and updates the prepare script to support npm package publishing.
      
      The new `includes/nodejs/registry.yml` file defines variables and a job for publishing npm packages to the GitLab package registry. It allows specifying the npm registry scope and configures the `.npmrc` file with the necessary authentication token.
      
      The `includes/prepare.yml` file is updated to configure the npm registry for both `octolize` and `wpdesk` scopes, ensuring that npm packages can be properly installed and published
    wpinit 1.54 KiB
    #!/usr/bin/env php
    <?php
    
    use WPDesk\Init\Util\PhpFileDumper;
    use WPDesk\Init\Plugin\DefaultHeaderParser;
    
    $autoloadPath = $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
    if (!file_exists($autoloadPath)) {
        echo "\033[31mError: Autoloader not found. Please run composer install.\033[0m\n";
        exit(1);
    }
    require_once $autoloadPath;
    
    function displayHelp() {
        echo "Usage: " . basename(__FILE__) . " <plugin_file> <cache_dir>\n";
        echo "Initialize a WordPress plugin by parsing the input file and generating output.\n";
        echo "\n";
        echo "Arguments:\n";
        echo "  <plugin_file> Path to the input file to parse\n";
        echo "  <cache_dir>   Path to the output file to generate\n";
    }
    
    if (in_array('--help', $argv) || in_array('-h', $argv)) {
        displayHelp();
        exit(0);
    }
    
    if ($argc < 3 || in_array('--help', $argv) || in_array('-h', $argv)) {
        echo "\033[31mError: Missing required arguments.\033[0m\n";
    	displayHelp();
        exit(1);
    }
    
    $inputFile = $argv[1];
    $outputDir = rtrim($argv[2], '/\\') . '/';
    
    // Check if input file exists
    if (!file_exists($inputFile)) {
        echo "\033[31mError: Input file '$inputFile' does not exist.\033[0m\n";
        exit(1);
    }
    
    try {
        $parser = new DefaultHeaderParser();
        $data = $parser->parse($inputFile);
    
        $dumper = new PhpFileDumper();
        $dumper->dump($data, $outputDir . 'plugin.php');
    
        echo "\033[32mSuccess: Plugin data generated.\033[0m\n";
        exit(0);
    } catch (Exception $e) {
        echo "\033[31mError: " . $e->getMessage() . "\n" . $e->getTraceAsString() . "\033[0m\n";
        exit(1);
    }