-
Notifications
You must be signed in to change notification settings - Fork 0
Add CI for push docker image #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5134e51
Add CI for push docker image
SelahattinSert 38e68fe
Update azure-pipelines.yml for Azure Pipelines
SelahattinSert ecc82ea
Update azure-pipelines.yml for Azure Pipelines
SelahattinSert 80aef30
Update azure-pipelines.yml for Azure Pipelines
SelahattinSert c50d4d0
Update azure-pipelines.yml for Azure Pipelines
SelahattinSert dff5be8
Update azure-pipelines.yml for Azure Pipelines
SelahattinSert 0b041a3
Update dockerf
SelahattinSert dca5ba0
Update azure-pipelines.yml
SelahattinSert 1290a8b
Update Dockerfile
SelahattinSert a4ae0f1
Refactor variables, remove latest tag
SelahattinSert e68890c
FiÅx variable handling
SelahattinSert 0f6a5e8
Add build version script
SelahattinSert c9e9782
Fix build version script
SelahattinSert 2d0b9d3
Fix build version script
SelahattinSert 6451c55
Fix build version script
SelahattinSert 2a1cdbf
Fix build version script
SelahattinSert 4b0afc2
Fix build version
SelahattinSert efa8a0a
Fix build version
SelahattinSert f70d2d7
Refactor build version tag
SelahattinSert 59b8ba7
Refactor build version tag
SelahattinSert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Docker | ||
| # Build and push an image to Azure Container Registry | ||
| # https://docs.microsoft.com/azure/devops/pipelines/languages/docker | ||
|
|
||
| trigger: | ||
| - main | ||
|
|
||
| resources: | ||
| - repo: self | ||
|
|
||
| variables: | ||
| dockerRegistryServiceConnection: '4c281479-6e31-4cb5-8e58-712d66f03a90' | ||
| imageRepository: 'cameraonboarding' | ||
| containerRegistry: 'acrcameraonboarding.azurecr.io' | ||
| dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' | ||
| buildVersion: $[format('{0:yyyyMMdd}-{1}', pipeline.startTime, variables['Build.SourceVersion'])] | ||
|
||
|
|
||
| stages: | ||
| - stage: Build | ||
| displayName: Build and push stage | ||
| jobs: | ||
| - job: Build | ||
| displayName: Build | ||
| pool: | ||
| name: "Default" | ||
| steps: | ||
| - script: | | ||
| echo "Checking if Docker is running..." | ||
| docker info || ( | ||
| echo "Docker is not running! Trying to start Docker..." | ||
| start-process -FilePath "C:\Program Files\Docker\Docker\Docker Desktop.exe" | ||
| ) | ||
| displayName: "Ensure Docker Daemon is Running (Windows)" | ||
| continueOnError: true | ||
|
|
||
| - task: Maven@4 | ||
| displayName: Build Maven | ||
| inputs: | ||
| mavenPomFile: 'pom.xml' | ||
| goals: 'clean package' | ||
| mavenOptions: '-Xmx3072m' | ||
| javaHomeOption: 'JDKVersion' | ||
| jdkVersionOption: '21' | ||
|
|
||
| - task: Docker@2 | ||
| displayName: Login to ACR | ||
| inputs: | ||
| command: login | ||
| containerRegistry: $(dockerRegistryServiceConnection) | ||
|
|
||
| - task: Docker@2 | ||
| displayName: Build Docker Image | ||
| inputs: | ||
| command: build | ||
| repository: $(imageRepository) | ||
| dockerfile: $(dockerfilePath) | ||
| arguments: "--platform linux/amd64" | ||
| tags: | | ||
| $(buildVersion) | ||
| latest | ||
ozgen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - task: Docker@2 | ||
| displayName: Push Docker Image | ||
| inputs: | ||
| command: push | ||
| repository: $(imageRepository) | ||
| tags: | | ||
| $(buildVersion) | ||
| latest | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.