Skip to content

Commit

Permalink
chore(ci): update composer-install step (#3427)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jan 9, 2020
1 parent 4fe0127 commit 9390224
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 42 deletions.
Binary file modified .azure/azure.sig
Binary file not shown.
4 changes: 3 additions & 1 deletion .azure/job-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
GH_TOKEN: $(GH_TOKEN)
GK_LOCK_DEBUG: true
- task: CacheBeta@0
- task: Cache@2
inputs:
key: yarn-v1 | yarn.lock
restoreKeys: |
yarn-v1
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- script: yarn inst
Expand Down
17 changes: 11 additions & 6 deletions .azure/step-composer-install.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
parameters:
no_dev: false
no_dev: 'false'

steps:
- task: CacheBeta@0
- task: Cache@2
inputs:
key: composer-v2 | composer.lock
key: 'composer-v2 | composer.lock'
restoreKeys: |
composer-v2
path: $(COMPOSER_HOME)/cache
displayName: Cache composer packages

- script: composer validate
displayName: Validate composer files

- ${{ if eq(coalesce(parameters.no_dev, false), true) }}:
- script: 'echo ##vso[task.setvariable variable=EXTRA_PARAM]--no-dev'
- ${{ if eq(coalesce(parameters.no_dev, 'false'), 'false') }}:
- script: echo '##vso[task.setvariable variable=EXTRA_PARAM]'
displayName: Set empty param
- ${{ if ne(coalesce(parameters.no_dev, 'false'), 'false') }}:
- script: echo '##vso[task.setvariable variable=EXTRA_PARAM]--no-dev'
displayName: Set extra param

- script: composer install --no-interaction --no-suggest --no-progress --ignore-platform-reqs $(EXTRA_PARAM)
- bash: composer install --no-interaction --no-suggest --no-progress --ignore-platform-reqs $EXTRA_PARAM
displayName: composer install
43 changes: 43 additions & 0 deletions .azure/step-deploy-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
steps:
- script: make dist
- bash: |
VERSION=$(php artisan monica:getversion)
echo "Monica version: $VERSION"
echo "##vso[task.setvariable variable=MONICA_VERSION]$VERSION"
displayName: Set Monica version

- task: CopyFiles@2
displayName: Copy monica assets
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)/results
contents: monica-assets-*.*
targetFolder: $(System.ArtifactStagingDirectory)/assets
- task: UniversalPackages@0
displayName: Universal Publish
inputs:
command: publish
publishDirectory: '$(System.ArtifactStagingDirectory)/assets'
vstsFeedPublish: 'monica'
versionOption: custom
versionPublish: $(MONICA_VERSION)
vstsFeedPackagePublish: 'monica-assets'
packagePublishDescription: 'Monica assets'

- task: CopyFiles@2
displayName: Copy monica release
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)/results
contents: |
monica-*.*
!monica-assets-*.*
targetFolder: $(System.ArtifactStagingDirectory)/release
- task: UniversalPackages@0
displayName: Universal Publish
inputs:
command: publish
publishDirectory: '$(System.ArtifactStagingDirectory)/release'
vstsFeedPublish: 'monica'
versionOption: custom
versionPublish: $(MONICA_VERSION)
vstsFeedPackagePublish: 'monica'
packagePublishDescription: 'Monica release'
12 changes: 8 additions & 4 deletions .azure/step-runsonar.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
steps:
- task: CacheBeta@0
- task: Cache@2
inputs:
key: sonarscanner-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh
key: 'sonarscanner-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh'
restoreKeys: |
sonarscanner-v1 | "$(SONAR_VERSION)"
path: $(HOME)/sonarscanner
displayName: Cache sonar scanner
- task: CacheBeta@0
- task: Cache@2
inputs:
key: sonarcache-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh
key: 'sonarcache-v1 | "$(SONAR_VERSION)" | scripts/tests/runsonar.sh'
restoreKeys: |
sonarcache-v1 | "$(SONAR_VERSION)"
path: $(HOME)/.sonar
displayName: Cache sonar cache

Expand Down
66 changes: 35 additions & 31 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,50 +34,54 @@ stages:
- template: .azure/job-reporting.yml
- template: .azure/job-test-migrations.yml


- stage: deploy
displayName: 'Deploy'
dependsOn: build
condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')
jobs:
- job: deployAssets
pool:
vmImage: 'ubuntu-latest'
steps:
- script: make assets
- script: make push_bintray_assets
env:
BINTRAY_USER: $(BINTRAY_USER)
BINTRAY_APIKEY: $(BINTRAY_APIKEY)

- job: deploy_dist
jobs:
- deployment: deploy_dist
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .azure/step-composer-install.yml
parameters:
no_dev: 'true'
- script: make dist
- script: make push_bintray_dist
env:
BINTRAY_USER: $(BINTRAY_USER)
BINTRAY_APIKEY: $(BINTRAY_APIKEY)
environment: 'monica'
strategy:
runOnce:
deploy:
steps:
- download: none
- checkout: self
- template: .azure/step-composer-install.yml
parameters:
no_dev: 'true'
- template: .azure/step-deploy-dist.yml

- job: deploy_docker_master
- deployment: deploy_docker_master
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .azure/step-prepare-environment.yml
- template: .azure/step-docker-build.yml
- template: .azure/step-docker-push-github.yml
environment: 'monica'
strategy:
runOnce:
deploy:
steps:
- download: none
- checkout: self
- template: .azure/step-docker-build.yml
- template: .azure/step-docker-push-github.yml

- job: deploy_docker
- deployment: deploy_docker
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: 'ubuntu-latest'
steps:
- template: .azure/step-prepare-environment.yml
- template: .azure/step-docker-build.yml
- template: .azure/step-docker-push-github.yml
- template: .azure/step-docker-push.yml
environment: 'monica'
strategy:
runOnce:
deploy:
steps:
- download: none
- checkout: self
- template: .azure/step-docker-build.yml
- template: .azure/step-docker-push-github.yml
- template: .azure/step-docker-push.yml

0 comments on commit 9390224

Please sign in to comment.