In most computer operating systems, any process that exits leaves an exit code that indicates whether the process ran as expected. Therefore, if the exit code of the execution process in continuous integration (CI) is not 0, the system judges the build to have failed. The following are common causes of build execution failure:
How do I fix CI configuration file syntax errors?
Like most programming languages, a Jenkinsfile is composed of a domain-specific language (DSL), so syntax errors can cause compilation or runtime failures.
How do I resolve failed tests?
Most mainstream testing tools and frameworks set the exit code to a non-zero value by default when the test logic fails.
How do I resolve a build timeout or an insufficient build quota?
When using CODING Continuous Integration (CODING-CI), each team has a certain build quota. To prevent the malicious use of CI in cyberattacks, each build task has a timeout limit. Build tasks that time out or exceed the build quota are terminated by the system. If you need a higher quota, you can adjust the quota in Team Management by purchasing the quota you require.
How do I view build logs and build snapshots?
CODING-CI provides build logs, which allow users to determine the causes of faults. In addition, CODING-CI provides a configuration snapshot for each build. You can use the snapshot to get the configuration file content and parameters used in the build. This way, you can see if configuration issues caused the build to fail.
Build log
Build snapshot
How do I run automated tasks locally?
You can re-execute the automated logic (for example, re-run the test code locally) or modify the code in real time to get more feedback for troubleshooting.
What happens if I use an interactive command-line program?
In the CI process, you cannot directly use interactive commands. If you use a program that calls up an interactive command-line window, the build will fail.
A common command is npm login docker login -u xxx
(the docker -u xx -p xx
command is required when logging in to Docker during CI).
Note:
If you cannot find an answer to your question in this document, please go to the Ticket Center to submit an issue. We will promptly provide a solution to your problem. How do I debug build tasks?
If you need to debug a build run process, you can provide the SSH by adding the following steps to the build process:
steps {
sh 'apt-get update'
sh 'apt-get install -y tmate openssh-client'
sh '''echo -e \\'y
\\'|ssh-keygen -q -t rsa -N "" -f ~/.ssh/id_rsa'''
sh 'tmate -S /tmp/tmate.sock new-session -d'
sh 'tmate -S /tmp/tmate.sock wait tmate-ready'
sh '''
tmate -S /tmp/tmate.sock display -p \\'#{tmate_ssh}\\'
tmate -S /tmp/tmate.sock display -p \\'#{tmate_web}\\'
echo "WebURL: ${tmateWeb}"
echo "SSH: ${tmateSSH}"
'''
sh 'sleep 3600'
}
Was this page helpful?