This image using nodejs official image for run self-hosted agents on Azure Pipelines
12
,12.5.0
Dockerfile10
,10.16.0
Dockerfile8
,8.16.0
Dockerfile
docker build --build-arg NODE_VERSION=8 -t azure-pipelines-nodejs:8 .
AZURE_REPOSITORY_URL: https://dev.azure.com/{your_organization}
AZURE_TOKEN: XXXXXXXXXXXXXXXXXXXXXX Setup
AZURE_POOL: nodejs Setup (https://dev.azure.com/{your_organization}/_settings/agentpools
)
AGENT_NAME: node-12
docker run -e AZP_URL=[AZURE_REPOSITORY_URL] -e AZP_TOKEN=[AZURE_TOKEN] -e AZP_AGENT_NAME=[AGENT_NAME] -e AZP_POOL=[AZURE_POOL] --name [CONTAINER_NAME] notder/azure-pipelines-nodejs:[TAG_NAME]
version: '3'
services:
nodejs-12:
image: notder/azure-pipelines-nodejs:12
environment:
AZP_POOL: nodejs
AZP_AGENT_NAME: nodejs-12
AZP_URL: https://dev.azure.com/{your_organization}
AZP_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
restart: always
networks:
- azure-nodejs-12-network
networks:
azure-nodejs-12-network:
driver: bridge
trigger:
branches:
include:
- master
- develop
jobs:
- job: build
pool:
name: nodejs
variables:
COMMIT_ID: '$(Build.SourceVersion)'
steps:
- script: |
npm install
npm run build:prod
displayName: 'NPM RUN BUILD'