APIIDA API Gateway Manager
Work with git
The Version Control Tab of an API allows you to interact with an existing version control system (currently supported: GitLab, GitHub & Nexus). This feature is intended to be used by developers to work on an API and to push its current version to the repository from a node (a gateway which is managed by the Gateway Manager). It is also possible to add a tag to the commit. This allows the user to specify a tag later during a migration. If a developer needs to work on the current version of a branch, this can also be pulled from the repository to a node.
Basic Requirements:
Company Git repository
Authentication with SSH keys to the Git repository
Direct communication between APIIDA API Gateway Manager and the Git repository
User Requirements:
User can create new Git repositories
User can add a SSH key to the Git repository
Connect with git
To establish git as the single point of truth we must first generate an SSH key and assign it to an existing e.g. technical user. You need the “Administrator” role to be granted access to this menu.
Generate an SSH key in Configuration > git Credentials
Add the SSH key to your git. In this case gitLab
That's it!
Create a repository
The creation of a repository in your chosen version control system is out-of-scope of this documentation. There is no special configuration needed during the setup. However, the repository should have an active branch (default: master branch) where files can be pushed to and pulled from.
Connect an API with git
The prerequisite is that you have already imported APIs from a node and they are also registered in AAGM.
In this case, we want to bring all APIs in demo on git.
Select Demo in APIs
Go to the git version control tab and enter the URL (git@..) of the repository where you want to manage the APIs, also select the credentials you created earlier and save everything.
If everything worked, a few buttons should appear.
If the repository is not accessible, please make sure that the user you assigned the SSH key to has access to the repository.
Export/Push an Api from node and push to git
If you press this button you can select the node from which the APIs should be copied to git and create a branch at the same time.
You pushed a few APIs to git!
The structure you can see in this repository is the https://apiida.atlassian.net/wiki/spaces/AAGM/pages/7654539269
Pull from git and import into node
You can pull the API from the configured Git repository to the selected "Dev Node" by simply click on “Pull from git to dev node”
Finished developing and testing? Let's build a release!
With "Push and Tag" we can create a tag and specify a version with it.
Please use the Git rules for tag naming, like don't use space or control characters in the tag name.
Git connected. Release done. What now? A migration!
Since we have successfully integrated git, we can now migrate our APIs directly from there to our test environment.
Let's stay in Demo. APIs > Demo >Migrations > Perform Migration
Select git as the source, either a branch or the previously created release tag 1.0 and the target.
Congratulations! You have successfully completed our recommended path of migrating an API.
But my API needs for example a cluster propery. What now? Libraries!
Create a library in Resources > Select a Node > Choose e.g. a cluster property > Create Library
Add the URL (git@...) of the repository to push the library to git.
You have created a library.
Let's link the API with its library
Go to APIs > Demo > Requirements
Add your library!
When migrating demo, no matter from where, the library is now added automatically.
Libr