Azure Linux App Service : Installing packages after deploy from Devops pipeline

Viewed 384

I'm currently setuping a CI/CD pipeline in Azure Devops to deploy a NodeJS app on a linux hosted app service (not a VM).

My build and deploy both go smoothly, BUT I need to make sure some packages are installed in the environment after the app has been deployed.

The issue is: whatever apt-get script I create after the deploy, I have to run then manually for them to actually take effect. In the Pipeline log they seem to have been executed, though.

Here is the part of my yaml code responsible for the deploy, did I miss something?

- stage: Deploy
  displayName: Deploy stage
  dependsOn: Build
  condition: succeeded()
  jobs:
  - deployment: Deploy
    displayName: Deploy
    environment: $(environmentName)
    pool:
      vmImage: $(vmImageName)
    workspace:
      clean: all
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            displayName: 'Azure Web App Deploy:'
            inputs:
              azureSubscription: $(azureSubscription)
              appType: webAppLinux
              appName: $(webAppName)
              runtimeStack: 'NODE|16-lts'
              package: $(Pipeline.Workspace)/drop/drop$(Build.BuildNumber).zip
              startUpCommand: 'pm2 start index.js --no-daemon'
        on:
         success:
           steps:
           - script: sudo apt-get update
             displayName: apt update
           - script: sudo apt-get -y [SOME LIBS] 
             displayName: try install dependencies

Thanks !

1 Answers

For now, went with a "startup.sh" file which I run manually after each deploy. Gonna go through docker later though

Related