-
Notifications
You must be signed in to change notification settings - Fork 0
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
Working Azure DevOps Pipeline Caching for Angular CI | josh-ops #7
Comments
Hi Josh, |
@Mitesh1711 certainly! I should have had included that in the original post, good idea :) The - task: Npm@1
displayName: npm install
inputs:
command: install
workingDir: $(Build.SourcesDirectory)/Source/MyWeb The |
hi The cache task is working and getting optimised but when deploying the latest changes are not effecting in Live.. environment. what might be the issue? of not reflecting the latest changes |
we are using microsoft hosted agents and deploying into it..and will this cache task works in microsift hosted agents? |
@awsservices4 it should totally work for Hosted Agents!
What do you mean, like where you deploy to is still showing an old version of your site? This cache task is primarily used to cache packages (like npm packages) to speed up build time, so it shouldn't affect your build output / deployment to your environment. |
Thanks for the reply. Yes cache is working fine.then after deploying only
the changes are not effecting ie the old changes remain same even after
changing .
In the same pipeline if i am not using Cache task then it's working
properly
Can you tell me where might be the problm
Thanks
…On Fri, 30 Sep, 2022, 10:35 pm Josh Johanning, ***@***.***> wrote:
@awsservices4 <https://github.com/awsservices4> it should totally work
for Hosted Agents!
when deploying the latest changes are not effecting in Live.. environment.
what might be the issue? of not reflecting the latest changes
What do you mean, like where you deploy to is still showing an old version
of your site?
This cache task is primarily used to cache packages (like npm packages) to
speed up build time, so it shouldn't affect your build output / deployment
to your environment.
—
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AREI6CQ7X3ZKKIIXZUA637DWA4MV5ANCNFSM5IISYJ6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@awsservices4 oh that's really weird. Is your It should only affect what values you have stored in the I would also be interested what's not being updated on the site - is it related to package versions (ie: old dependency rendering calendar wrong), or other views/files that are being changed that aren't being reflected? |
Unfortunately I fear you've managed to succeed in the fine art of Failing Succesfully ;-D The problem is you're using The Caching Task docs refer to the creation of a pipeline cache of the NPM cache folder, which isn't the same as the The Caching Task docs assume NPM creates this cache folder at the
So, while your solution probably works, you're basically doing desktop development stuff in a CI/CD pipeline. Which, again, isn't the way! Hope this helps! |
@lzandman TIL, thank you for educating me! I appreciate the example here too ❤️ . Isn't it disappointing then that the default Azure DevOps pipeline template for each Node example use steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
ng build --prod
displayName: 'npm install and build' I will admit, I like how GitHub Actions does the caching a little better, as it's handled pretty much automatically in the Thanks again! |
If I am using condition on NPM Install, then task is still executing. I verified with the restore keys as well and that all looks good. Could you please help me with the script for caching and conditional based installation of npm install? Thank you |
@fenilshahdev I think you would want something like this, using the steps:
- task: Cache@2
displayName: load npm cache
inputs:
key: npm | $(Agent.OS) | $(Build.SourcesDirectory)/Source/MyWeb/package.json
restoreKeys: |
npm | "$(Agent.OS)"
path: $(Build.SourcesDirectory)/Source/MyWeb/node_modules
cacheHitVar: CACHE_HIT
- name: npm install
condition: ne(variables.CACHE_HIT, 'true')
script: |
npm install |
Hi Josh-ops, It supposed to be created under /adoagent-cache/.npm/ but Could you please help on this issue. Cache Script:
Delete Files:
|
Working Azure DevOps Pipeline Caching for Angular CI | josh-ops
I share how I finally got the Pipeline Cache task to work with my Angular build pipeline
https://josh-ops.com/posts/azdo-angular-pipeline-caching/
The text was updated successfully, but these errors were encountered: