VSTS: Store zip files from build for usage across builds - build

I am working on a series of builds. There are intermediate files created from few builds and other builds use those files in their build process. The build processes are scripted in PowerShell scripts. We are using private agents as there are custom dependencies.
Currently, we are using a folder on the private agent to store the intermediate outcomes that we refer to in the dependent builds.
We wish to keep it on VSTS (might be as a zip file) and download and unzip to a folder when we build the dependent component.
We see nuget etc. to be not fitting to the requirement.
Is there any available option for it?

If you want to store files in VSTS instead of the local agent machine, you can store the files into a separate repo hosted in VSTS.
Such as to store a zip file ($(Build.SourcesDirectory)\my.zip) into VSTS git repo (https://account.visualstudio.com/project/_git/filestore), you can execute below PowerShell script during build:
git clone https://Personal%20Access%20Token:PAT#account.visualstudio.com/project/_git/filestore
Copy-Item $(Build.SourcesDirectory)\my.zip $(Build.SourcesDirectory)\filestore
cd filestore
git add .
git commit -m 'add zip file'
git push oirgin master
After executing the build, the zip file my.zip stores in the VSTS git repo.

I finally published the outcome from the first build as part of the build artefact and then used in other (dependent) builds. It was nice to do.
Also, found it equivalent to having it on NuGet. Plan to move to Nuget later.

Related

Do I need to stage the 'vcpkg' directory to git

I am new to c++ development environment from javascript dev environment. Comparing to javascript package management, c++ is complicated. I found vcpkg that like npm for cpp.
The question :- When it comes to 'vcpkg' do I need to stage all files (to git) that contains in /vcpkg directory. Or just add it to .gitignore.
The project diretory :-
The /vcpkg directory contains a lot of files, that why I asked.
You shouldn't upload the dependencies to your repository. The correct thing to do is to use vcpkg in manifest mode. This way vcpkg.json package will be used to keep track of your dependencies. Every time you install or remove a package vcpkg.json will be automatically updated eliminating the need to upload your dependencies to your repository. You only need to upload vcpkg.json to your repository which is much faster. It also has many more advantages, take a look at https://vcpkg.readthedocs.io/en/latest/users/manifests/

GitHub repository created but unable to upload VS solution

I tried uploading a C++ project from Visual Studio 2019 onto my GitHub account.
The repository gets created when I do this however, none of my codes gets uploaded onto the repository.
Only the files ".gitattributes" and ".gitignore" appear in my repository.
Please could I have any suggestions on what I could do to fix this.
Close VS
Go to your local repository folder (the solution folder)
This will add all the files and commit them
git add .
git commit -m 'added files'
alternatively you can use "git add ___" to add one file at a time
Make sure you commit the changes and then do
"git push"
Re-open VS and everything should be setup now.
Here are some other instructions I wrote down recently which you may find helpful:
How to create a git repo from an ungitted local project already in development:
Create a empty repo on your repo hosting site
Go to your local project folder in git command line
git init
git add .
git commit -m 'message'
git remote add origin https://yourreposite.com/username/repo
git push -u origin master
Now you can open it in Visual Studio and everything is all setup

Blockchain Hyperledger Fabric dev env setup

I am very close to set up dev environment for hyperledger fabric and following this link
https://github.com/IBM-Blockchain/learn-chaincode/blob/master/docs/setup.md
When I run this command git clone -b v0.6 http://gerrit.hyperledger.org/r/fabric
and run go build. I get following error:
can't load package: package github.com/hyperledger/fabric: no
buildable Go source files in
/Users/test/work/src/github.com/hyperledger/fabric
However when I run step 4 from the link, the build success.
cd $GOPATH/src/github.com//learn-chaincode/start
go build ./
Here build is not succeed only for http://gerrit.hyperledger.org/r/fabric.
Any thoughts?
Please suggest!
I think the manual is not precisely written here. You are not supposed to run go build . on the cloned fabric repository. The manual just states here, that if you are getting build errors later, the clone into your go sources did not work. I is not asking you to build the fabric repository. If your build command is executed in step 4, everything should be set up correctly.
Assuming you are setting up the dev environment you want to build things for that after cloning the repo. This is done with make, thus e.g. make all to build and test all.
To build chaincode later on you use go build in the folder where you have the chaincode source file.

Visual Studio Team Services Build - Git Repository

I am leveraging Visual Studio Team Services Build Vnext to build ASP.NET application present in my Microsoft GIT Repository.
The Microsoft GIT repository is created under an Agile Team Project of the VSTS instance.
The VSTS build is getting executed successfully without any issues.
But I have a query with respect to the cloning activity of the GIT Repository that gets executed on the VSTS Build Agent.
During the build, the VSTS build Agent is cloning the entire master branch of the GIT repository instead of downloading the required ASP.NET application folder.
Is there a way to download the specific application folder on to the build agent instead of the entire branch.
we have this option for the onpremise TFS build having TFS as the Source control.
As far as I know there is no way to pull only a specific folder on a git repository unlike tfsvc. This is why you don't have such an option for the build tasks.

maven downloading file on every run 'install' target called

I am using appfuse-spring 2.2.snapshot artifact in my project. I am using maven is 3 .
When I run maven target 'install' every time download the same jar and dependency file.
How can I avoid to download the same files again and again.
for example
Downloading: http://oss.sonatype.org/content/repositories/appfuse-snapshots/org/appfuse/appfuse-web/2.2.2-SNAPSHOT/maven-metadata.xml
I don't want to download the jar file again.
Thanks in advance.
Why it's will download again and again? If it's always downloading maybe something is wrong because once the library is in your local repository it shouldn't need to download anything unless a dependency changes.
If you want to disable the download, use -o (offline) option in your mvn command:
mvn install -o
More: Maven Command Line Options
The problem is that you download the snapshot. Maven check a snapshot dependency each build (and if require downloads it).
Please avoid depend of snapshots.
Please find your deps in the releases repository:
https://oss.sonatype.org/content/repositories/appfuse-releases/
Old question but probably the solution would have been to check the "updatePolicy" for the repo, its possibly set to "always".