Deploying using GitLab CI/CD
This guide explains how to set up a GitLab CI/CD pipeline that automatically triggers a deployment to seenode whenever a commit is pushed to a specified branch.
Prerequisites
A GitLab repository where you want to set up the CI/CD pipeline.
A seenode application with an API endpoint for deployments.
A JWT authentication token for the seenode API.
Permissions to create GitLab CI/CD variables and modify
.gitlab-ci.yml
.
Step 1: Store sensitive data in GitLab CI/CD variables
To keep your credentials secure, store them as GitLab CI/CD variables:
Go to your GitLab repository.
Navigate to Settings → CI/CD → Variables.
Click Add Variable and add the following variables:
SEENODE_APPLICATION_ID
→ Your seenode application ID.SEENODE_JWT_TOKEN
→ Your JWT authentication token.
Find application ID in the browser URL: https://cloud.seenode.com/dashboard/applications?applicationId=969217#logs) ⇒ application ID is 969217
Step 2: Create the GitLab CI/CD Pipeline
In the root of your repository, create or edit the
.gitlab-ci.yml
file.Add the following content:
Step 3: Commit and Push the Pipeline Configuration
Save the
.gitlab-ci.yml
file.Commit and push it to your repository:
(Replace
main
with your branch name if different.)
Step 4: Verify the Pipeline Execution
Go to your GitLab repository.
Click on CI/CD → Pipelines.
Locate the latest pipeline run and verify that it executed successfully.
If there is an issue, click on the failed job to check the logs for debugging.
Troubleshooting
Pipeline is not triggering?
Ensure you are pushing to the correct branch (
main
by default in the pipeline).Check if CI/CD is enabled in your repository settings.
Authentication error?
Verify that the JWT token is correct and not expired.
Ensure that
SEENODE_JWT_TOKEN
is set as a GitLab CI/CD Variable.
Incorrect API endpoint?
Double-check the application ID and the API URL format.
Conclusion
You have now successfully set up a GitLab CI/CD pipeline to automatically deploy to seenode when changes are pushed to the repository. This automation ensures that your deployments stay consistent and efficient.
Last updated