Skip to content

Commit

Permalink
Moved pipeline config and added naming script. (openhab#166)
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Luckenbach <[email protected]>
  • Loading branch information
Confectrician authored Nov 1, 2019
1 parent 4b2d225 commit ff143fd
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 42 deletions.
35 changes: 35 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CI and PR build script
#
# Basic information can be found here:
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration
#
# The structure of this pipeline configuration is mainly inspired by microsofts code extension for azure pipelines.
# It can be found here:
# https://github.com/microsoft/azure-pipelines-vscode
#
#
trigger:
- master
pr:
- master

pool:
vmImage: ubuntu-16.04

steps:
# tag CI-produced packages with a version number pointing to the commit which was built.
# for PRs, also include the PR #.
- bash: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
else
VERSION_STRING=${PACKAGE_VERSION}-ci-$(git rev-parse --short HEAD)
fi
npm --no-git-tag-version version $VERSION_STRING
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"
echo "$PACKAGE_VERSION" > version.txt
displayName: Set version number of package and build
condition: eq(variables['Agent.OS'], 'Linux')

- template: basic-steps.yml
60 changes: 60 additions & 0 deletions .azure-pipelines/basic-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Basic steps template
steps:
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start xvfb
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- bash: |
echo ">>> Compile vscode-test"
yarn && yarn compile
echo ">>> Compiled vscode-test"
cd sample
echo ">>> Run sample integration test"
yarn && yarn compile && yarn test
displayName: Run Tests
env:
DISPLAY: ':99.0'

# Acquire the `vsce` tool and use it to package
# Copy a file to prevent webpack from failing as a workaround.
- script: |
sudo npm install -g vsce
sudo cp client/node_modules/copy-paste/platform/linux.js client/node_modules/copy-paste/platform/openbsd.js
vsce package
displayName: Create VSIX
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- script: |
npm run vscode:prepublish
cat /home/vsts/.npm/_logs/*.log
displayName: Echo npm error logs on failure
condition: failed()

# For releasable builds, we'll want the branch and the changelog
# Expects that a 'version.txt' has been laid down by a previous step
- bash: |
echo $(Build.SourceBranch) | sed "s|refs/[^/]*/||" > branch.txt
PACKAGE_VERSION=$(cat version.txt)
VERSION_REGEX="## $(echo $PACKAGE_VERSION | sed 's/\./\\./g')"
sed -n "/$VERSION_REGEX/,/## 1\..*/p" CHANGELOG.md | head -n -2 > minichangelog.txt
displayName: Get branch and mini-changelog

# Choose files to publish
- task: CopyFiles@2
displayName: Stage VSIX for publishing
inputs:
contents: |-
*.vsix
version.txt
branch.txt
minichangelog.txt
targetFolder: $(Build.ArtifactStagingDirectory)

# Publish files as an artifact
- task: PublishPipelineArtifact@1
displayName: Publish VSIX
inputs:
artifact: openhab-vscode
targetPath: $(Build.ArtifactStagingDirectory)
4 changes: 2 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#General
#General
.vscode/**
.vscode-test/**
.github/**
Expand All @@ -21,7 +21,7 @@ shared.webpack.config.js

# openHAB vscode repo meta files
AUTHORS
azure-pipelines.yml
.azure-pipelines/*
CHANGELOG.md
CONTRIBUTING.md
NOTICE
Expand Down
40 changes: 0 additions & 40 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit ff143fd

Please sign in to comment.