- 
                Notifications
    
You must be signed in to change notification settings  - Fork 14
 
Document first steps and how to setup github actions with Conductor #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 2 commits
      Commits
    
    
            Show all changes
          
          
            8 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      134f9dc
              
                Document first steps and how to setup github actions with Conductor
              
              
                pscheit f0707ea
              
                Optimised images with calibre/image-actions
              
              
                github-actions[bot] 6ee3a63
              
                add all the PR feedback
              
              
                pscheit 6c9c6a2
              
                pixelate authentication token
              
              
                pscheit c016f9e
              
                all suggestions from code review
              
              
                pscheit 7e9f90d
              
                Optimised images with calibre/image-actions
              
              
                github-actions[bot] 2247f81
              
                add other half of feedback
              
              
                pscheit 665ca04
              
                Update docs/conductor/getting-started.md
              
              
                pscheit File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or 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,88 @@ | ||
| # Getting started with Conductor | ||
| ## | ||
| 
     | 
||
| Conductor will group and schedule automated Dependency Updates on your own Continuous Integration Platform. If the update succeeds, Conductor sends you a pull request to your code hosting platform (GitHub, GitLab, Bitbucket) with the changed composer.lock file and, if necessary, other files modified by Composer plugins or scripts. | ||
| 
     | 
||
| To use Conductor: | ||
| 
     | 
||
| - [subscribe to the waitlist](http://packagist.com.lo/features/conductor) | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| - subscribe to a Private Packagist Subscription (either Cloud or Self-Hosted) | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| - get access to Conductor from [Private Packagist Support](mailto:[email protected]) | ||
| - add a workflow to your Continuous Integration Platform to run Composer updates | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| - verify the setup | ||
| 
     | 
||
| 
     | 
||
| ## First steps | ||
| 
     | 
||
| Once you have a Private Packagist Subscription and Conductor is enabled for your subscription, log into your Private Packagist organization and click on the Updates tab in the main navigation. | ||
| Conductor will list all Packages with a composer.lock file and the Private Packagist repository added to the composer.json. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| If you do not see your package, follow the instructions on your organization page to add the custom repository to the composer.json of your package. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| Most convenient way to set up Conductor is to configure your CI in the Private Packagist UI. The manual steps are outlined below: | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| ## Create a workflow on your CI | ||
| 
     | 
||
| ### GitHub Actions | ||
| 
     | 
||
| Create a new GitHub Actions workflow in `.github/workflows/dependency-update.yaml` of your package repository using the template below: | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| CONDUCTOR_GITHUB_ACTIONS_WORKFLOW | ||
| 
     | 
||
| - adjust the PHP Version used in the "Install PHP" step | ||
| - commit and push the workflow to your main branch of your package repository | ||
| - review the commit and push method: the workflow needs to be able to push commits to a new branch | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| Create a secret `COMPOSER_AUTH` with the Composer authentication configuration [as described here](https://getcomposer.org/doc/articles/authentication-for-private-packages.md#authentication-using-the-composer-auth-environment-variable) to access Private Packagist. | ||
| We recommend to create a dedicated authentication token with update access. You can copy n paste the contents for the secret from the Private Packagist UI while creating the token in "Settings" -> "Authentication Tokens". Remove the single quotes around the value. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
|  | ||
| 
     | 
||
| The contents of the variable should look like | ||
| 
     | 
||
| ```json | ||
| {"http-basic": {"repo.packagist.com": {"username": "token", "password": "packagist_out_73a81c7eb525b13b6bc22a410b2146e78a38b324f609bf1158c583c704f64cbdd349" }}} | ||
| ``` | ||
                
      
                  pscheit marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| Conductor needs to verify your setup before you can [start receiving Pull Requests](#how-scheduling-works). | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| ## How scheduling works | ||
| 
     | 
||
| - Go to your package on the updates tab in your Private Packagist organization | ||
| - Click on the name of your package | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| The list shows groups of all available updates to be scheduled. Each group of updates is called a task. Conductor will schedule only one task at a time. All others are waiting for the task on top of the list to be successful or paused. | ||
| Once Conductor schedules a task it sends a payload to your CI Platform that triggers the workflow you just added. The payload contains the commands Composer will run to update a group of dependencies from your package. | ||
| 
     | 
||
| The workflow consists of several steps: | ||
| 
     | 
||
| - code checkout | ||
| - php setup | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| - Composer install | ||
| - run Composer update commands from the payload | ||
| - commit changed files (composer.lock, ...) | ||
| - push commit to a new branch | ||
| - Send the status of the workflow to Private Packagist via curl | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| If the update succeeded, Private Packagist creates a pull request for the just pushed commit. The PR description will contain a reviewable list of all dependencies and parts of their changelogs. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| When you reviewed the changes and merged the PR, Conductor schedules the next task. | ||
| If you close the PR, the task will be paused and Conductor schedules the next task. This is the same effect as using the "Pause" button in the UI. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| If you want to, you can schedule any other task of the list, by clicking on it's name and using the button "Schedule now to create a PR". | ||
| 
     | 
||
| Tasks fixing security issues have a higher priority. They will be moved to the top of the list and scheduled right away. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| ## Verify your CI setup | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
|  | ||
| 
     | 
||
| Right now all tasks are waiting for the CI verification task on top of the list. Conductor will not start with the regular schedule until this verification task was successful. | ||
| The verification task will only execute `composer update nothing` and will not result in a PR to be sent to your Code Hosting Platform. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| - Click on the task "Verify the continuous integration setup" | ||
| - Use the "Schedule now" button to test your setup | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| You can see the state of your task and last events for the task. Once the task is executed, atch your CI Platform: | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| You should see a run for the just added workflow. Examine the run if it succeeded. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| When you ran into errors, troubleshoot and fix. You can trigger the workflow again by restarting the task. The restart button is available after the first execution. | ||
                
      
                  pscheit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| Once the task is successful Conductor will trigger your workflow with the next task in the list. This time it will send a PR. | ||
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.