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
-
You have created a new development package or imported a development package from Git.
-
To work together on a development package some prior knowledge of Git is required.
Procedure
-
In Development Package, select the package for which you configured a Git connection.
-
Select the GIT tab.
This tab only appears if you have configured a connection to GitHub before. -
In Settings, configure your GitHub repository:
Settings
- Choose a branch
-
From the drop-down menu, select 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. 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:
If the file is new, you will have the option to delete it:
- 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. - 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.
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 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.