Aurelia build using cli produces different results on different platforms - jenkins

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

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

How to run ui5 commands in 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

CloudBuild fastlane task failing with JAVA_HOME is not set and no 'java' command could be found in your PATH

I am attempting to run a fastlane build inside Google Cloud Build however I'm getting the following error:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
My first step is to install the Android SDK, which works fine, and then run the fastlane command, however each and every time, no matter what I do in the name before the id:fastlane I get the same Java error. I've downloaded both the Android and Fastlane images from the Cloud Builder and Community Cloud Builders github repo and placed them in our GCP project repository, so each are accessible in the name tasks.
steps:
# Android SDK
- name: 'gcr.io/$PROJECT_ID/android:29'
id: android
args: ["./gradlew", "assembleDebug"]
# run fastlane
- name: 'gcr.io/$PROJECT_ID/fastlane'
id: fastlane
args: ['distribute_staging', 'signingPassword:${_PASSWORD}', 'firebaseToken:${_TOKEN}']
Keep in mind that each step are containers. They are loaded one by one, the tasks performed and unloaded. Only the /workspace directory is kept from one step to another one.
Therefore, in your first step you load an android builder and you can build Java stuff because Java is installed in the container. Then unloaded
The second step is Fastlane. Look at the Dockerfile, it's a ruby image. No Java inside, thus, your process can't work. You have to build a custom worker
Either from the fastlane base image and install Java on it
Or from a Java image (Android?) and install Ruby and fastlane on it.

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.

Jenkins dotnet command not found

I am trying to setup CI locally with Jenkins on OSX, however I am having some issues when trying to execute shell commands. Here are the commands I am trying to run in the Jenkins configuration:
cd /Users/username/projectname
dotnet build HD-Project.sln
However, when I try and build the project, I get the following errors:
Building in workspace /Users/Shared/Jenkins/Home/workspace/HD-Build
[HD-Build] $ /bin/sh -xe
/Users/Shared/Jenkins/tmp/jenkins2699993427980474696.sh
+ cd /Users/username/projectname
+ dotnet build HD-Project.sln
/Users/Shared/Jenkins/tmp/jenkins2699993427980474696.sh: line 3:
dotnet: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Any help would be greatly appreciated, thanks.
I got this working, and was successfully able to run dotnet commands through an executed shell via Jenkins.
To run dotnet commands, the .NET SDK needs to be installed on the Jenkins build server. Instructions on how to install the .NET SDK can be found here: https://www.microsoft.com/net/learn/get-started/macos for all OS - Linux, MacOS and Windows.
This happens because the installation package does not add the dotnet executable location to the PATH environment variable. This issue is mentioned in https://github.com/dotnet/core/blob/master/cli/known-issues.md#users-of-zsh-z-shell-dont-get-dotnet-on-the-path-after-install, but apparently it does not affect only zsh users. You need to add this path manually.
In my case the path was /usr/local/share/dotnet, so I ran (from the command line):
export PATH=/usr/local/share/dotnet:$PATH
Taken from https://github.com/dotnet/cli/issues/4357

Resources