Skip to content

Git pull requests and Maven deployment

CogComp Dev edited this page Jul 24, 2018 · 4 revisions

As the group becomes more familiar with Git and since we have a list of project owners, we ask that instead of pushing directly to the master branch of the project you are working on, you do the following:

  • create a new branch
  • push your changes there
  • create a merge request
  • assign it to the project’s (co-)owner

The project’s (co-)owner that was assigned the merge request has to:

  • review the code
  • download the changes and run the project’s unit tests

If everything looks ok, do the following:

  • accept the merge request
  • deploy the project on Maven:
    • mvn deploy site-deploy
    • ssh legolas
    • cd /srv/data/cogcomp/html/m2repo/edu/illinois/cs/cogcomp
    • chmod -R 775 PROJECT-ID/PROJECT-VERSION
    • chgrp -R cs_danr PROJECT-ID/PROJECT-VERSION

Quick deploy:

Follow the steps:

  1. Increment the version: ./increment-pom-versions.sh. This would update the CogCompNLP versions within all the pom.xml files in all the modules.
  2. Deploy the changes: mvn deploy -Dmaven.test.skip=true. This would compile the code, and would skip the tests for speed (assuming that you have already tested your code, and would deploy (i.e. package and upload) the artifacts to the maven repo (http://cogcomp.org/m2repo/edu/illinois/cs/cogcomp/).
  3. Commit the version-change to the main repo:
git add pom.xml
git add */pom.xml
git add */*/pom.xml
git commit -m 'manual version increment'
git push upstream master

Using the deployment script deploy-artifacts.sh:

Make sure you have the following two:

  • ssh public key on the server legolas: for the script to set the permissions.
  • settings.xml file for maven, in your .m2 folder, containing your username and password to our maven repository (bilbo). Here is a sample for this file:
<settings>
  <servers>
    <server>
      <id>CogcompSoftware</id>
      <username>my_netid</username>
      <password>my_pass_word</password>
      <privateKey>~/khashab2/.ssh/my_private_key</privateKey>
      <passphrase></passphrase>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
      <configuration></configuration>
    </server>
    <server>
      <id>CogcompSoftwareDoc</id>
      <username>my_netid</username>
      <password>my_pass_word</password>
      <privateKey>~/khashab2/.ssh/my_private_key</privateKey>
      <passphrase></passphrase>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
      <configuration></configuration>
    </server>
  </servers>

</settings>