Trying to deploy react app to the azure web app using GitHub action & resources will be created dynamically under a single resource group which defaults to asgithub-RG using service principal account as a contributor to asgithub-RG resource group
Steps which I followed
Login with CLI
Create an app service plan based on PR details and name
Create a web app based on PR details and name
npm ci and npm build
Upload artifacts
Download artifacts
deployed to azure
Github action
name: Deploy Pull Request to Azure Web App
on:
pull_request:
branches: [ "develop" ]
types: [opened, synchronize, closed]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }} # get branch name from pull request
PR_NUMBER: ${{ github.event.pull_request.number }}
AZURE_WEBAPP_NAME: ${{ github.event.pull_request.head.repo.name }}-${{ github.event.pull_request.head.ref }} # add GTCRM- prefix to branch name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '18-lts' # set this to the node version to use
RESOURCE_GROUP: 'asgithub-RG'
permissions:
contents: read
pull-requests: write
actions: write
jobs:
pre-build:
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
- name: Login via Azure CLI
uses: azure/login#v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Create a new resource group to hold the deployment slot
- name: Create App service plan
uses: Azure/cli#v1
with:
inlineScript: |
az appservice plan create --name ${{ env.AZURE_WEBAPP_NAME }}-${{ env.PR_NUMBER }}-plan --resource-group ${{ env.RESOURCE_GROUP }} --sku B1 --is-linux
# Set the deployment slot's app setting to point to the staging slot
- name: Set app setting
uses: Azure/cli#v1
with:
inlineScript: |
az webapp create --resource-group ${{ env.RESOURCE_GROUP }} --plan ${{ env.AZURE_WEBAPP_NAME }}-${{ env.PR_NUMBER }}-plan --name ${{ env.AZURE_WEBAPP_NAME }}-${{ env.PR_NUMBER }} --runtime "NODE:${{ env.NODE_VERSION }}" --output table
build:
runs-on: ubuntu-latest
needs: pre-build
steps:
- uses: actions/checkout#v3
- name: Set up Node.js
uses: actions/setup-node#v3
with:
node-version: 18.4.0
cache: 'npm'
# Cache node_modules
- name: Cache node_modules
uses: actions/cache#v3.1.0-beta.2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
# Install dependencies
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm install
npm run ci --if-present
# tar the build folder
- name: Zip Package
run: |
zip -r node-app.zip .
# Upload the zip file to the deployment slot
- name: Upload artifact for deployment job
uses: actions/upload-artifact#v3
with:
name: node-app
path: node-app.zip
# Deploy the zip file to the deployment slot
deploy:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
needs: build
environment:
name: 'Development'
steps:
- name: Download artifact from build job
uses: actions/download-artifact#v3
with:
name: node-app
# #Unpack the artifact
# - name: Unzip artifact
# run: unzip node-app.zip
- name: Login via Azure CLI
uses: azure/login#v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: 'Deploy to Azure WebApp'
id: deploy-to-webapp
uses: Azure/webapps-deploy#v2.2.5
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}-${{ env.PR_NUMBER }}
package: node-app.zip
Problem 1:
I executed from one GitHub repo all 7 steps are executing fine in GitHub and deployment is getting failed in the azure web app
logs
2022-12-10T10:54:48.581727176Z: \[INFO\] \____\_
2022-12-10T10:54:48.581757676Z: \[INFO\] / \_ \\ \_________\_ \________\_ \___\_
2022-12-10T10:54:48.581762376Z: \[INFO\] / /_\\ \\_\_\_ / | \_ \_\_ \_/ \_\_ \\
2022-12-10T10:54:48.581765977Z: \[INFO\] / | / /| | /| | /\\ \__\_/
2022-12-10T10:54:48.581769477Z: \[INFO\] \____|__ /_\___\_ \____/ |__| \__\_ \>
2022-12-10T10:54:48.581773177Z: \[INFO\] / / /
2022-12-10T10:54:48.581776477Z: \[INFO\] A P P S E R V I C E O N L I N U X
2022-12-10T10:54:48.581779777Z: \[INFO\]
2022-12-10T10:54:48.581782777Z: \[INFO\] Documentation: http://aka.ms/webapp-linux
2022-12-10T10:54:48.581785977Z: \[INFO\] NodeJS quickstart: https://aka.ms/node-qs
2022-12-10T10:54:48.581788977Z: \[INFO\] NodeJS Version : v18.12.0
2022-12-10T10:54:48.581792277Z: \[INFO\] Note: Any data outside '/home' is not persisted
2022-12-10T10:54:48.581795477Z: \[INFO\]
2022-12-10T10:54:49.216708277Z: \[INFO\] Starting OpenBSD Secure Shell server: sshd.
2022-12-10T10:54:49.446358441Z: \[INFO\] Starting periodic command scheduler: cron.
2022-12-10T10:54:49.598691233Z: \[INFO\] Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2022-12-10T10:54:49.606104102Z: \[INFO\] Could not find operation ID in manifest. Generating an operation id...
2022-12-10T10:54:49.606179104Z: \[INFO\] Build Operation ID: 5aceb568-51a8-4ee6-9f9d-835f90d52e7a
2022-12-10T10:54:50.732891663Z: \[INFO\] Environment Variables for Application Insight's IPA Codeless Configuration exists..
2022-12-10T10:54:50.895699980Z: \[INFO\] Writing output script to '/opt/startup/startup.sh'
2022-12-10T10:54:51.128069973Z: \[INFO\] Running #!/bin/sh
2022-12-10T10:54:51.128097374Z: \[INFO\]
2022-12-10T10:54:51.128102674Z: \[INFO\] # Enter the source directory to make sure the script runs where the user expects
2022-12-10T10:54:51.128106774Z: \[INFO\] cd "/home/site/wwwroot"
2022-12-10T10:54:51.128110674Z: \[INFO\]
2022-12-10T10:54:51.128114474Z: \[INFO\] export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2022-12-10T10:54:51.128118574Z: \[INFO\] if \[ -z "$PORT" \]; then
2022-12-10T10:54:51.128122474Z: \[INFO\] export PORT=8080
2022-12-10T10:54:51.128126674Z: \[INFO\] fi
2022-12-10T10:54:51.128130374Z: \[INFO\]
2022-12-10T10:54:51.215962971Z: \[INFO\] npm start
2022-12-10T10:54:53.801869544Z: \[ERROR\] npm info it worked if it ends with ok
2022-12-10T10:54:53.803157767Z: \[ERROR\] npm info using npm#6.14.15
2022-12-10T10:54:53.812627941Z: \[ERROR\] npm info using node#v18.12.0
2022-12-10T10:54:55.390189353Z: \[ERROR\] npm info lifecycle my-app#0.1.0\~prestart: my-app#0.1.0
2022-12-10T10:54:55.449869038Z: \[ERROR\] npm info lifecycle my-app#0.1.0\~start: my-app#0.1.0
2022-12-10T10:54:55.481953221Z: \[INFO\]
2022-12-10T10:54:55.482000722Z: \[INFO\] \> my-app#0.1.0 start /home/site/wwwroot
2022-12-10T10:54:55.482007922Z: \[INFO\] \> react-scripts start
2022-12-10T10:54:55.482023422Z: \[INFO\]
2022-12-10T10:54:57.161168776Z: \[ERROR\] node:internal/modules/cjs/loader:998
2022-12-10T10:54:57.161201276Z: \[ERROR\] throw err;
2022-12-10T10:54:57.161206076Z: \[ERROR\] ^
2022-12-10T10:54:57.161209576Z: \[ERROR\]
2022-12-10T10:54:57.161212977Z: \[ERROR\] Error: Cannot find module '../scripts/start'
2022-12-10T10:54:57.161216377Z: \[ERROR\] Require stack:
2022-12-10T10:54:57.161220077Z: \[ERROR\] - /home/site/wwwroot/node_modules/.bin/react-scripts
2022-12-10T10:54:57.161223477Z: \[ERROR\] at Module.\_resolveFilename (node:internal/modules/cjs/loader:995:15)
2022-12-10T10:54:57.161227477Z: \[ERROR\] at Function.resolve (node:internal/modules/cjs/helpers:109:19)
2022-12-10T10:54:57.161235677Z: \[ERROR\] at Object.\<anonymous\> (/home/site/wwwroot/node_modules/.bin/react-scripts:31:23)
2022-12-10T10:54:57.161240177Z: \[ERROR\] at Module.\_compile (node:internal/modules/cjs/loader:1159:14)
2022-12-10T10:54:57.161243577Z: \[ERROR\] at Module.\_extensions..js (node:internal/modules/cjs/loader:1213:10)
2022-12-10T10:54:57.161246977Z: \[ERROR\] at Module.load (node:internal/modules/cjs/loader:1037:32)
2022-12-10T10:54:57.161250277Z: \[ERROR\] at Module.\_load (node:internal/modules/cjs/loader:878:12)
2022-12-10T10:54:57.161253777Z: \[ERROR\] at Function.executeUserEntryPoint \[as runMain\] (node:internal/modules/run_main:81:12)
2022-12-10T10:54:57.161257177Z: \[ERROR\] at node:internal/main/run_main_module:23:47 {
2022-12-10T10:54:57.161260578Z: \[ERROR\] code: 'MODULE_NOT_FOUND',
2022-12-10T10:54:57.161263878Z: \[ERROR\] requireStack: \[ '/home/site/wwwroot/node_modules/.bin/react-scripts' \]
2022-12-10T10:54:57.161267278Z: \[ERROR\] }
2022-12-10T10:54:57.171300295Z: \[ERROR\]
2022-12-10T10:54:57.171322096Z: \[ERROR\] Node.js v18.12.0
2022-12-10T10:54:57.240925304Z: \[ERROR\] npm info lifecycle my-app#0.1.0\~start: Failed to exec start script
2022-12-10T10:54:57.262303367Z: \[ERROR\] npm ERR! code ELIFECYCLE
2022-12-10T10:54:57.270736750Z: \[ERROR\] npm ERR! errno 1
2022-12-10T10:54:57.331226561Z: \[ERROR\] npm ERR! my-app#0.1.0 start: `react-scripts start`
2022-12-10T10:54:57.331244961Z: \[ERROR\] npm ERR! Exit status 1
2022-12-10T10:54:57.331249462Z: \[ERROR\] npm ERR!
2022-12-10T10:54:57.331261062Z: \[ERROR\] npm ERR! Failed at the my-app#0.1.0 start script.
2022-12-10T10:54:57.331264962Z: \[ERROR\] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-12-10T10:54:57.343324323Z: \[ERROR\] npm timing npm Completed in 4353ms
2022-12-10T10:54:57.343341624Z: \[ERROR\]
2022-12-10T10:54:57.343346224Z: \[ERROR\] npm ERR! A complete log of this run can be found in:
2022-12-10T10:54:57.343350024Z: \[ERROR\] npm ERR! /root/.npm/\_logs/2022-12-10T10_54_57_310Z-debug.log
Problem 2:
Just to try with create react app i will same github action and credentials it is failing after login on step 2
logs
Starting script execution via docker image mcr.microsoft.com/azure-cli:2.42.0
ERROR: (ResourceNotFound) The Resource 'Microsoft.Web/serverFarms/azwebappci-feature' under resource group 'azwebapp' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Web/serverFarms/azwebappci-feature' under resource group 'azwebapp' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Error: Error: az cli script failed.
cleaning up container...
MICROSOFT_AZURE_CLI_1670667478073_CONTAINER
Error: az cli script failed.
Expectation ==>
Script should be compatible with all repo to create dynamic resources
Why has deployment is getting failed
As a workaround, I think of App service container deployment or host build folder on Static website .
Based on the error message it appears that the problem is that it cannot find the manifest file:
Cound not find build manifest file at
'/home/site/wwwroot/oryx-manifest.toml'
I would do the following to isolate the problem:
Find where the file is on your local machine
Make sure that it is checked in to source control
Find where the file is referenced and check that that location is available
Related
Im having trouble deploying my app through GCP Cloud Build.
Do I have to update to GLIBC_2.28 but if so how do I do that on GCP Clould Build?
I'm also assuming it could be the Nodejs version but I specified node 16.15.0 in my cloudbuild.yaml and package.json files... I thought that the problem was only for versions 18x.
In my app.yaml I also use a runtime of Nodejs16.
deploying my application works in the GCP Cloud Shell but I'm having troubles with GCP Cloud Build.
Do you want to continue (Y/n)?
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 0 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...
.................................................................................................................................................................................................................................................................................................................................................................................................................................................failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 32fb7223-bf43-47ae-bd3b-787ba77c43f0 status: FAILURE
npm ERR! code 1
npm ERR! path /workspace/node_modules/#scarf/scarf
npm ERR! command failed
npm ERR! command sh -c node ./report.js
npm ERR! node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
npm ERR! A complete log of this run can be found in:
npm ERR! /www-data-home/.npm/_logs/2022-07-05T12_26_54_920Z-debug-0.log
Full build logs: https://console.cloud.google.com/cloud-build/builds;region=europe-west1/32fb7223-bf43-47ae-bd3b-787ba77c43f0?project=772319101637
Edit:
Heres my cloudbuild.yaml
steps:
# Install node packages
- name: node:16.15.0
entrypoint: npm
args: ['install']
# Build productive files
- name: node:16.15.0
entrypoint: npm
args: ['run', 'build']
# Deploy to google cloud app egnine
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args: ['-c', 'gcloud app deploy']
The problem was with my app.yaml file. I switched back to a python27 runtime (which was giving me an issue with files not being found by the handler after building with no problem) but I added a third handler and it works.
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.(js|css|svg|png)(|\.map))$
static_files: dist/\1
upload: dist/(.*)(|\.map)
- url: /.*
static_files: dist/index.html
upload: dist/.
- url: /.*
script: auto
secure: always
redirect_http_response_code: 301
skip_files:
- e2e/
- node_modules/
- src/
- ^(.*/)?\..*$
- ^(.*/)?.*\.json$
- ^(.*/)?.*\.md$
- ^(.*/)?.*\.yaml$
- ^LICENSE
I'm running a GitHub actions workflow that builds and runs a nuxt app for cypress.js testing. I'm receiving a Nuxt Fatal error that I can't seem to figure out from reading the stack when building the app.
FYI, I have looked through EVERY error logged in StackOverflow with this Fatal error but can't seem to find a solution.
Here's my GitHub Actions workflow (everything seems to run OK):
name: Cypress run on push
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [14.17.0]
containers: [1, 2, 3, 4, 5]
steps:
- name: Setup Node
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node }}
- run: node -v
- name: Checkout
uses: actions/checkout#v2
- name: Running npm ci (installing dependencies)
run: npm ci
- name: Running npm install
run: npm install
# Update Browserlist
- run: npx browserslist#latest --update-db
- name: Starting test server and running Cypress
uses: cypress-io/github-action#v2
with:
build: npm run build
start: npm run start
wait-on: 'http://localhost:3000/'
wait-on-timeout: 120
record: true
parallel: true
# browser: chrome
# headless: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
And here is the error. I do not understand why there is an error referring to an unresolved path. The path is actually correct. This also runs locally, in a dev server, staging server, and production without any problem:
[fatal] Nuxt build error
ERROR in ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '#/components/svg/DottedNoteBook' in 'components/ui/dialogs'
# ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&) 200:0-61 203:20-34
# ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&
# ./components/ui/dialogs/SocialMediaWrapper.vue
# ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/trial-view/_id.vue?vue&type=script&lang=js&
# ./pages/trial-view/_id.vue?vue&type=script&lang=js&
# ./pages/trial-view/_id.vue
# ./.nuxt/router.js
# ./.nuxt/index.js
# ./.nuxt/client.js
# multi ./.nuxt/client.js
╭─────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: Nuxt build error │
│ │
╰─────────────────────────────╯
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! JurorSearch#2.18.6 build: `nuxt build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the JurorSearch#2.18.6 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-08-17T05_30_28_916Z-debug.log
Error: Process completed with exit code 1.
Figured it out.
The component was calling "DottedNoteBook" but the file name is "DottedNotebook.vue". (Different case for the letter "B".)
I'm not sure why that case issue never came up before or preventing compiling outside of the GitHub Actions, but that was the issue. Thanks, #Tarkan for making me look closer at that.
I have a trouble with running e2e tests via jest with using testcontainers-node on gitlab ci.
default:
image: personal-registy/node:14-alpine3.12
services:
- name: personal-registy/docker:19.03-dind
alias: docker-dind
entrypoint: ['dockerd']
command: ['--host=tcp://0.0.0.0:2375']
variables:
IMAGE: $REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_HOST: tcp://docker-dind:2375
DOCKER_DRIVER: overlay2
RYUK_CONTAINER_IMAGE: personal-regist/ruyk:0.3.2
stages:
- Prepare
- Tests
modules:
stage: Prepare
script:
- npm ci --no-audit
artifacts:
paths:
- node_modules/
expire_in: 1 hour
test-e2e:
stage: Tests
before_script:
- mkdir $HOME/.docker
- echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
after_script:
- rm -rf $home/.docker
dependencies:
- modules
script:
- npm run test:e2e
artifacts:
expire_in: 1 day
First step has no problem with building and preparing typescript code for test. But on running CI via npm command I got next stacktrace in log message:
Error: (HTTP code 409) container stopped/paused - Container d26dbb007bd42c3eb129e83db6253f3056fcc37294c84c4f00d13637bd451d6b is not running
at /builds/raif-capital/rcap-core-services/rc-operation-core/node_modules/docker-modem/lib/modem.js:315:17
at getCause (/builds/raif-capital/rcap-core-services/rc-operation-core/node_modules/docker-modem/lib/modem.js:345:7)
at Modem.buildPayload (/builds/raif-capital/rcap-core-services/rc-operation-core/node_modules/docker-modem/lib/modem.js:314:5)
at IncomingMessage.<anonymous> (/builds/raif-capital/rcap-core-services/rc-operation-core/node_modules/docker-modem/lib/modem.js:286:14)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
reason: 'container stopped/paused',
statusCode: 409,
json: {
message: 'Container d26dbb007bd42c3eb129e83db6253f3056fcc37294c84c4f00d13637bd451d6b is not running'
}
}
If I start test on local machine via npm I have no problem with running tests.
I found solution.
Ryuk couldn't start because of problems with accessing to Docker socket.
I just disabled Ryuk on CI via env:
variables:
TESTCONTAINERS_RYUK_DISABLED: 'true'
After this my tests was completed successfully.
I am trying to deploy my vue app which is on an azure repository to an azure app service. I am using the pipeline provided by azure. All stages complete without any issues including deployment without any errros. But when I head over my azure app service URL I get an Application Error and the deployed Vue app does not show up. Here is my pipeline.yaml file being used for building and deployment. What am I doing wrong ?
https://imgur.com/a/fj4FwUL
# Node.js Express Web App to Linux on Azure
# Build a Node.js Express 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: 'a0dc973b-4faf-4d69-813f-17cc79ffb965'
# Web app name
webAppName: 'roiweurwoeur84934'
# Environment name
environmentName: 'roiweurwoeur84934'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: NodeTool#0
inputs:
versionSpec: '10.10'
displayName: 'Install Node.js'
- script: |
npm install
npm run build --if-present
npm run test --if-present
displayName: 'npm install, build and test'
- 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: AzureWebApp#1
displayName: 'Azure Web App Deploy: roiweurwoeur84934'
inputs:
azureSubscription: $(azureSubscription)
appType: webAppLinux
appName: $(webAppName)
runtimeStack: 'NODE|10.10'
package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
startUpCommand: 'npm run serve'
Here is the error log
Container roiweurwoeur84934_0_46d79e91 couldn't be started: Logs = 2020-10-08T15:53:08.292628680Z _____
2020-10-08T15:53:08.292671580Z / _ \ __________ _________ ____
2020-10-08T15:53:08.292677981Z / /_\ \___ / | \_ __ \_/ __ \
2020-10-08T15:53:08.292680981Z / | \/ /| | /| | \/\ ___/
2020-10-08T15:53:08.292683881Z \____|__ /_____ \____/ |__| \___ >
2020-10-08T15:53:08.292686981Z \/ \/ \/
2020-10-08T15:53:08.292689581Z A P P S E R V I C E O N L I N U X
2020-10-08T15:53:08.292692181Z
2020-10-08T15:53:08.292694681Z Documentation: http://aka.ms/webapp-linux
2020-10-08T15:53:08.292697081Z NodeJS quickstart: https://aka.ms/node-qs
2020-10-08T15:53:08.292699581Z NodeJS Version : v10.10.0
2020-10-08T15:53:08.292702081Z Note: Any data outside '/home' is not persisted
2020-10-08T15:53:08.292704681Z
2020-10-08T15:53:08.333571514Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2020-10-08T15:53:08.333677214Z Could not find operation ID in manifest. Generating an operation id...
2020-10-08T15:53:08.333828816Z Build Operation ID: 1e288eed-e9a6-4378-a8fb-52b980ca87d1
2020-10-08T15:53:08.947709015Z Writing output script to '/opt/startup/startup.sh'
2020-10-08T15:53:09.335664575Z Running #!/bin/sh
2020-10-08T15:53:09.335837476Z
2020-10-08T15:53:09.335891277Z # Enter the source directory to make sure the script runs where the user expects
2020-10-08T15:53:09.335970777Z cd "/home/site/wwwroot"
2020-10-08T15:53:09.336114879Z
2020-10-08T15:53:09.336186379Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2020-10-08T15:53:09.336240480Z if [ -z "$PORT" ]; then
2020-10-08T15:53:09.336313280Z export PORT=8080
2020-10-08T15:53:09.336384281Z fi
2020-10-08T15:53:09.336563182Z
2020-10-08T15:53:09.336618983Z PATH="$PATH:/home/site/wwwroot" npm run serve
2020-10-08T15:53:09.592860470Z npm info it worked if it ends with ok
2020-10-08T15:53:09.593484175Z npm info using npm#6.9.0
2020-10-08T15:53:09.593975979Z npm info using node#v10.10.0
2020-10-08T15:53:09.700042643Z npm info lifecycle vuetify-dashboard#0.1.0~preserve: vuetify-dashboard#0.1.0
2020-10-08T15:53:09.703408170Z npm info lifecycle vuetify-dashboard#0.1.0~serve: vuetify-dashboard#0.1.0
2020-10-08T15:53:09.708303910Z
2020-10-08T15:53:09.708316710Z > vuetify-dashboard#0.1.0 serve /home/site/wwwroot
2020-10-08T15:53:09.708321010Z > vue-cli-service serve
2020-10-08T15:53:09.708324310Z
2020-10-08T15:53:11.013684241Z internal/modules/cjs/loader.js:583
2020-10-08T15:53:11.013737842Z throw err;
2020-10-08T15:53:11.013754342Z ^
2020-10-08T15:53:11.013757742Z
2020-10-08T15:53:11.013760642Z Error: Cannot find module '../package.json'
2020-10-08T15:53:11.013763542Z at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
2020-10-08T15:53:11.013766342Z at Function.Module._load (internal/modules/cjs/loader.js:507:25)
2020-10-08T15:53:11.013769142Z at Module.require (internal/modules/cjs/loader.js:637:17)
2020-10-08T15:53:11.013771942Z at require (internal/modules/cjs/helpers.js:20:18)
2020-10-08T15:53:11.013774642Z at Object. (/home/site/wwwroot/node_modules/.bin/vue-cli-service:4:25)
2020-10-08T15:53:11.013784742Z at Module._compile (internal/modules/cjs/loader.js:689:30)
2020-10-08T15:53:11.013788642Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
2020-10-08T15:53:11.013791442Z at Module.load (internal/modules/cjs/loader.js:599:32)
2020-10-08T15:53:11.013794142Z at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
2020-10-08T15:53:11.013796942Z at Function.Module._load (internal/modules/cjs/loader.js:530:3)
2020-10-08T15:53:11.021617006Z npm info lifecycle vuetify-dashboard#0.1.0~serve: Failed to exec serve script
2020-10-08T15:53:11.023369320Z npm ERR! code ELIFECYCLE
2020-10-08T15:53:11.024735531Z npm ERR! errno 1
2020-10-08T15:53:11.026685147Z npm ERR! vuetify-dashboard#0.1.0 serve: `vue-cli-service serve`
2020-10-08T15:53:11.027571354Z npm ERR! Exit status 1
2020-10-08T15:53:11.028555662Z npm ERR!
2020-10-08T15:53:11.029287868Z npm ERR! Failed at the vuetify-dashboard#0.1.0 serve script.
2020-10-08T15:53:11.030028274Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-10-08T15:53:11.034935414Z npm timing npm Completed in 1479ms
2020-10-08T15:53:11.035673120Z
2020-10-08T15:53:11.036461427Z npm ERR! A complete log of this run can be found in:
2020-10-08T15:53:11.037147032Z npm ERR! /root/.npm/_logs/2020-10-08T15_53_11_031Z-debug.log
You can check below solution to deploy your vue app to azure web app.
When you run npm run build --if-present in your pipeline. The build files will be output to folder dist. You can directly package this dist folder in ArchiveFiles task and deploy to azure web app service.
Then you need to change the start up command to npx serve -s in AzureWebApp task. I updated your yaml pipeline as below:
- task: ArchiveFiles#2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/dist' #package the dist folder
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: AzureWebApp#1
displayName: 'Azure Web App Deploy: roiweurwoeur84934'
inputs:
azureSubscription: $(azureSubscription)
appType: webAppLinux
appName: $(webAppName)
runtimeStack: 'NODE|10.10'
package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
startUpCommand: 'npx serve -s'
I've been having some issues installing a scoped package that that was published to GPR
See below for my actions file
name: run unit and coverage tests
on: [push]
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout#v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com/'
scope: '#OWNER'
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com:_authToken=${{ secrets.PRIVATE_ACCESS_TOKEN }}" > ~/.npmrc
- name: npm install, build, and test
run: |
npm ci
npm run test:unit
npm run lint
npm run test:e2e -- --headless
env:
CI: true
my .npmrc file is as follows:
#discoveryedu:registry=https://npm.pkg.github.com/
my private access token has read:packages, write:packages, and repo privileges.
I'm getting the following error in actions:
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/#owner/repo/version/hash
i've subbed the owner, repo, and version names for privacy.