Codefresh allure pytest - allure

I am trying to use allure for code fresh. We are using pytest to generate reports. After I clone the repo, in documentation it is mentioned to running_tests:
image: node
title: Running Unit tests
commands:
- npm test
- cp -r -f ./allure-results $CF_VOLUME_PATH/allure-results
I want to use pytest. I am new to code fresh. I am trying to understand after I clone the repo how do I reflect the pytest allure report there and send it to code fresh volume. How to run pytest to the Github repo I cloned. Should I provide working directory?. In the above code they are not using any git clone or working directory. If I use docker file is there a way to send reports to code fresh volume. Thanks.

Related

how do you clone a git Gatsby project and run it locally?

I'm familiar with cloning git projects.
But I'm struggling to clone a Gatsby project, https://github.com/MunifTanjim/gatsby-theme-dox, and then run the website locally.
I run git clone https://github.com/MunifTanjim/gatsby-theme-dox
Then it downloads
I go into the correct directly, and I've tried
gatsby build
This works
then
gatsby develop
I get the following error:
ERROR gatsby <develop> can only be run for a gatsby site.
Either the current working directory does not contain a valid package.json or 'gatsby' is
not specified as a dependency
I've also tried
I also cd into the demo folder and run the same -- I get it to run locally but with a 404 error...
Is it possible to run the demo of this gatsby project?
I'm quite new to Gatsby so trying to understand by starting with a prebuilt project.
Once you clone the repository you need to install the dependencies. cd to the root of your project and run npm install or yarn install.
gatsby build and gatsby develop, like all Gatsby commands, must be run in the root of your project, where the package.json is located. Otherwise, it will throw an exception.
In your case, run the following in order:
git clone https://github.com/MunifTanjim/gatsby-theme-dox
cd gatsby-theme-dox
npm install #or yarn install
cd demo
gatsby develop #to build the site in development mode
gatsby build && gatsby serve #to build the site in production mode
I'd suggest taking a look at Gatsby commands (gatsby-cli) to understand what you are running.
git clone https://github.com/MunifTanjim/gatsby-theme-dox.git
cd gatsby-theme-dox
yarn install
cd demo
gatsby develop (you should see the main page in http://localhost:8000/) or gatsby build and when it ends run gatsby serve in the terminal (see the main page in http://localhost:9000/)

How to give next js app build to the client

I am new on Next JS, I have created a small application. It is using API calls and more features.
During development, Using the command as npm run build I am able to create .next folder as build and using npm run start I am able to run that build.
Now the client is asking for build, so what should I send to him? Either complete project and ask him to do the
npm run build and npm run start (which I don't think so)
or only the .next folder. But how he will run this build?
Open package.json in your editor and add the following export script to the file:
"export": "npm run build && next export -o _static"
run this code in the terminal:
npm run export
Open _static folder and there is all of your file.
Some possible ways of sharing your project:
You can easily build and host your project with services like vercel or netlify. Easy and quick. Check out the vercel CLI in particular.
Your client can clone the git repo, install all dependencies, run build, and run start. This'll start a production server. Check here: https://nextjs.org/docs/api-reference/cli#production. Bad idea if your client is not a dev.
You can build your project and send the output to your client, which he/she can then view by spinning up a server (python simpleHTTPServer, Mamp). Also a bad idea if your client is not a dev.
Long story short, host your project somewhere and send them a production URL.

For react-admin-demo is it compulsory to do complete build of react-admin

For react-admin-demo is it compulsory to do complete build of react-admin.
As per documentation it goes through clumsy make process.
Have anybody installed the folder itself by just npm install and run?
Any hints on how that can be simplified, to fork and create my own project?
Reference: https://github.com/marmelab/react-admin/tree/master/examples/demo
This is a mono repository which includes many packages. It uses learn and yarn workspaces. You'll have to use yarn.
There are several scripts inside the main package.json file which can help you start contributing without make. Each package inside packages can be built by running yarn build inside its folder.
To build all packages in one command, you can run ./node_modules/.bin/lerna run build inside the root folder.

How to quickly deploy React / Redux app as a sample?

It seems one way is to deploy the React app to Heroku, but is there a simple way to deploy to our own website or to GitHub page feature so that you can see the page off from GitHub? (just as a sample, not for production)
Details:
It seems that one possible way may be to use
wget -r --no-parent http://localhost:8080 -P sample -nH
cp -rf images any_needed_folder sample
and now you can git add sample and git commit and push to github and turn on the GitHub page for your repo and be able to see your React app inside of sample.
You also need to change the paths in the index.html, from /bundle.js to bundle.js, etc, because you need relative path instead of going to the root of your website.
(I used wget to recursively download index.html, bundle.js, and style/ (the CSS files) because bundle.js cannot be found in the whole directory on the local hard drive. I used wget because curl doesn't seem to be able to download recursively)
Ok, I found that the latest React, it will tell you to use
create-react-app hello-world
to create the app, and then there is an official
npm run build
to build it to host it as a Gthub page, or on your own website.
If wget is doing what you want, cool, use that.
For the actual deploying, I recommend using gh-pages on npm. It handles creating an orphan branch and copying your output files into it, and then pushing all in one command.
Install it:
npm install --save-dev
And in an npm script:
gh-pages -d sample

Separating a Build and Test on Jenkins

I have a angular application which i develop using source control ofcourse (gitlab), I recently integrated it with jenkins so that everytime i push to my git it triggers a build. In my jenkins i created a job that pretty much builds the application (installs dependencies) and runs test. Following is what my execute shell looks like in my job.
export npm_config_prefix=.npm/
export PATH=.npm/bin:$PATH
npm install -g bower grunt-cli
npm install
bower install
gulp test
Now the issue is that I do not want to build and run test as a same step i want them to seprate. So how do i achieve this ? Do i create a new job and add gulp test in the execute shell of the new job ? Or is there some other approach. I am new to jenkins and CI in general so was wondering what would be the approach in this situation ?
As you have found, Jenkins is a super advanced shell script runner to take the boring part out of repeatable steps in the build process.
The next step is to hunt down plugins to do those steps for you in a cleaner way. This is where plugins come in
These is a Node Plugin which will install npm packages outside the job so you don't have to do the npm install -g step every single job
You would want to keep the build step as shell
npm install
bower install
gulp test
I think that is your concern because you only need to run the job if the code has changed, including local dependencies. You could add a second shell step and just have the tests in there as it will run in the same workspace but all the build logs will be in one place
You didn't say what test runner your using but you will probably find a publisher step which will bring that into Jenkins for you xUnit plugin covers quite a few runners so might work for you
And this is the tutorial on installing plugins into Jenkins

Resources