PNP Module issue when I run the build in teamcity - teamcity

I have development server where Bitbucket and team city is in place
When I run the PowerShell script below one line, it is successfully connecting
Below is the commandlet:
connect-pnponline -url "https://domain.sharepoint.com/sites/sitename" ( it worked in my dev server )
Same command Giving following error when I execute in teamcity , this teamcity is there in same development server.
Is there any software/dependencies are missing pertaining to PNP module in teamcity agent? Please help to resolve this issue.

Related

Deploy to Azure using publish profile : Works when publishing on VS2017 fails when using Jenkins

I downloaded the Publishing Profile from my App Service and created a profile on my WebApi.
When I execute "publishing" using VS 2017, it works fine.
When I try to execute deploy command on Jenkins if fails. The error message I have is :
Deployment task failed. (Connected to the remote computer ("XXXXXXXX") using the Web Management Service, but could not authorize.
Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Connected to the remote computer ("xxxxxxxxxxx") using the Web Management Service, but could not authorize.
The remote server returned an error: (401) Unauthorized.
I have a step on Jenkins using PowerShell command line like :
msbuild My.WebApi /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True /p:PublishProfile=$myPublishProfile
It builds without errors
$myPublishProfile is a valid Path
This Jenkins instance runs on a Server, not on my machine.
Jenkins has its own SMC user and server auth user.
App Service has WEBSITE_WEBDEPLOY_USE_SCM set to False
I am using the same Publishing Profile to build on Jenkins and on Visual Studio.
If both are using the same Publishing Profile, why I am getting the Auth error ?
Is there is any other config I should do to perform Deploy from Jenkins ?
When you publish using visualstudio the password is stored in an encrypted file on your disk. If you need to publish with the msbuild-command you can add credentials on the commandline or in the publishprofile
append theese properties on the commandline:
msbuild ... /p:UserName=XXX /p:PassWord=YYY
or include in the profile
<UserName>XXX</UserName>
<Password>YYY</Password>

how to restart teamcity server

I am a beginner to teamcity. Our Teamcity 9 server stopped working after I installed Gradle. I doubt that it was problem with port or something like that. I removed Gradle but Teamcity didn't work. So I tried to restart Teamcity server. We have two teamcity agents. I stopped agents with:
sudo ./runAll.sh stop
and I stopped the server with sudo ./shutdwon.sh
after that I started server again with ./startup.sh and agents with
sudo ./runAll.sh start
Now when I am writing url address in browser I am getting either connection_timout or connection refused But when I am writing url with explicit IP address like 10.31.24.18:8111 then I am getting
My questions:
1- How can I restart Teamcity and agents so that I am getting same agents and project as before restart in TeamCity UI? Or If I am creating Administrator account now after that I should reconfigure all projects or my projects before restart will be there?
2- Why URL with IP-address is working but URL with domain name server name is not working?
You can restart TeamCity right from the UI: Administration > Diagnostics > Server Restart. You will need to have server admin permissions for that.
using command line
cd /opt/teamcity/bin
(sudo) ./teamcity-server.sh stop
(sudo) ./teamcity-server.sh start

VSTS change agent state from offline to online after installing it

i'm facing a problem with VSTS agent state is offline i installed the agent through cmd under the right pool and downloaded after that but it still offline any help please ?
If the build agent is running as interactive mode, you need to start agent by running run.cmd file:
Open Command line as administrator
Run run.cmd file (under agent folder)
If the build agent is running as service, you can check whether the related service is running in Services.

install GitLab on a server running Windows 7

I need to install GitLab on a server running Windows 7, but I'm blocked at this line. The documentation doesn't really helping me. The following is from my command prompt:
C:\GitLab-Runner>gitlab-runner.exe register
Please enter gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.com
Please enter the gitlab-ci token for this runner:
Where can I find this token?
You're attempting to install the GitLab Runner which is used to run your jobs and send the results to a GitLab which is a server. As you're talking about GitLab running at a server you have to install that and not the Runner.
But it is not supported to install GitLab on Windows, see here in the GitLab forum. They recommend to use Linux in a virtual machine for that if you want it on Windows.
In all seriousness this is something that will probably never be supported.
Nevertheless to get the needed project registration token follow these steps described here. Also there is a discussion about it on GitHub.
To create a specific Runner without having admin rights to the GitLab instance, visit the project you want to make the Runner work for in GitLab:
Go to Settings ➔ Pipelines to obtain the token
Register the Runner
Further the process of registering the GitLab Runner which is actually what you're doing is described here.

Jenkins build project "Unable to access to repository"

I am a complete Jenkins noob so if I have missed something completely obvious I apologise in advance!
I am building an intranet web application using Visual Studio 2010 and commit changes using AnkhSVN to a repository stored on a server that is running Visual SVN Server.
Due to budget restrictions this server is also acting as our web server and also running Jenkins. It is connected to our internal network but doesn't have external internet access so I have had to manually install Jenkins plugins and dependencies.
I am trying to build a Jenkins project that would build the web application when it detects a commit but when I enter the repository URL and the user credentials in the source code management window I get the following error message:
Unable to access to repository
However when I enter the url in a browser and enter the same credentials I can access the repository without any errors.
Any ideas would be greatly appreciated.
Server Specs
Windows Server 2012 R2 Datacenter 64bit
Visual SVN Server
Port: 443
Version 3.5.6
Jenkins
Port: 8080
Credentials Plugin 2.1.9
MapDB API Plugin 1.0.9.0
Pipeline: SCM Step 2.3
Pipeline: Step API 2.5
SCM API Plugin 1.3
SSH Credentials Plugin 1.12
Structs Plugin 1.5
Subversion Plug-in 2.7.1
check if the ip of jenkins server can access the svn ip server....i have the same problem and i found that my ci server can not access the svn server .using ping command
That actually might be okay. For some reason I see similar error message (could be a bug in Jenkins frontend) when edit SCM details for a job in Jenkins, but it does work flawlessly if I actually save and run the job.
Give it a try it might actually work during the build time.

Resources