Skip to content

MBN CI/CD

Access

We are now using github login. So you should be able to see jobs/tasks in Jenkins using your gitHub username.

If you need admin access let Edu or Mariana know so we can add you to the Admin List.

We are Using Jenkins in order to automate the following tasks:

  1. PR Builds (using the Jenkinsfile.testing pipeline). This runs on the Jenkins “Master” agent.

    • Everytime we open a new PR, that PR code would be checked (make code-test) and built.
  2. develop branch build (using the Jenkinsfile.testing pipeline). This runs on the Jenkins “Master” agent.

    • Everytime that a PR is merged into develop branch, Jenkins will build that branch.
  3. Acquia Dev env deployments. This runs on the SSH Agent “Daily” node.

    • Jenkins will build develop > Create a tag > Deploy that tag > ‘checkout’ the tag for Dev env. So this will cover all the deployment tasks we were manually doing. We haven’t defined a time yet, but we think it could run everyday at… 7am. So we will always have a “fresh” Dev env.

Nice to have tasks

Jenkins can be easily integrated with Jira, so a nice thing would be to configure the Jira integration in a way that makes sense for us. Jenkins is already integrated with github, so we could make use of that to properly “label” PRs

For example:

  • We could start using “releases” on Jira so Jenkins can properly tag all the tickets included in a deployment, with the release tag.

  • We could use github integration to properly label PRs once they get merged (not sure if doable actually, but would be great :P )

Server Details

Stumped into some odd bugs in the road 🐛 🐞 🐜 🦠

  1. git Acquia repo requires git username/email

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    *** Please tell me who you are.
    
    Run
    
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"
    
    to set your account's default identity.
    Omit --global to set the identity only in this repository.
    
    fatal: empty ident name (for <(null)>) not allowed
    [ExecStack]  Exit code 128 
    [error]  Could not initialize new git repository. 
    
    Apparently the’ve fixed this in blt version 10.x: https://github.com/acquia/blt/pull/3541

    As a workaround (since updating the blt version could very likely cause other issues I wanted to avoid) I’ve added a git config user.name and user.email in the agent Dockerfile… 😇

  2. git acquia repo key not found/trusted

    In order to workaround this issue I had to run the blt artifact:deploy command manually from the jenkins agent repo and accept the connection:

    1
    2
    3
    4
    The authenticity of host 'svn-2398.enterprise-g1.hosting.acquia.com (54.208.34.237)' can't be established.
    RSA key fingerprint is SHA256:bV2a1i24wN1fKHPklmexouKYRnnp/TZtzV24Wd+fpoQ.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'svn-2398.enterprise-g1.hosting.acquia.com,54.208.34.237' (RSA) to the list of known hosts.
    
    Thanks so much Acquia! ✨ ❤

    To fix this I’ve added the dev server host to the /home/jenkins/.ssh/known_hosts

  3. On composer install run by the vendor/bin/blt artifact:deploy command (which is using robo)

    1
    2
    3
    4
    Generating optimized autoload files
    In AutoloadGenerator.php line 1054:
    
      fopen(/usr/share/php/Composer/Autoload/../../../doc/composer/copyright): failed to open stream: No such file or directory