Prometheus access in Gitlab SaaS - gitlab

Is it possible to access metrics created in a Gitlab CI pipeline (artifact: reports: metrics:)? They show up in the Merge request metrics report but I would like to use them from outside gitlab with Grafana.

Related

Automatically approving the pipelines which are waiting for manual approval in Azure DevOps(Azure DevOps REST API)

I am using Azure DevOps to implement CI/CD for one of the project.
I have implemented manual approval in the production deployment job/pipelines.
There were 22 pipelines so interested in approving all the pipelines.
I made progress on this ..the below script(Powershell) display the pipelines and builds information.
But I am unable to achieve the end goal.

Synapse pipeline import resource from git

I have a situation here where I import resources from my Azure DevOps Git repository DEV to TEST, I want DEV code to be independent of TEST and not commit my changes back to the repository.
After I import the repository to TEST I made changes to the SQL database connection string in the copy activity source and sink in TEST and had to commit the changes for the debug to run and the triggers I have setup for the pipelines don't run in TEST as per the schedule and fail in DEV because of the changes I did in TEST.
When move the pipelines and underlying objects to different environments, How do I make all the environments independent once I import repository? Is there a way to copy from the repository to the Synapse live mode to accomplish this?
OR How would I automate deployment of Synapse pipelines? Is it using ARM or Bicep Template?
You'll want to follow Microsoft's guide on CI/CD with Synapse. This is a great walkthrough video for the process.
The flow is:
Work in your development environment and commit to your collaboration branch.
A pipeline triggers off of your workspace_publish branch, releasing your code to your next environment (preferably with an approval gate)
Continue releasing the same code to higher environments, again with approval gates.
For Azure DevOps, you can use variable groups to parameterize your pipeline. Also make sure to read through the custom parameters section on that link to parameterize parts of the template that are not parameterized by default.

Azure Data Factory Environment Set up

I am setting up an environment for ADF. I have multiple projects and Segments which I need to support. I have noticed that I can only set up one publish branch in ADF.
Should we create ADF for each project?
What is the recommended approach for setting up an environment ?.
Multiple ADFs are required if there is complete different project with different data. If you want to work in same project and just need to manage different environment like development, testing and prod; all this can be managed in one ADF.
A developer creates a feature branch to make a change. They debug their pipeline runs with their most recent changes. For more information on how to debug a pipeline run, see Iterative development and debugging with Azure Data Factory.
After a developer is satisfied with their changes, they create a pull request from their feature branch to the main or collaboration branch to get their changes reviewed by peers.
After a pull request is approved and changes are merged in the main branch, the changes get published to the development factory.
When the team is ready to deploy the changes to a test or UAT (User Acceptance Testing) factory, the team goes to their Azure Pipelines release and deploys the desired version of the development factory to UAT. This deployment takes place as part of an Azure Pipelines task and uses Resource Manager template parameters to apply the appropriate configuration.
After the changes have been verified in the test factory, deploy to the production factory by using the next task of the pipelines release.
Note
Note: Only the development factory is associated with a git repository. The test and production factories shouldn't have a git repository associated with them and should only be updated via an Azure DevOps pipeline or via a Resource Management template.

Is it possible to send POST file to GitLab pipeline job artifact?

I have a pipeline running externally and send the status of the pipeline back to GitLab through GitLab API. I am wondering if it is also possible to send the pipeline logs and store them in the job artifact of GitLab. From what I understand, the artifact seems to be created only via internal (gitlab-ci.yml) and documentation here does not state any option to create POST to the job artifact as well.

Manual approval in GitLab CI deployment pipeline

we've got a GitLab CI build / test / deployment pipeline and need to insert a manual approval between deployment to Test and promoting to Prod. I can't figure out how to do that.
Ideally we would like to have a button like in GoCD or in AWS CodePipeline. However for our current project we use GitLab EE (ver 12.3.5-ee) hosted on our servers, not using gitlab.com, but I guess the .gitlab-ci.yml should be the same.
This is a part of my current .gitlab-ci.yml:
stages:
# lint, build, test, ...
- deploy_test
- approval
- deploy_prod
deploy_test:
stage: deploy_test
only:
refs:
- prod
script:
...
wait_for_approval:
stage: approval
# how do I do this???
deploy_prod:
stage: deploy_prod
only:
refs:
- prod
script:
...
Any idea?
Use when: manual in your stage.
To be sure the manual action is blocking (and no optionnal), add also allow_failure: false (is set to true by default)
More info in the documentation
Note : if you created the stage only for the approval, I could advice you to remove it and put the when: manual in the deploy_prod stage.
deally we would like to have a button like in GoCD or in AWS CodePipeline
In addition, of when:manual, you also have GitLab 14.9 (March 2022), which comes with (still for GitLab Premium/Ultimate only):
Deployment Approval on the Environments page
We are excited to introduce the Deployment Approval capability in the GitLab interface. In GitLab 14.8, we introduced the ability to approve deployments via the API.
Now, deployment approvers can view a pending deployment and approve or reject it conveniently directly in the Environments page. This update continues our work to enable teams to create workflows for approving software to go to production or other protected environments.
With this update, we are now upgrading the feature to beta.
See Documentation and Issue.
And GitLab 14.10 (April 2022) comes with:
Multiple approval rules for deployment approvals API
Previously, deployment approvals supported a simple model where the ability to execute a deployment and approve a deployment were both controlled with a single list of users.
With this update, you have more flexibility and granularity with these rules and can specify multiple levels of control using the API.
One type of model that can now be supported is where there is separation of duties between deployment executors and approvers in your organization.
Another supported model is where approval is needed separately from multiple levels, such as a QA tester group and a security group.
See Documentation and Issue.
You can combine that with GitLab 15.2 (July 2022) which adds (non-CE editions only):
Group-level UI for protected environment settings
Previously, if you wanted to configure group-level settings for protected environments, you had to use the API.
With this release, you can now view and edit these settings in the UI.
This change allows you to more easily set policies for which users and groups can deploy to environments across projects within a group.
See Documentation and Issue.

Resources