How to run ui5 commands in jenkins - jenkins

I am trying to build the project using the command :
ui5 build --all--
which totally works fine , produces a dist in my local pc inside my project folder using terminal
Now in JENKINS (* FYI OS - WINDOWS) - which is running locally , configured to get the code from GIT ,
Here When I tried executing the same command in Execute Windows Batch Command
When I try executing node commands for suppose node -v it gave me the version
May I know why not the ui5 doesn't work ? Am I required to do anything else here ?
I have tried executing CLI using the npm package manager:
npm install --global #ui5/cli
but still it shows me same err
Any help is much appreciated TIA

You have to install ui5 globally (as part of your docker image) or if it's in your local dev dependencies(recommend) run npm i && npx ui5 build

Related

How to deploy a angular project using Jenkins in windows

I'm trying to deploy an angular project using Jenkins. In the window bash, I used the command npm install and npm run ng -- build to install packages and to build the project. Later when I try to host using http-server it throws an error like 'http-server' is not recognized as an internal or external command, and it clearly shows it is not supporting any Angular-related commands in it. Suggest me anyway to solve this. Thanks in advance

npm library fails to install in GitLab CI

My Docker image build has been failing to build lately and I've managed to trace down
where exactly it struggles.
When the runner is executing RUN npm install react-scripts#2.1.8 -g --silent --no-optional (from Dockerfile)
it fails and gives no error output to work with. Job log shows no clue as to why it failed.
I figured I could SSH into the CI server but GitLab doesn't support direct SSH access into CI server for debugging purposes.
My question is how can I debug this ? What steps I should take ? I don't deal every day with
bug where I get no error output.
What are the conditions in which GitLab runner may fail to install it ?
Note:
I ran it locally and no problem whatsoever hence it must be problem within the CI.
is the build of your image is ok in your computer ? You can also install a gitlab runner in your computer to test your gitlabci file
Try removing the --silent flag from the npm install command. I reckon you'll see a bit more then.
Timeout of the build runner was to blame in this particular case. As soon as I reorganized the code in build script npm library was successfully installed.

Can you run gulp inside windows-server-core docker container?

We are trying to build a c# app that has gulp do some of the bundling/minification for the front end website.
We are currently using node 6 because of gulp dependencies. A future branch is updating to node 10 but that requires different node dependencies as we migrate our project. I thought using a docker container for the build might help alleviate switching between node versions on our local machine.
So I created a docker image
FROM microsoft/dotnet-framework:4.7.2-sdk
Then I loaded npm on top of it. Binding a volume to my source directory I'm able to install npm packages, install nuget packages and call build but it will fail because it is missing my gulp step.
I have gulp installed both globally in the container and locally in the node_modules folder. I end up with an error like,
C:\Program Files\node\node-v6.16.0-win-x64\node_modules\gulp\node_modules\sver-compat\sver.js:19
var semver = version.match(semverRegEx);
^
TypeError: Cannot read property 'match' of undefined
at new Semver (C:\Program Files\node\node-v6.16.0-win-x64\node_modules\gulp\node_modules\sver-compat\sver.js:19:23)
at Function.match (C:\Program Files\node\node-v6.16.0-win-x64\node_modules\gulp\node_modules\sver-compat\sver.js:374:15)
I have search all over the web for multiple days with no luck finding anything that can help me with what is blowing up here. Has anyone been able to get gulp to run successfully inside of a Windows Server Core docker container? Is the problem with the directory being mounted? Using Docker for Windows if that matters here.
On Windows-Server-Core the best I can surmise there is an issue with docker, volume-mounts and npm/gulp system links.
I believe the user set on the container by default wants to use the c:\containermappeddirectories folder. I am not sure at this point if that is configurable.
But my work around looked like this in powershell all running in the container,
npm install -g gulp#^3.9.1
md c:\ContainerMappedDirectories
cd c:\containermappedDirectories
robocopy /S "c:\MyUISource" C:\ContainerMappedDirectories
npm install #installs gulp locally to this folder
gulp prod-build
robocopy /S C:\ContainerMappedDirectories\dist c:\MyUISource
So I installed gulp globally, I created the local workspace copied my source in and ran npm/gulp then copied back my output to the mounted location.
In the end it was the best work around I could accomplish to complete my task.

Aurelia build using cli produces different results on different platforms

I'm trying to setup a jenkins job to automate builds of our aurelia app. When I build the app locally it works 100%, but when I build it on jenkins using the same process, then the files in the script directory is different.
I'm running Debian testing on my laptop. The Jenkins is a docker image running on Rancher.
When I test the build with jenkins, I get the following error:
http://localhost/src/main.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor-bundle.js:2 Error: Script error for "main"(…)r # vendor-bundle.js:2
Both my local environment and jenkins have the following tools and versions:
node: 6.9.1
npm: 3.10.8
aurelia: 0.22.0
The app is written in typescript.
we are also using aurelia-cli to build the app using : "au build --env prod"
The process we use to build the app:
npm install aurelia-cli
npm install
typings install
au build --env prod
Any help appreciated

Building jhipster in Windows Jenkins

When I try to build JHipster on a windows Jenkins instance, I get the following error
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.4:build (run-frontend-build) on project jhipster: Error during : cmd /c bower --version
I tried running Pprod clean package from the commandline and it works fine.
Any thoughts / Help appreciated.
That's because Jenkins's node environment is not complete, make sure bower is in its path. Bower should be installed using npm install -g bower
Please refer to our documentation about Jenkins setup: http://jhipster.github.io/setting-up-ci/
Thanks to Gaël Marziou, I zeroed in on the problem to access issues for the Jenkins user. I was able to solve it using the NodeJS plugin.

Resources