I want to create a trigger like this, when a specific branch pattern is created in codecommit it must invoke codebuild project , eg : prod/myapp-{version} (We will create release branch like this always, like prod/myapp-V1.2 , This was easy in jenkins as it has branch filter regex like '/prod/' and it will checkout latest branch starting with prod/myapp-{version} and start build) , the same way I need to implement in codecommit + codebuild. How can I do that ? Am not seeing the option for branch pattern in codebuild , only static branch name (like master, or tagname) .So it will checkout only the static branch(eg: master) . What I want is how I can pass branch pattern to codebuild as ${Version} is always dynamic . I am new to AWS devops. Any help will be appreciated
Thanks
Related
I have projects in many git repositories, starting with the base api and then branching outwards.
When the API materially changes, I want to verify that downstream projects (that use the particular API) work correctly.
I hoped this workflow would be supported out of the box:
Make changes on branch to base API
Create same named branch on a subset of projects that may be affected by the change
Execute the build triggering children with
run-A:
stage: .post
trigger:
project: a
branch: $CI_COMMIT_BRANCH
strategy: depend
run-B:
...
Sometimes I want to verify A, sometimes B, sometimes both or neither.
If I don't have the same branch in A and B, I start getting
Downstream pipeline cannot be created; reference cannot be found
How can I get gitlab to depend on the results of other project builds, but ignore the downstream project if the branch doesn't exist?
I need to automatically create multiple branches on a Bitbucket repo when a developer creates a branch from a Jira Issue.
The branching pattern is this:
feature/SAx
feature/SAx-FE
feature/SAx-BE
So I would need to automatically create the feature/SAx branch and then split this new branch into the FE and BE branches.
How can I do this?
Thanks!
I am trying to automate a process in Azure DevOps, using the REST API. I think it should go like this (at least, this is the current manual process):
fork repo
create pipeline(s) based using YAML files in newly forked repo
run pipelines in particular way
I am new to the Azure DevOps REST API and I am struggling to understand what I have done and what I should be doing.
Using the REST API, I seem to be able to create what I would call a pipeline, using the pipeline endpoint; I do notice that if I want to run it, I have to interact with its build definition instead.
Also, looking at code other colleagues have written, it seems (though I may be wrong) like they are able to achieve the same by simply creating a build definition, and not explicitly creating pipeline.
This lack of understanding is driving me bonkers so I am hoping someone can enlighten me!
Question
What is the difference, and relationship, between a Build Definition and a Pipeline?
Additional info, I am not interested in working with the older Release Pipelines and I have tried to find the answer among the Azure DevOps REST API docs, but to no avail.
If you want to create a pipeline you can do this using both of this. However, the difference is actually in terms of concept:
build definitions are part of first available flow which consist: build and release where build was responsible for building, testing and publishing artifact for later use in releases to deploy
pipeline are a new approach which leverage YAML designed process for building/testing/deploying code
More info you can find here - Whats the difference between a build pipeline and a release pipeline in Azure DevOps?
And for instance for this pipeline/build
https://dev.azure.com/thecodemanual/DevOps%20Manual/_build?definitionId=157
where definition id is 157
You will get reposnses in both endpoints:
https://dev.azure.com/{{organization}}/{{project}}/_apis/build/definitions/157?api-version=5.1
and
https://dev.azure.com/{{organization}}/{{project}}/_apis/pipelines/157?api-version=6.0-preview.1
and in that term pipeline id = build id
The pipelines endpoint is not very useful:
https://dev.azure.com/{Organization}/{ProjectName}/_apis/pipelines?api-version=6.0-preview.1
It will only give you a list of pipelines with very basic info such as name, ID, folder etc.
To create and update YAML pipelines you need to use the Build definitions endpoint. The IDs you use in the endpoint are the same IDs as the Pipelines endpoint uses.
Get definition, Get list, Create, Update:
https://dev.azure.com/{Organization}/{ProjectName}/_apis/build/definitions?api-version=6.0
(To create a working pipeline you must first Get an existing pipeline, modify the JSON you receive, then POST it as a new definition.)
Back in the days I've seen on a demo (can't recall now where) where after every push, the Gitlab CI automatically created a pipeline for this commit in an appropriate branch, but without running it automatically.
This allowed user to run pipeline on any branch without having to manually select branch from "new pipeline" button.
Can't find such information in the documentation. Perhaps it was a hack but nonetheless it worked.
Good day. I would need to run the Bamboo plan which will dynamically get the branch at run time . For example , if i run the plan and it should prompt me for branch and lets say if i give feature_1 as my branch name , then it should build the feature_1 .
May i know how to achieve this ??
Thank you.
Bamboo doesn't satisfies this requirement directly. But this is how you can try to achieve same. Check the below steps you need to follow.
In Bamboo build plan configuration, goto variables and add a variable for branch path. This is path of the branch which you want to build. e.g. Feature1, Feature2 branch path. etc
In Plan repository, create SVN repository 'Build Script' and add repository path for common build script. You can use Perl script for this.
Now in bamboo job, create a 'Command' task to execute this Perl script.
When this common build script will gets executed, it will checkout desired branch specified at step 1 in plan variable. You have to use SVN command line to check out the branch.
Post branch checkout, common build script will then call branch specific build script (which was checked out at step 4). Which will then do the job for that specific branch i.e. Compiling code, Packaging etc.
So whenever you want to take build for any specific feature/brnach, then you just have to change the SVN path for branch path plan variable created at step 1 and run the plan. Thats it.
Let me know if you need more clarification.
~Nilesh