7

Here is my solution: (bitbucket-pipelines.yml) pipelines: default: - step: script: - export DOCKER_COMPOSE_VERSION=1.18.0 - export DOCKER_COMPOSE_URL=https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) - curl -L $DOCKER_COMPOSE_URL > docker-...


6

You don't make any mention of the scripting language you want to use, so I will talk specifically about the HTTP requests to the BitBucket API: Assumptions If you have a BitBucket Repository that has three commits in in it the first and the last are failing the build, the middle is passing: 4768815 ❌ 49d7110 ✅ 42d357f ❌ Get the list of commits You can ...


6

--vault-password-file can instead point to an executable script that writes to stdout. This little-known feature should solve your problem. First, write a simple, executable script that prints a system environment variable, and check that into your source control. Then, use Bitbucket's encrypted variable feature to set that environment variable to your ...


6

We are less likely to see support of native docker-compose integration because pipelines API is a custom implementation of similar functionality, and also because possible security issues, but looks like more features are currently in development to implement more docker-compose-like features in this open issue. UPDATE: added support for multi-container ...


4

I believe it is now possible to configure the webhook on per-repo basis: https://mohamicorp.atlassian.net/wiki/spaces/DOC/pages/381419546/Configuring+Webhook+To+Jenkins+for+Bitbucket+Bitbucket+Branch+Source+Plugin


4

At the moment the docker login and docker push commands are only available to Pipelines Alpha members. You can read about the features available to Alpha at "Pipelines Alpha". In order to participate, the above link includes instructions on how you can opt-in to the added functionality. Personally I received an e-mail from Atlassian a day after signing up ...


4

What I really want is to add a comment to the accepted answer, but I don't have enough reputation to do so. So I'll note it here. I've closed BSERV-10344 because it's in the wrong tracker. This question is about Bitbucket Cloud (bitbucket.org), not Bitbucket Server (the behind-the-firewall version). The correct issue tracker for the feature request is at ...


3

Apparently selecting the Close branch option in the very dialogue illustrated in your question will actually delete the branch as well. From Why only "Close" a branch instead of "Delete" it?: Ben Tatham Jun 15, 2014 It seems that I was mistaken. Marking a pull request to Close branch when merged, does indeed Delete it. I'm not sure why they use ...


3

Note: this answer comes from my background of building custom solutions, it's not a config-only one, which, if available, would obviously be preferable. But it's maybe something to consider otherwise. You could teach the script executing the unit test job to persist a per-branch execution state. When the script is launched it would need to obtain the ...


3

We do this at work. We have a small server, let's call it the receiver, it's the target of the GitHub webhook events. It runs a small application that parses the payload and incorporates logic around how to proceed e.g. create a new server on the infrastructure provider, update the load balancer, deploy to an existing server, destroy the server etc. This ...


3

One could update the build status in bitbucket as follows: Adding a build result to a commit To associate a build result with a particular commit, you need to POST a JSON object to the build status REST resource at: https://<bitbucket-base-url>/rest/build-status/1.0/commits/<commit-hash> The format of the JSON object that ...


3

In a typical Continuous Delivery/Deployment pipeline you would have the following happen: Developer pushes one or more commits, or, a pull request is merged. Jenkins automatically builds and executes tests. If successful Jenkins publishes a deployment package to an Artefact Repository; if failure publishes nothing and notify developers. Deployment ...


3

I managed to use docker-compose to push images to a remote host by using the following image. tmaier/docker-compose:latest This is the basic docker image with docker-compose installed. My bitbucket-pipelines.yml looks like this: - step: image: tmaier/docker-compose:latest script: - (umask 077 ; echo $DOCKER_PRIVATE_KEY | base64 -d > ./...


3

I am in a similar pair of shoes as you - I am currently, slowly, getting into the DevOps topics after having many, many years of conventional development (and close connections to conventional ops) behind me. You seem to have read a few articles, or heard a few things. That is good. Let me suggest a practical approach how to go on: Take your favourite ...


3

As you are already using Bitbucket, Bitbucket pipelines could be useful. What languages are supported? Node, Ruby, Python, PHP, and more. Anything you can run in a Docker container is supported. why not jenkins? Jenkins could be an option as well. If Bitbucket could trigger Jenkins or Jenkins could check whether there are code changes.


3

If you just need generic post-receive hooks, you can just do a regular web hook and hit the build API endpoint. For instance, if the name of your Jenkins server is jenkins.example.com and the name of the Pipeline job to trigger is my_awesome_job, then you can fire off a POST request to https://jenkins.example.com/job/my_awesome_job/build. Depending on your ...


2

To expand on the answer above - try using: branch: "origin/pr/${pullRequestId}/from" Because in groovy, string interpolation is not done for simple strings - i.e. strings within single quotes. See http://groovy-lang.org/syntax.html#_string_interpolation for details on that.


2

In groovy script, you need to reference environment variables in a different way than in bash. So probably this line is causing trouble: branch: ('origin/pr/${pullRequestId}/from') Try using: branch: ('origin/pr/' + env.pullRequestId + '/from')


2

On GitHub - you can't. Basically, their PRs are temporary branches, and there's no check if base commit is HEAD of branch to merge in. This problem is solved with gating systems like Zuul, which puts all PRs into queue to run tests. You are talking about systems for managing and storing code, while the issue is in CI scope (i.e. Gitlab flow has this issue ...


2

You could: prune your branches. (guessing you'd have done this by now if feasible.) implement Jenkinsfile, a code-driven pipeline, and simply remove the jenkinsfile from the branches you don't want built or triggered by SCM-polling.


2

You've chosen a fairly difficult stack to support. WAMP is largely used in dev environments, and the windows builds of mysql, php, and apache typically lag their Linux counterparts by a significant amount. You can likely reuse your code, barring any hard coded or absolute paths, on Linux. Once you move to Linux, there are lots of great deployment options, ...


2

Instead of using a symlink that will be stored as is in BitBucket one could use: - name: Copy docker-compose.yml copy: src: ../../../../docker-compose.yml dest: /path/to/docker-compose.yml


2

You can certainly show a code coverage badge in a bitbucket repository, but it would have to be from an external source like jenkins, codeclimate, etc. According to your link, if you are using pipelines they now show a code coverage badge on the project overview page. If you want to add that to your README or display it somewhere external, that ...


2

Try running with -d detached flag docker run -td -p 3000:3000 -p 6379:6379 -p 8983:8983 my_dockerhub/image # here ^ Containers started in detached mode exit when the root process used to run the container exits. This will prevent the step to freeze at docker run stage. Docker docs -d flag


2

I think you're taking the problem on the wrong side, you may start a whole new infrastructure aside and then switch loadbalancers from blue to green, loosing sessions, breaking ongoing transactions etc. The proper way to achieve what you're doing is coding differently, when A relasease a breaking API ni version n, a should be able to continue to answer call ...


1

At the moment it seems not be possible to update all issues at once using the API and therefore this issue has been created.


1

At the moment this seems not to be possible in bitbcuket at the moment. Therefore I have created an enhancement in the Bitbucket issue tracker.


1

this setup worked perfectly for me using aws code deploy:


1

One could also create libraries and call them using a dependency manager like a package.json if node is used or ivy if the code is written in java.


1

Hello guys I have found the solution, So I create ssh keys from my Jenkins Server, and then called the private key from my code, this is how it looks like on my project structure: root@staging:~/project# tree . ├── deployment.yaml ├── server │   └── host └── the_private_key 1 directory, 3 files and my deployment.yaml: --- - hosts: staging become_user: ...


Only top voted, non community-wiki answers of a minimum length are eligible