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, click on the package for which you configured a Git connection.

  2. Click on 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

From the drop-down menu, choose a branch from the repository that you want to work on.

View modified files

View the files you changed and that could be staged to Git.

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.
Update database from repository

Update your repository.

Force Update

Activate if you do not want that at least one branch is up-to-date with your current changes, what is however recommended to have a backup version available.

Configure Authentication

View and reconfigure the authentication settings you set up before.

Create remote branch

Create a new branch by selecting the branch source.

View commit log

View remote repository log for 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.

GitHub Workflows

A workflow which aims to automate the build process for the package by installing dependencies and 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.