I have the following action on buildkite that automatically packs and deploy a package to repo manager every time a PR gets merged into master.
But I would like that it was not run if my update is only a README.md update, is it possible to do so?
Related
I am planning to do below
Copy from git repository to a Windows machine each time a commit/ update is made to that folder only. May be something like Jenkins can be used for same but unable to determine how can I do it?
Check commit made to repo ( this I have done)
As soon as commit is made to repo, trigger a jenkins job that will update this change to a windows server ( How to do this?)
If the repository is local, it would be easier to push directly to the Windows machine, assuming it has an SSH server (which Windows 10 2019.09 and more now have)
If the repository is distant, you can configure a webhook in order to call a Jenkins server for a specific job.
See for instance "Triggering a Jenkins build every time changes are pushed to a Git branch on GitHub" by David Luet
Or you can define a Jenkins pipeline that GitLab-CI can execute.
In both cases, your Jenkins job will have to copy the checked out repository.
I would use git bundle to compress the repository into one file (or a simple tar), copy it over the Windows server, and decompress there.
I have an app on Heroku. According to the Heroku App deploy guide I followed the below steps to modify the master.
Steps to make the push on Heroku
$ git add .
$ git commit -am "make it better"
$ git push Heroku master
The build of deploy was successful but the changes didn't reflect on the browser. I used hard refresh multiple times but didn't work.
If your app requires a build step to compress and combine assets and you are not seeing recent changes, then it's likely that you are forgetting to run that build step.
If you are using package such as parcel-bundler. you should run it before you deploy it. That would solve the issue.
You can read more on how to run it automatically whenever you deploy your app from here.
https://devcenter.heroku.com/articles/node-best-practices#hook-things-up
From the official document from GitLab, it seems that a CI/CD stage can only be skipped based on if a file is changed. Is it possible to skip a step based on if a file / folder exists on the machine to be deployed?
The case is that it is common to use a package management tool. (e.g. composer in PHP or NPM in Node.js) Currently the rule is to check if the respective configuration file is changed (e.g. composer.json for composer or package.json for NPM) to see if it is necessary to run the install step (i.e. composer install or npm install) However, although it seldom happens, when a new machine is used for deployment, the CI/CD would crash because the install step is skipped.
Currently, the problem is solved by manually trigger the install step, but is it possible to auto detect if the file exists at the hosting machine to determine if the install step should be run?
I don't think that there is a way to do what you describe. The only/except feature in GitLab runs on the GitLab server, before any jobs are created. To be able to know if a file already exists on a server, there needs to be a job created and it needs to be assigned to a gitlab runner.
They have this issue, where it looks like it will be possible to start a job and then determine that it should be skipped by using exit codes:
https://gitlab.com/gitlab-org/gitlab/issues/16733
In the mean time, you can make it so that your install job always runs, and then just use your build scripts to check for this file. From the pipeline view in GitLab, you will always see your install step. The actual job can just skip to do anything if the file already exists, and then you don't need to remember to run the job manually.
I am trying to wrap my head around Travis-ci scripts but I am trying to figure out if what I want is even possible:
Repo #1:
- my app to be built via travis-ci
Repo #2:
- contains selenium/nightwatch tests that should run once repo #1 is finished building
So this is the workflow I am aiming for:
a PR in Repo #1 gets merged
Travis-ci builds Repo #1 and completes successfully & deploys
Travis-ci tells Repo #2 to start building
Repo #2 installs the repo which triggers browserstack to begin running the selenium tests
Is this at all possible? I've been researching this for a few days and couldn't find a way to trigger a separate repo to build.
Any help is appreciated.
Thanks!
Possible Duplicate of: Triggering builds of dependent projects in Travis CI
Nevertheless, pasting the answer here: Yes, it is possible to trigger another Travis job after a first one succeeds. You can use the trigger-travis.sh script that is part of the plume-lib library.
The script's documentation tells how to use it -- set an environment variable and add three lines to your .travis.yml file.
You can setup repo#1 and repo#2 using different jobs and use the above approach to trigger downstream job after successfully deployment has completed using job 1
Since GitLab 7.6, or thereabouts, there is a new option to use TeamCity directly from GitLab projects. In the setup there is this message:
The build configuration in Teamcity must use the build format number
%build.vcs.number% you will also want to configure monitoring of all
branches so merge requests build, that setting is in the vsc root
advanced settings.
I'm not sure how this works. Lets say I have a repository Foo.
I have setup a build on TeamCity to listen to Foo with branch specification: +:refs/pull/*/merge
I then fork Foo in gitlab as FooFork, make a change, then request a merge FooFork -> Foo.
But nothing happens to test this merge, which is what I was expecting GitLab to do. If I accept the merge than the build server jumps into action (immediately) and builds twice (master and /ref/master).
I've also set the build configuration to use exactly: %build.vcs.number% as the build number as prescribed, but gitlab doesn't seem to give me any information about the build result.
So I'm a bit confused really as to what exactly this GitLab -> TeamCity integration is supposed to do and whether I'm doing wrong.
I'm currently running GitLab 7.9 and TeamCity 8.1.4
Update:
Seems this use case was not supported prior to version 8 - https://github.com/gitlabhq/gitlabhq/issues/7240
I'm running GitLab 8.0.2 and TeamCity 9.1.1 and am able to run CI builds on branches and merge requests.
I trigger CI builds for specific branches by setting a VCS trigger together with the branch specification +:refs/heads/(xyz*) where xyz is the string for our ticket system prefix since all active branches need to be named after an entry in our issue tracker.
I trigger builds for merge requests via the branch specification +:refs/(merge-requests/*)
Everything works as as expected and lets us know the status of all feature / bug branches and merge requests automatically.
Thanks to Rob's comment linking to the GitLab 8 release notes entry on the merge request spec.
Same problem here. There might be another way, I'm evaluating right now. Since there's no direct way of getting the merged state from the target MR, you have to build it on your own:
IMO there's the following todos
1.) init a bare repo $ git init
2.) add your target repo $ git remote add origin git#your-repo:<origin.group>/<origin.repo>.git
3.) add the remote/feature/to-merge's $ git remote add target git#your-repo:<feature.group>/<feature.repo>.git
4.) checkout your feature branch $ git checkout -b <feature.branch> feature/<feature.branch>
5.) checkout your original branch $ git checkout -b <origin.branch> origin/<origin.branch>
6.) Rebase feature into your original branch $ git rebase <feature.branch>
As stated here [1], GitLab-CE can fire an event on creation of a merge-request,
so all you have to do is building some meta, that can evaluate the WebHooks.
[1] http://doc.gitlab.com/ce/web_hooks/web_hooks.html#merge-request-events