Configure data exchange with GitHub

In this topic, you learn how to configure a connection from your development package to GitHub.

When artifacts are assigned to a package the artifact data can be pushed to a remote Git repository and subsequently imported to any Neptune DXP server installation. This also enables collaborative development across Neptune DXP server installations.

Prerequisites

Procedure

  1. In Development Package, select the package for which you configured a Git connection.

  2. Select the GIT tab.

    development package git
    This tab only appears if you have configured a connection to GitHub before.
  3. In Settings, configure your GitHub repository:

Settings

Choose a branch/tag

From the drop-down menu, select a branch from the repository that you want to work on. Alternatively, if you have created a tag for a release on GitHub, select the tag to update the database from the release tag.

You can push changes to branches. You cannot, however, push changes to release tags.
View modified files

View the files you changed and that could be staged to Git. Here you can also view the 'diff' between the current (within your system) and GitHub version of any individual artifact, or restore the artifact from the GitHub version:

package git configure viewmodifiedfiles
package git configure diff

If the file is new, you will have the option to delete it:

package git configure viewmodifiedfilesdelete
Commit changes and push to remote repository

Commit and push the staged files to the indicated branch in Git.

Using “Commit changes and push to remote repository” before any artifacts have been added to the package will push template code to the remote repository. When using this button, a dialog will be displayed with all files that can be added to the repository.
When using this feature - Select all files to push, add a commit message, and push to the repository. When the added files have been successfully pushed to the repository the dialog will close and some new information will be displayed. The branch dropdown should now at least contain a branch called “master” and next to the repository URL there should be a label with the SHA (commit tag) the database is synced with.
Only JSON files can be selected, any dependencies are grouped and committed automatically. package git configure grouping
Update database from repository

Update your repository.

Force Update

You should not have to use force update if there are no changes between your database and the last commit the database was synced with. Enabling this setting will overwrite the selected branch with the selected modified files.

Configure Authentication

View and reconfigure the authentication settings you et up before.

Create remote branch

Create a new branch by selecting the branch source.

View commit log

View the remote repository log for the selected branch.

For private repositories and when pushing to a public repository authentication must be added, use “Configure Authentication” to add authentication. When using GitHub authentication tokens can be generated by going to Profile > Settings > Development settings > Personal access tokens > Tokens (classic) when logged in to GitHub. Included in the template code pushed to the repository, as part of the development package, is a GitHub workflow script. When using GitHub make sure you include “workflow” as a scope for the authentication token. If this scope is not added the commit will fail when pushing to GitHub.

Read Me

View and edit the repository’s README file

package.json

View and edit the package.json file of the package. It is used to define various aspects of the package, including its name, version, dependencies, scripts, and more. npm modules used in server scripts that are part of the development package will automatically be added to the dependencies section of the package.json file.

GitHub workflows

A workflow that aims to automate the build process for the package by installing dependencies deploying the artifacts and running tests. The deployment and test steps are optional and can be enabled or disabled by commenting/uncommenting the respective lines in the workflow file. By default, this workflow is triggered whenever there is a push event to the repository.

Deploy/Deploy test

These scripts manage the deployment of a software package and run tests to ensure the server’s health after deployment.

Results

  • You have set up a connection to a remote Git repository on GitHub and can work with it.