project-config/jenkins/jobs/javascript.yaml

369 lines
9.9 KiB
YAML

## Generic jobs
# Uploads a release tarball to npm.
- job-template:
name: '{name}-npm-upload'
node: release
builders:
- print-template-name:
template-name: "{template-name}"
- shell: |
/usr/local/jenkins/slave_scripts/npm-tarball-upload.sh {name} tarballs.openstack.org
publishers:
- console-log
## Node4 Jobs
# Executes a command registered inside of package.json. For more information on
# how this works, see https://docs.npmjs.com/cli/run-script. This build assumes
# that whatever is being run under the hood, it will pipe its output to the
# ./reports directory in the projects' root directory. This output is
# subsequently copied to static.openstack.org (the clickthrough target from
# gerrit).
- job-template:
name: 'gate-{name}-nodejs{version}-npm-run-{command}'
node: ubuntu-xenial
wrappers:
- build-timeout:
timeout: 40
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: '{version}'
- xvfb-install
- chrome-install
- firefox-install
- revoke-sudo
- xvfb-start
- npm-run:
command: '{command}'
- assert-no-extra-files
publishers:
- coverage-log
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'reports/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: 'npm-shrinkwrap.json'
keep-hierarchy: false
copy-after-failure: false
- target: 'logs/$LOG_PATH'
source: 'karma.subunit'
keep-hierarchy: false
copy-after-failure: true
- console-log
- job-template:
name: '{name}-dsvm-nodejs{version}-npm-run-{command}'
node: ubuntu-xenial
wrappers:
- build-timeout:
timeout: 40
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: "{version}"
- xvfb-install
- chrome-install
- firefox-install
- devstack-checkout
- xvfb-start
- npm-dsvm-run:
pre_test_command: 'configure-devstack'
post_test_command: "{command}"
- assert-no-extra-files
publishers:
- devstack-logs
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'reports/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: 'karma.subunit'
keep-hierarchy: false
copy-after-failure: true
- console-log
# Builds and uploads a tarball using NPM.
- job-template:
name: '{name}-nodejs{version}-npm-publish-tarball'
node: ubuntu-xenial
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: '{version}'
- revoke-sudo
# This will build ./{name}-{version}.tgz, where {version} is read from
# package.json.
- npm-run:
command: 'pack'
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/version-properties.sh
source version.properties
# Move the autogenerated versioned tarball to the one we like.
mkdir -p dist
cp *.tgz dist/{name}-$PROJECT_VER.tar.gz
cp *.tgz dist/{name}-latest.tar.gz
publishers:
- tarball:
project: '{name}'
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'npm-shrinkwrap.json'
keep-hierarchy: false
copy-after-failure: false
- console-log
- job-template:
name: 'gate-{name}-nodejs{version}-npm-docs'
description: Build and publish draft documentation for a JavaScript project.
node: ubuntu-xenial
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: '{version}'
- revoke-sudo
- npm-run:
command: 'docs'
- assert-no-extra-files
publishers:
- upload-sphinx-draft
- console-log
- job-template:
name: '{name}-nodejs{version}-npm-sdk-docs'
description: Build and publish documentation to developer.openstack.org for a JavaScript SDK project.
node: ubuntu-xenial
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: '{version}'
- revoke-sudo
- npm-run:
command: 'docs'
- assert-no-extra-files
- add-docs-root-marker:
docsrootdir: doc/build/html
publishers:
- ftp:
site: developer.openstack.org
source: 'doc/build/html/**'
target: 'sdks/javascript/{name}'
remove-prefix: 'doc/build/html/'
excludes: ''
- afs:
site: afs-developer-docs
source: 'doc/build/html/**'
target: 'sdks/javascript/{name}'
remove-prefix: 'doc/build/html/'
- console-log
- job-template:
name: '{name}-nodejs{version}-npm-docs'
description: Build and publish documentation to docs.openstack.org for a JavaScript project.
node: ubuntu-xenial
builders:
- print-template-name:
template-name: "{template-name}"
- gerrit-git-prep
- install-distro-packages
- nodejs-install:
version: '{version}'
- revoke-sudo
- npm-run:
command: 'docs'
- assert-no-extra-files
- add-docs-root-marker:
docsrootdir: doc/build/html
publishers:
- ftp:
site: docs.openstack.org
source: 'doc/build/html/**'
target: 'developer/{name}'
remove-prefix: 'doc/build/html/'
excludes: ''
- afs:
site: afs-docs
source: 'doc/build/html/**'
target: 'developer/{name}'
remove-prefix: 'doc/build/html/'
- console-log
- job-group:
name: nodejs4-jobs
jobs:
- 'gate-{name}-nodejs{version}-npm-run-{command}':
command: 'lint'
version: '4'
- 'gate-{name}-nodejs{version}-npm-run-{command}':
command: 'test'
version: '4'
- job-group:
name: nodejs4-docs
jobs:
- 'gate-{name}-nodejs{version}-npm-docs':
version: '4'
- job-group:
name: nodejs4-publish-to-npm
jobs:
- '{name}-nodejs{version}-npm-publish-tarball':
version: '4'
- '{name}-npm-upload'
- job-group:
name: nodejs6-jobs
jobs:
- 'gate-{name}-nodejs{version}-npm-run-{command}':
command: 'lint'
version: '6'
- 'gate-{name}-nodejs{version}-npm-run-{command}':
command: 'test'
version: '6'
- job-group:
name: nodejs6-publish-to-npm
jobs:
- '{name}-nodejs{version}-npm-publish-tarball':
version: '6'
- '{name}-npm-upload'
- job-group:
name: nodejs6-docs
jobs:
- 'gate-{name}-nodejs{version}-npm-docs':
version: '6'
## Legacy Jobs (DEPRECATED)
# Builds a draft application and uploads it to docs-draft. To use this build,
# your Gruntfile must declare a target named "build:draft"
- job-template:
name: 'gate-{name}-js-draft'
node: ubuntu-xenial
wrappers:
- build-timeout:
timeout: 40
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- nodejs-install:
version: 4
- gerrit-git-prep
- install-distro-packages
- revoke-sudo
- js-build:
command: 'build:draft'
envlist: 'grunt'
project: '{name}'
- assert-no-extra-files
publishers:
- coverage-log
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'reports/**'
keep-hierarchy: true
copy-after-failure: true
# We're uploading the compiled app as a pre-release sanity check,
# much like we do with docs builds.
- target: 'docs-draft/$LOG_PATH'
source: 'dist/**'
keep-hierarchy: true
copy-after-failure: false
- console-log
# Builds a release tarball
- job-template:
name: '{name}-js-release-{suffix}'
node: ubuntu-xenial
builders:
- print-template-name:
template-name: "{template-name}"
- nodejs-install:
version: 4
- gerrit-git-prep
- install-distro-packages
- revoke-sudo
- js-build:
command: 'build'
envlist: 'grunt'
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/version-properties.sh
source version.properties
# Clean/create a tarball directory
rm -rf tarballs
mkdir -p tarballs
# Create an archive tarball.
tar -czf {name}-$PROJECT_VER.tar.gz dist/
cp {name}-$PROJECT_VER.tar.gz tarballs/{name}-latest.tar.gz
mv {name}-$PROJECT_VER.tar.gz tarballs/
publishers:
- coverage-log
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: 'reports/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'tarballs/{name}/'
source: 'tarballs/*.tar.gz'
keep-hierarchy: false
copy-after-failure: false
- console-log