0% found this document useful (0 votes)
24 views6 pages

Gitlab Presentation

The document outlines the steps to move code from a local environment to a GitLab repository, including initializing Git, adding files, and pushing code. It also details enabling Static Application Security Testing (SAST) in GitLab CI/CD, creating a simple HTML file, and verifying the pipeline status. Additionally, it covers configuring ManageEngine API settings and webhooks for GitLab notifications.

Uploaded by

Kumar Abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views6 pages

Gitlab Presentation

The document outlines the steps to move code from a local environment to a GitLab repository, including initializing Git, adding files, and pushing code. It also details enabling Static Application Security Testing (SAST) in GitLab CI/CD, creating a simple HTML file, and verifying the pipeline status. Additionally, it covers configuring ManageEngine API settings and webhooks for GitLab notifications.

Uploaded by

Kumar Abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

- Move the code from local to Gitlab

repo

- Navigate to your project folder:’ -cd


path\to\your\project

- Initialize Git in Your Project (if not


already) – git init

- Add your files - git add .

- git commit -m "Initial commit”

- Go to your GitLab project → Click


Clone → Copy the HTTPS or SSH
URL.

- Using HTTPS: - git remote add


origin
https://gitlab.com/your-username/y
our-repo.git
Move the code to Gitlab repo from local
- Generate and Add SSH Key (for easier
pushes)

- ssh-keygen -t ed25519 -C
your-email@example.com

- Then copy the contents of your public


key file (~/.ssh/id_ed25519.pub) and
add it to GitLab under:
User Settings → SSH Keys

- Once the Key has been added the n


try to push the code to Gitlab repo by
following commands

- Git add

- Git commit -m “first commit”

- Git push

Move the code to Gitlab repo from local


- Enable SAST in .gitlab-ci.yml
- Yaml file
- Create or modify the .gitlab-ci.yml
file - stages:
- - test
- Save this as .gitlab-ci.yml in the
root of your project. - include:
- - template:
- git add .gitlab-ci.yml Security/SAST.gitlab-ci.yml

- git commit -m "Enable SAST via


GitLab CI"

- git push origin main

- Go to CI/CD > Pipelines in GitLab to


monitor the job.
View results under Security &
Compliance > Vulnerability Report.

Enable the SAST (Static Application


Security Testing)
- Step 1: Create a Simple HTML File
- <!DOCTYPE html> <html
- Create an index.html file with basic lang="en"> <head> <meta
content: charset="UTF-8"> <meta
name="viewport"
- Step 2: Initialize a Git Repository - content="width=device-
git init , git add index.html ,git commit - width, initial-scale=1.0">
m "Initial commit with index.html” <title>My Simple Web
Page</title> </head>
- Step 3: Create the .gitlab- <body> <h1>Hello, GitLab
ci.yml File CI/CD!</h1> <p>This is a
simple HTML page to
- Explanation of the .gitlab- demonstrate CI/CD.</p>
ci.yml File </body> </html>

1.stages: Defines the stages of the


pipeline, which include build and deploy.
2.build: This job runs in the build stage,
creates an output directory, and
copies index.html into it.
3.deploy: This job runs in
Basic CI/CD workflow
the deploy stage after the build is
complete. It copies the HTML file to a
- Push Your Code to GitLab

git remote add origin


<your_gitlab_repository_url> git push -u
origin master

- Verify the Pipeline

Once you push your code to GitLab:

1.Navigate to GitLab: Open your


repository in GitLab.

2.Go to CI/CD: Click on the CI/CD tab to


see your pipeline.

3.Check Pipeline Status: You should see


your pipeline running. Once it completes,
you can view the logs for each job and see
if it succeeded.

Push the code to Gitlab repo


1. Check ManageEngine API 3: Configure Event Triggers
Settings:
Make sure you have events configured in
1. Ensure that ManageEngine is set up GitLab that will trigger notifications to
to accept incoming API requests and ManageEngine. These could include
to trigger notifications appropriately actions like:
based on the events received. •Push events
•Merge requests
2. Verify GitLab Webhooks or •Issues created or updated
Integration:
4. Create a Test Notification
1. In your GitLab project, navigate 1.Test via GitLab:
to Settings > Integrations (or We 1. Make a change in your GitLab
bhooks if you are using GitHub- repository, such as pushing a
style webhooks). new commit or creating an
issue/merge request.
2. Ensure that there are webhook URLs 2. Monitor the action to see if it
configured that point to triggers a notification sent to
ManageEngine. The URL should be ManageEngine.
correctly set to receive notifications.

GitLab Notifications with ManageEngine

You might also like