Skip to content
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

Demo #181

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Demo #181

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d8e71e1
Set up CI with Azure Pipelines
KPhaniPrasad May 13, 2022
0a15aa9
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad May 14, 2022
af962c3
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad May 14, 2022
3b943b1
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad May 15, 2022
dc31532
Set up CI with Azure Pipelines
KPhaniPrasad May 15, 2022
cbb1076
Update azure-pipelines-1.yml
KPhaniPrasad May 16, 2022
bdd774b
Set up CI with Azure Pipelines
KPhaniPrasad Jul 9, 2022
7c41947
Publish artifact
KPhaniPrasad Jul 9, 2022
8ec027f
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 29, 2023
ddb9c56
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 29, 2023
af1704a
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 29, 2023
1b945ef
Create DockerFile
KPhaniPrasad Mar 30, 2023
d35fd5f
Update azure-pipelines.yml
KPhaniPrasad Mar 30, 2023
2d29b01
Set up CI with Azure Pipelines
KPhaniPrasad Mar 30, 2023
614ad96
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 30, 2023
7f00154
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 30, 2023
05ebd59
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 30, 2023
3477c3f
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 30, 2023
f55bfb5
Delete azure-pipelines-1.yml
KPhaniPrasad Mar 30, 2023
094c543
Update azure-pipelines.yml
KPhaniPrasad Mar 31, 2023
705e4e4
Update azure-pipelines.yml for Azure Pipelines
KPhaniPrasad Mar 31, 2023
5b56f51
Update azure-pipelines.yml
KPhaniPrasad Apr 1, 2023
c822ff7
Set up CI with Azure Pipelines
KPhaniPrasad Apr 1, 2023
d4ed4b3
Set up CI with Azure Pipelines
KPhaniPrasad Apr 1, 2023
30918ef
Set up CI with Azure Pipelines
KPhaniPrasad Apr 1, 2023
a2286d5
Set up CI with Azure Pipelines
KPhaniPrasad Apr 8, 2023
e932224
Set up CI with Azure Pipelines
KPhaniPrasad Jun 30, 2023
b094860
Create npm-publish.yml
KPhaniPrasad Nov 18, 2023
294cde0
Update npm-publish.yml
KPhaniPrasad Nov 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
19 changes: 19 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:10

# Create app directory
WORKDIR /usr/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "server.js" ]
39 changes: 39 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- master

resources:
- repo: self

variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '7ca82645-4e44-4cf9-89be-c396b9ec0b3c'
imageRepository: 'kphaniprasadnodejsdocshelloworld'
containerRegistry: 'mynodejs.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/DockerFile'
tag: '$(Build.BuildId)'

# Agent VM image name
vmImageName: 'ubuntu-latest'

stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
31 changes: 31 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
trigger:
- master
pool:
vmImage: ubuntu-latest

stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
npm run test
displayName: 'npm install, build, and test'

- task: Docker@2
displayName: Push an image
inputs:
azureSubscriptionEndpoint: '$(5a0eee50-4814-4a84-babe-068c6bee0201)'
azureContainerRegistry: '$(classicpipeline.azurecr.io)'
imageName: '$(classicpipeline.azurecr.io.image)'
command: push