No package found with specified pattern: D:\a\r1\a\**\*.zip - reactjs

I created a build definition in vsts with npm build and then I copy the build folder to the drop location.
The build pipeline is working fine
Then I created the release definition and it downloads the files correctly also:
2018-08-10T16:29:18.5241580Z Downloading artifact drop from: https://xx.visualstudio.com//_apis/resources/Containers/711976?itemPath=drop&isShallow=true&api-version=4.1-preview.4
2018-08-10T16:29:18.5252684Z Downloading drop/s/build/asset-manifest.json to D:\a\r1\a\InnovationInABox-CI\drop\s\build\asset-manifest.json
2018-08-10T16:29:18.5253850Z Downloaded drop/s/build/asset-manifest.json to D:\a\r1\a\InnovationInABox-CI\drop\s\build\asset-manifest.json
2018-08-10T16:29:18.5338277Z Downloading drop/s/build/favicon.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\favicon.png
2018-08-10T16:29:18.5338720Z Downloaded drop/s/build/favicon.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\favicon.png
2018-08-10T16:29:19.5191236Z Downloading drop/s/build/index.html to D:\a\r1\a\InnovationInABox-CI\drop\s\build\index.html
2018-08-10T16:29:19.5191520Z Downloaded drop/s/build/index.html to D:\a\r1\a\InnovationInABox-CI\drop\s\build\index.html
2018-08-10T16:29:19.5195415Z Downloading drop/s/build/manifest.json to D:\a\r1\a\InnovationInABox-CI\drop\s\build\manifest.json
2018-08-10T16:29:19.5195775Z Downloaded drop/s/build/manifest.json to D:\a\r1\a\InnovationInABox-CI\drop\s\build\manifest.json
2018-08-10T16:29:19.5198280Z Downloading drop/s/build/service-worker.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\service-worker.js
2018-08-10T16:29:19.5198598Z Downloaded drop/s/build/service-worker.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\service-worker.js
2018-08-10T16:29:19.5704236Z Downloading drop/s/build/css/ionicons.min.css to D:\a\r1\a\InnovationInABox-CI\drop\s\build\css\ionicons.min.css
2018-08-10T16:29:19.5725284Z Downloaded drop/s/build/css/ionicons.min.css to D:\a\r1\a\InnovationInABox-CI\drop\s\build\css\ionicons.min.css
2018-08-10T16:29:19.5833575Z Downloading drop/s/build/iconfont/iconfont.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.svg
2018-08-10T16:29:19.5868415Z Downloading drop/s/build/fonts/ionicons.eot to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.eot
2018-08-10T16:29:19.5901623Z Downloading drop/s/build/fonts/ionicons.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.svg
2018-08-10T16:29:19.5922072Z Downloaded drop/s/build/iconfont/iconfont.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.svg
2018-08-10T16:29:19.5967502Z Downloading drop/s/build/iconfont/iconfont.ttf to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.ttf
2018-08-10T16:29:19.5990580Z Downloaded drop/s/build/fonts/ionicons.eot to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.eot
2018-08-10T16:29:19.6014585Z Downloading drop/s/build/iconfont/iconfont.eot to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.eot
2018-08-10T16:29:19.6041800Z Downloaded drop/s/build/iconfont/iconfont.ttf to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.ttf
2018-08-10T16:29:19.6082471Z Downloading drop/s/build/fonts/ionicons.woff to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.woff
2018-08-10T16:29:19.6355639Z Downloading drop/s/build/fonts/ionicons.ttf to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.ttf
2018-08-10T16:29:19.6356035Z Downloaded drop/s/build/fonts/ionicons.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.svg
2018-08-10T16:29:19.6609672Z Downloaded drop/s/build/iconfont/iconfont.eot to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.eot
2018-08-10T16:29:19.6614749Z Downloading drop/s/build/images/icons/icon-128x128.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-128x128.png
2018-08-10T16:29:19.6649976Z Downloaded drop/s/build/images/icons/icon-128x128.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-128x128.png
2018-08-10T16:29:19.6691472Z Downloaded drop/s/build/fonts/ionicons.woff to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.woff
2018-08-10T16:29:19.6715380Z Downloading drop/s/build/images/icons/icon-144x144.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-144x144.png
2018-08-10T16:29:19.6721599Z Downloaded drop/s/build/fonts/ionicons.ttf to D:\a\r1\a\InnovationInABox-CI\drop\s\build\fonts\ionicons.ttf
2018-08-10T16:29:19.6730634Z Downloaded drop/s/build/images/icons/icon-144x144.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-144x144.png
2018-08-10T16:29:19.6925986Z Downloading drop/s/build/images/icons/icon-192x192.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-192x192.png
2018-08-10T16:29:19.6932585Z Downloaded drop/s/build/images/icons/icon-192x192.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-192x192.png
2018-08-10T16:29:19.7051155Z Downloading drop/s/build/images/icons/icon-384x384.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-384x384.png
2018-08-10T16:29:19.7068272Z Downloaded drop/s/build/images/icons/icon-384x384.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-384x384.png
2018-08-10T16:29:19.7128194Z Downloading drop/s/build/static/css/main.1338bde0.css to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\css\main.1338bde0.css
2018-08-10T16:29:19.7136566Z Downloading drop/s/build/images/icons/icon-72x72.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-72x72.png
2018-08-10T16:29:19.7139811Z Downloaded drop/s/build/images/icons/icon-72x72.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-72x72.png
2018-08-10T16:29:19.7210596Z Downloaded drop/s/build/static/css/main.1338bde0.css to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\css\main.1338bde0.css
2018-08-10T16:29:19.7331736Z Downloading drop/s/build/static/js/1.f6d2865a.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\1.f6d2865a.chunk.js
2018-08-10T16:29:19.7336557Z Downloaded drop/s/build/static/js/1.f6d2865a.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\1.f6d2865a.chunk.js
2018-08-10T16:29:19.7384208Z Downloading drop/s/build/static/js/2.194ad0ec.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\2.194ad0ec.chunk.js
2018-08-10T16:29:19.7388897Z Downloaded drop/s/build/static/js/2.194ad0ec.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\2.194ad0ec.chunk.js
2018-08-10T16:29:19.7493081Z Downloading drop/s/build/images/icons/icon-512x512.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-512x512.png
2018-08-10T16:29:19.7505060Z Downloaded drop/s/build/images/icons/icon-512x512.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-512x512.png
2018-08-10T16:29:19.7521694Z Downloading drop/s/build/images/icons/icon-96x96.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-96x96.png
2018-08-10T16:29:19.7524304Z Downloaded drop/s/build/images/icons/icon-96x96.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-96x96.png
2018-08-10T16:29:19.7531569Z Downloading drop/s/build/images/icons/icon-152x152.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-152x152.png
2018-08-10T16:29:19.7544109Z Downloading drop/s/build/iconfont/iconfont.woff to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.woff
2018-08-10T16:29:19.7561190Z Downloaded drop/s/build/images/icons/icon-152x152.png to D:\a\r1\a\InnovationInABox-CI\drop\s\build\images\icons\icon-152x152.png
2018-08-10T16:29:19.7583131Z Downloaded drop/s/build/iconfont/iconfont.woff to D:\a\r1\a\InnovationInABox-CI\drop\s\build\iconfont\iconfont.woff
2018-08-10T16:29:19.7615220Z Downloading drop/s/build/static/js/4.0230ee4e.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\4.0230ee4e.chunk.js
2018-08-10T16:29:19.7620680Z Downloaded drop/s/build/static/js/4.0230ee4e.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\4.0230ee4e.chunk.js
2018-08-10T16:29:19.8139663Z Downloading drop/s/build/static/media/sign.adf5846b.jpg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\sign.adf5846b.jpg
2018-08-10T16:29:19.8209000Z Downloaded drop/s/build/static/media/sign.adf5846b.jpg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\sign.adf5846b.jpg
2018-08-10T16:29:19.8445251Z Downloading drop/s/build/static/media/uk.bc48afcc.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\uk.bc48afcc.svg
2018-08-10T16:29:19.8451360Z Downloaded drop/s/build/static/media/uk.bc48afcc.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\uk.bc48afcc.svg
2018-08-10T16:29:19.9315367Z Downloading drop/s/build/static/media/france.bcd389de.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\france.bcd389de.svg
2018-08-10T16:29:19.9316203Z Downloading drop/s/build/static/media/spain.6a9dc11f.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\spain.6a9dc11f.svg
2018-08-10T16:29:19.9316588Z Downloaded drop/s/build/static/media/france.bcd389de.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\france.bcd389de.svg
2018-08-10T16:29:19.9317287Z Downloaded drop/s/build/static/media/spain.6a9dc11f.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\spain.6a9dc11f.svg
2018-08-10T16:29:19.9430066Z Downloading drop/s/build/static/media/italy.604345b4.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\italy.604345b4.svg
2018-08-10T16:29:19.9430433Z Downloaded drop/s/build/static/media/italy.604345b4.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\italy.604345b4.svg
2018-08-10T16:29:20.0800791Z Downloading drop/s/build/static/js/3.06bbf4d1.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\3.06bbf4d1.chunk.js
2018-08-10T16:29:20.0801318Z Downloaded drop/s/build/static/js/3.06bbf4d1.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\3.06bbf4d1.chunk.js
2018-08-10T16:29:20.0962282Z Downloading drop/s/build/static/js/0.cdfd5bd5.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\0.cdfd5bd5.chunk.js
2018-08-10T16:29:20.0962659Z Downloaded drop/s/build/static/js/0.cdfd5bd5.chunk.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\0.cdfd5bd5.chunk.js
2018-08-10T16:29:20.1118659Z Downloading drop/s/build/static/js/main.03f3e98f.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\main.03f3e98f.js
2018-08-10T16:29:20.1541007Z Downloaded drop/s/build/static/js/main.03f3e98f.js to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\js\main.03f3e98f.js
2018-08-10T16:29:20.1566610Z Downloading drop/s/build/static/media/china.4e4d59b7.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\china.4e4d59b7.svg
2018-08-10T16:29:20.1569167Z Downloaded drop/s/build/static/media/china.4e4d59b7.svg to D:\a\r1\a\InnovationInABox-CI\drop\s\build\static\media\china.4e4d59b7.svg
2018-08-10T16:29:21.1552541Z Total Files: 35, Processed: 35, Skipped: 0, Failed: 0, Download time: 3.288 secs, Download size: 1.320MB
2018-08-10T16:29:21.1844380Z Successfully downloaded artifacts to D:\a\r1\a/InnovationInABox-CI
2018-08-10T16:29:21.1897267Z ##[section]Finishing: Download artifact - InnovationInABox-CI
But the next step, is to deploy to an Azure web app: but I get this error:
2018-08-10T16:29:21.8347426Z Got connection details for Azure App Service:'uiapp'
2018-08-10T16:29:24.0708659Z ##[error]Error: No package found with specified pattern: D:\a\r1\a\**\*.zip
2018-08-10T16:29:26.8772211Z Successfully updated deployment History at https://xxx.scm.azurewebsites.net/api/deployments/81533918564296
2018-08-10T16:29:26.8855771Z ##[section]Finishing: Deploy Azure App Service
How can I copy all those files from the build folder (which are not in a .zip file) to Azure webapp?

In my case (build .sln with c# project from azure git) the build was saving the package in D:\a\1\a\ folder (instead of r1\a) and I wasn't able to edit the build steps in the UI so I edited the newly added azure-pipelines.yml file and added one more task at the very end:
- task: PublishBuildArtifacts#1
This copies the .zip package to a "drop" location (r1/a) which the Release Pipeline expects.
​And now the Release Pipeline is finding the file in r1/a folder.

If you are using "Azure App Service Deploy" task, set the "Package or folder" path to: $(System.DefaultWorkingDirectory)\InnovationInABox-CI\drop\s\build.

For anyone else experiencing this problem using Azure DevOps, it's useful to turn on debug mode. For your release, define the pipeline variable System.Debug with value true.
That gave me this output which was much more useful:
Now at least I know it's on my target VM and the path is probably wrong.

You can't use wildcards for folder names unfortunately, only for file names. If you're using a 'Copy Files' build task you can put this value in 'Source Folder':
D:\a\r1\a\
and this value in 'Contents':
**\*.zip
Or you can put the full file directories with *.zip. Good luck.

First i think you should add artifacts1 then attach it to the packages2

In my case (react app deployed as static content to app service) I needed to add a step to archive the build directory before publishing it:
- task: ArchiveFiles#2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/build'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
- publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: '$(Build.BuildId)'

Per Azure official document for setting up Pipelines (YAML files) for Node.js, Javascript apps from this link https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code
Configure the YAML file as below:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool#0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- task: CopyFiles#2
inputs:
Contents: 'build/**' # Pull the build directory (React)
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts#1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory) # dist or build files
ArtifactName: 'www' # output artifact named www
On the latest version of Azure Devops, edit Release under Pipeline. Note that Build section has been taken off in the latest version (as of June 2020), so some older answers/docs was not working.
Click on Deploy Azure App Services and on the right panel click on ...(Expand Folder) for Package or folder Option
Under Linked Artifacts => MyProject (Build) => www, select dist folder.
Save this and then create release, this should solve the error [error]Error: No package found with the specified pattern: D:\a\r1\a\**\*.zip<br/>

I used the below task in Azure DevOps release yaml pipeline for deployment of azure function app and set the package to $(System.DefaultWorkingDirectory) and it worked for me.
- task: AzureFunctionApp#1
inputs:
azureSubscription: XXXXXXXXX
appType: 'functionApp'
appName: 'funcapp-test'
package: '$(System.DefaultWorkingDirectory)'
appSettings:
deploymentMethod: 'auto'

In my case I use azure template but change vmImage: "windows-latest", When I check logs, find out build command didn't run so I figure out I should change default script of install and build to separate script
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
buildFolder: 'build'
steps:
- task: NodeTool#0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- script: |
npm run build
displayName: 'npm build'
- task: CopyFiles#2
inputs:
contents: 'build/**'
targetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
- task: ArchiveFiles#2
inputs:
rootFolderOrFile: $(Build.ArtifactStagingDirectory)
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
includeRootFolder: false
- task: PublishBuildArtifacts#1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
artifactName: 'drop'
publishLocation: 'Container'

Just went through this again. What worked for me was modifying "Package or folder" to use Agent.ReleaaseDirectory. Screenshot below, may it save someone else the angst.

Related

Gitlab Ci/CD Creating Setup for WPF Application

I have created a WPF project. It is using .net6 (no Blazor or Razor), and it is using WebView2. The Problem I have is with automated creating a Setup.exe or Msi File or what ever. And I already have a setup.exe, but something is strange with the executable of my application after installing my application with the setup.exe What I tried: WIX (but I got a tip of using innosetup, because it's free and easy to use) So I tried innosetup, and I am so extremely close to got it to work, that I do not want to give up yet. I achieved to create my Setup.iis file and I created a setup.exe. For this I used Gitlab-CE and a Runner. And the amake/innosetup image This one here
Tool_Build:
stage: build
image: mcr.microsoft.com/dotnet/sdk:6.0
only:
- master
script:
- dotnet build "$CI_PROJECT_DIR/Tool/Tool.csproj" /p:Version=$VERSION --configuration Release
- dotnet publish -p:PublishProfile=FolderProfile
tags:
- runner
artifacts:
expire_in: 1 day
paths:
- "$CI_PROJECT_DIR/Tool/bin/publish"
- "$CI_PROJECT_DIR/ATASetup.iss"
Tool_Setup:
stage: setup
image:
name: amake/innosetup
entrypoint: [""]
dependencies:
- Tool_Build
only:
- master
tags:
- runner
script:
- iscc "ATASetup.iss"
artifacts:
expire_in: 1 day
paths:
- "Output/Setup.exe"
The current problem I have is. when I install my application. It runs, BUT the EXE works strange. It opens a console, and this opens my application. When I use the EXE in my "publish" folder of the project, everything works well. When I use my innosetup on my pc manually, it works perfect. Has anyone some help for me? I am just a beginner, and I am so close to get it done (i hope )
in short: i am relatively new to programming and CI/CD.
i just could need a patient helping hand =)

Release fails when deploying React app to Azure Web App with Azure DevOps

I cannot get a Release pipeline in Azure DevOps to successfully deploy build files from a React app to an Azure App Service.
This is the YAML file for the app:
trigger:
- main
variables:
buildConfiguration: 'Release'
stages:
- stage: Build
displayName: 'Build my web application'
jobs:
- job: 'Build'
displayName: 'Build job'
pool:
vmImage: ubuntu-latest
demands:
- npm
steps:
- task: NodeTool#0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: 'build'
ArtifactName: 'drop'
publishLocation: 'Container'
displayName: 'Build artifact'
As you'd expect, this puts the resultant build files in 'drop'. I can confirm this by inspecting the contents of 'drop' as it is a Published Artifact I can click on in the Summary tab for the Build process.
It's the Release that fails. This is the log for the release:
2022-03-28T11:29:39.9940600Z ##[section]Starting: Azure Web App Deploy: my-app-serv
2022-03-28T11:29:39.9952321Z ==============================================================================
2022-03-28T11:29:39.9952723Z Task : Azure Web App
2022-03-28T11:29:39.9953008Z Description : Deploy an Azure Web App for Linux or Windows
2022-03-28T11:29:39.9953295Z Version : 1.200.0
2022-03-28T11:29:39.9953540Z Author : Microsoft Corporation
2022-03-28T11:29:39.9953833Z Help : https://aka.ms/azurewebapptroubleshooting
2022-03-28T11:29:39.9954210Z ==============================================================================
2022-03-28T11:29:40.3697650Z Got service connection details for Azure App Service:'my-app-serv'
2022-03-28T11:29:42.3999385Z Package deployment using ZIP Deploy initiated.
2022-03-28T11:30:18.0663125Z Updating submodules.
2022-03-28T11:30:18.0670674Z Preparing deployment for commit id 'dc023bbe-d'.
2022-03-28T11:30:18.0672154Z Repository path is /tmp/zipdeploy/extracted
2022-03-28T11:30:18.0673178Z Running oryx build...
2022-03-28T11:30:19.1423345Z Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 16 -i /tmp/8da10ae4b1f9200 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log
2022-03-28T11:30:19.1431972Z Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
2022-03-28T11:30:19.1453191Z You can report issues at https://github.com/Microsoft/Oryx/issues
2022-03-28T11:30:19.1453685Z
2022-03-28T11:30:19.1454256Z Oryx Version: 0.2.20211207.1, Commit: 46633df49cc8fbe9718772a3c894df221273b2af, ReleaseTagName: 20211207.1
2022-03-28T11:30:19.1457307Z
2022-03-28T11:30:19.1463475Z Build Operation ID: |DTbD+7CrQyM=.49dfa157_
2022-03-28T11:30:19.1465355Z Repository Commit : dc023bbe-d46e-46f2-9d49-6e8157706c19
2022-03-28T11:30:19.1465695Z
2022-03-28T11:30:19.1466122Z Detecting platforms...
2022-03-28T11:30:19.1466558Z Could not detect any platform in the source directory.
2022-03-28T11:30:19.1467416Z Error: Couldn't detect a version for the platform 'nodejs' in the repo.
2022-03-28T11:30:19.1469069Z Error: Couldn't detect a version for the platform 'nodejs' in the repo.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 16 -i /tmp/8da10ae4b1f9200 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log
2022-03-28T11:30:19.1469950Z Deployment Failed.
2022-03-28T11:30:19.1510175Z ##[error]Failed to deploy web package to App Service.
2022-03-28T11:30:19.1525344Z ##[error]To debug further please check Kudu stack trace URL : https://$my-app-serv:***#my-app-serv.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace
2022-03-28T11:30:19.1527823Z ##[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
2022-03-28T11:30:30.1233247Z Successfully added release annotation to the Application Insight : my-app-serv
2022-03-28T11:30:32.2997996Z Successfully updated deployment History at (CUT)
2022-03-28T11:30:34.0322983Z App Service Application URL: http://my-app-serv.azurewebsites.net
2022-03-28T11:30:34.0390276Z ##[section]Finishing: Azure Web App Deploy: my-app-serv
The Release uses Azure Web App Deploy. App Type is 'Web App on Linux'. 'Package or Folder' is the 'drop' folder. Runtime stack is '16 LTS (NODE|16-lts)' (but it also doesn't work if that's empty).
The drop folder does not contain zipped output. I don't understand why the Release operation is referred to as a Zip Deploy. Am I missing something to avoid the error 'Error: Couldn't detect a version for the platform 'nodejs' in the repo.'?
I'm just expecting the contents in the 'drop' folder to be successfully copied to App Service, and the web app run so I can test it (and in the long time, setup automated tests).
I've tried a number of different things with the Build, including zipping the build artifacts, with no luck. I don't think the build is the problem though, as the files in the 'drop' folder are the files I want copied.
So I think it's the Release that's the problem. But that looks so simple.
I start with an Agent and add an Azure Web App deployment task. It seems to successfully pickup the drop folder, as I've tried other values that show an obvious error when that is wrong. The target App Service is Linux, so the Web App Deploy App type is set to 'Web App on Linux'.
I've seen a few different approaches in stackoverflow, but no answers to this approach. Maybe I'm going about this the wrong way, but on the surface it looks right, as if I get this right, I can easily manage manual deployments, authorisations, etc. as supported by Releases.
Thanks in advance
One of the possible workarounds that you can try is to make the SCM_DO_BUILD_DURING_DEPLOYMENT= FALSE.
After making this as false, you should be able to deploy the app.
Also please refer these links with similar issue for more information.
Reference 1 ,
Reference 2

Deploying to Azure Linux Web App I get To import Sass files, you first need to install node-sass

When I deploy my React App which was created using Create-React-App to Azure Web App on Linux I get the following when I browse to the website?
To import Sass files, you first need to install node-sass.
When I run this locally everything is fine (Running from a Mac). I have checked the DevOps deployment log and that reports it installed node-sass without issue. I have also tried to delete the node-sass folder in node_modules and npm install. This added node-sass again without issue but still I get the error?
Has anyone come across this before or have any suggestions?
This is the Yaml File.
# Node.js React Web App to Linux on Azure
# Build a Node.js React app and deploy it to Azure as a Linux web app.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: '<Remove for Security>'
# Web app name
webAppName: '<Remove for Security>'
# Environment name
environmentName: '<Remove for Security>'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: ArchiveFiles#2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: drop
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Deploy
displayName: Deploy
environment: $(environmentName)
pool:
vmImage: $(vmImageName)
strategy:
runOnce:
deploy:
steps:
- task: AzureRmWebAppDeployment#4
displayName: 'Azure App Service Deploy: <Remove for Security>'
inputs:
azureSubscription: $(azureSubscription)
appType: webAppLinux
WebAppName: $(webAppName)
packageForLinux: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
RuntimeStack: 'NODE|10.10'
StartupCommand: 'npm run start'
ScriptType: 'Inline Script'
InlineScript: |
npm install
npm run build --if-present
I had a similar issue with another node package. In such cases where node packages do not get resolved try installing your node package globally using -g flag.

Is it possible to create an apk in Ionic 4 - (React) via CLI only?

I want to generate an apk for an Ionic-React app, only using the command-line.
I am able to use Ionic Capacitor to make an apk via Android-Studio, but I want to purely use the CLI to generate the same apk. Is this possible to do? Thanks.
I have since solved this issue and am now able to build an Ionic React app apk on Azure dev-ops without having to interact with Android studio at all.
Here is the YAML -
Firstly - Building the Ionic project
trigger:
- master
variables:
scheme: ''
sdk: 'iphoneos'
configuration: 'Release'
pool:
vmImage: 'macos-latest'
steps:
- task: UseNode#1
inputs:
checkLatest: true
- task: Npm#1
inputs:
command: 'install'
- script: npm run citest
- task: Npm#1
inputs:
command: 'custom'
customCommand: 'install -g ionic'
- task: CmdLine#2
inputs:
script: 'ionic build --prod'
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: 'build'
ArtifactName: 'drop'
publishLocation: 'Container'
Secondly - Building .apk
- task: CmdLine#2
inputs:
script: 'ionic capacitor add android'
- task: PythonScript#0
inputs:
scriptSource: 'filePath'
scriptPath: 'changeGradle.py'
arguments: '--version=$(Build.BuildId)'
- task: CopyFiles#2
inputs:
SourceFolder: 'resources/androidResources/res'
Contents: '**'
TargetFolder: 'android/app/src/main/res'
OverWrite: true
- task: Gradle#2
inputs:
workingDirectory: 'android'
gradleWrapperFile: 'android/gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'build'
- task: AndroidSigning#3
inputs:
apkFiles: 'android/app/build/outputs/apk/release/*.apk'
apksignerKeystoreFile: XXX.jks
apksignerKeystorePassword: 'XXX'
apksignerKeystoreAlias: 'XXX'
apksignerKeyPassword: 'XXX'
zipalign: true
- task: CopyFiles#2
inputs:
Contents: '**/*'
TargetFolder: '$(build.artifactStagingDirectory)'
- task: PublishPipelineArtifact#1
inputs:
targetPath: '$(Build.artifactStagingDirectory)'
publishLocation: 'pipeline'
Publishing the .apk to Google Play internal track is handled in the Azure release pipeline (not build).
The PythonScript command is a custom script I wrote to change the Gradlew build no. as no other solutions seemed to work for me.
I hope this helps someone as this was a nightmare to figure out on my own!
So when you install and configure Ionic for Android you need to follow this guide here:
https://ionicframework.com/docs/installation/android
Then you can build your hybrid apps:
https://ionicframework.com/docs/publishing/play-store
For apps that leverage Cordova you need to have Android Studio & SDK installed, but you do not have to use them directly, ionic CLI will do it for you when you are using commands like:
$ionic cordova build android --prod --release
For apps using Capacitor there is currently no way to avoid using Xcode or Studio:
https://capacitor.ionicframework.com/docs/basics/building-your-app

Cloud Container Builder, ZIP does not support timestamps before 1980

I'm trying the following tutorial.
Automatic serverless deployments with Cloud Source Repositories and Container Builder
But I got the error below.
$ gcloud container builds submit --config deploy.yaml .
BUILD
Already have image (with digest): gcr.io/cloud-builders/gcloud
ERROR: (gcloud.beta.functions.deploy) Error creating a ZIP archive with the source code for directory .: ZIP does not support timestamps before 1980
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/gcloud" failed: exit status 1
I'm now trying to solve it. Do you have any idea? My gcloud is the latest version.
$ gcloud -v
Google Cloud SDK 193.0.0
app-engine-go
app-engine-python 1.9.67
beta 2017.09.15
bq 2.0.30
core 2018.03.09
gsutil 4.28
Sample google cloud function code on the tutorial.
#index.js
exports.f = function(req, res) {
res.send("hello, gcf!");
};
#deploy.yaml
steps:
- name: gcr.io/cloud-builders/gcloud
args:
- beta
- functions
- deploy
- --trigger-http
- --source=.
- --entry-point=f
- hello-gcf # Function name
#deploying without Cloud Container Builder is fine.
gcloud beta functions deploy --trigger-http --source=. --entry-point=f hello-gcf
Container Builder tars your source folder. Maybe something in your . directory has corrupted dates? That's why moving it to the source folder fixes it.
While I don't know the reason, I found a workaround.
(1) make src directory and move index.js into it.
├── deploy.yaml
└── src
└── index.js
(2) deploy via Cloud Container Builder.
$ gcloud container builds submit --config deploy.yaml ./src
I ran into the same issue now. I could not solve it but at least I found out where it comes from.
When you locally submit your build there is a tar created and uploaded to a bucket. In this tar the folders are created at 01.01.1970:
16777221 8683238 drwxr-xr-x 8 user staff 0 256 "Jan 1 01:00:00 1970" "Jan 1 01:00:00 1970" "May 15 12:42:04 2019" "Jan 1 01:00:00 1970" 4096 0 0 test
This issue only occurs locally. If you have a github build trigger it works
I recently came across the same issue using Cloud Build (the successor to Container Builder).
What helped was adding a step to list all the files/folders in the Cloud Build environment (default directory is /workspace) to identify the problematic file/folder. You can do this by overriding the gcloud container's entrypoint to execute the ls command.
steps
- name: gcr.io/cloud-builders/gcloud
entrypoint: "ls"
args: ["-la", "/workspace"]

Resources