Reputation: 1108
I am having a git repository for my project with a structure as shown below. The structuring is based on the source, all the codes, scripts related to a source is kept under the respective source folder. The scripts and code consists of sql, scala, pyhton...all kind of files used for that source.
Now for one of the source, I have to create a jar file.
I have to use azure devops for creating jar file and store it in a dbfs location. There are two things i have to get clarity on.
Upvotes: 1
Views: 1388
Reputation: 31003
According to your description, you want to add build output (from Azure DevOps) into Source Control (GitHub). It's not recommended to update source control from a build, If you have special reason to do this, you can run git commands in the Powershell Task to do the commit and push. Check the answer in this case: Send specific files from Azure DevOps pipeline to Github
#Clone repo to your workspace
git clone https://github.com/repo
#assuming master is your branch
git checkout master
#Refresh repo if is already in your workspace
git pull -q 2>&1 | Write-Host
#Copy file to the worspace
XCOPY "File current location" "Git workspace location"
#Add files to the local repo
git add -A
#Commits the file to local repo:
git commit -m "Files commited."
#Pushes the changes to Git repo
git -c http.extraheader='AUTHORIZATION: bearer $env:System_AccessToken' push -q -f
Upvotes: 0
Reputation: 40573
You should have sbt available on Ubuntu host agent. Here you have an example YAML code:
name: sbt
trigger:
- master
variables:
sbtFileDirectory: '<pass your folder where sbt file is>'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sbt clean
displayName: 'Running $ sbt clean'
workingDirectory: $(sbtFileDirectory)
- script: sbt update
displayName: 'Running $ sbt update'
workingDirectory: $(sbtFileDirectory)
- script: sbt compile
displayName: 'Running $ sbt compile'
workingDirectory: $(sbtFileDirectory)
- script: sbt test
displayName: 'Running $ sbt test'
workingDirectory: $(sbtFileDirectory)
With classic/release pipelines it would be similar:
You can also monitor this topic on developer community - Scala and SBT builder
Upvotes: 1