I'm having trouble getting Nx to build properly inside Gitlab's CI/CD tool.
> nx affected:build "--prod" "--base=remotes/origin/development~1" "--head=remotes/origin/development"
fatal: Not a valid object name remotes/origin/development~1 Command failed: git merge-base remotes/origin/development~1 remotes/origin/development fatal: Not a valid object name remotes/origin/development~1
I've tried different branches/commands such as just a plain: nx affected:build
and I get the same error(just with a master branch indicated in the error message)
Anyone able to get the Nx monorepo working with Gitlab?
You can set up GitLab CI/CD across multiple projects, so that a pipeline in one project can trigger a pipeline in another project. You can visualize the entire pipeline in one place, including all cross-project interdependencies.
How does it work? When you run nx affected --target=test , Nx looks at the files you changed in your PR, it will look at the nature of change (what exactly did you update in those files), and it uses this to figure the list of projects in the workspace that can be affected by this change.
GitLab CI/CD is the part of GitLab that you use for all of the continuous methods (Continuous Integration, Delivery, and Deployment). With GitLab CI/CD, you can test, build, and publish your software with no third-party application or integration needed.
GitLab CI (Continuous Integration) service is a part of GitLab that build and test the software whenever developer pushes code to application. GitLab CD (Continuous Deployment) is a software service that places the changes of every code in the production which results in every day deployment of production.
Had a similar problem. Running "git fetch" before the nx command fixed the issue.
It no longer works after the newest update. If you have a main branch name other than master and want to utilize the '--all' option, there is a correct way to specify command-line arguments.
Try this
nx affected:build --all -- trunk HEAD
Notice the space after '--' before the branch name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With