14cf70fb33
This creates a jobs template for various common npm-based jobs, and a javascript job template that runs two NPM-based jobs in the gate. Change-Id: I26fc5b1f780453202af8d1d43575bbf2aa53d27e Depends-On: Ibd16775609fbfe8f60a14672a27fb44e84fb63b9
124 lines
3.4 KiB
YAML
124 lines
3.4 KiB
YAML
# 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}-npm-run-{command}'
|
|
|
|
wrappers:
|
|
- build-timeout:
|
|
timeout: 40
|
|
- timestamps
|
|
|
|
builders:
|
|
- npm-install
|
|
- xvfb-install
|
|
- chrome-install
|
|
- firefox-install
|
|
- revoke-sudo
|
|
- xvfb-start
|
|
- gerrit-git-prep
|
|
- npm-run:
|
|
command: '{command}'
|
|
- assert-no-extra-files
|
|
publishers:
|
|
- console-log
|
|
- coverage-log
|
|
- scp:
|
|
site: 'static.openstack.org'
|
|
files:
|
|
- target: 'logs/$LOG_PATH'
|
|
source: 'reports/**'
|
|
keep-hierarchy: true
|
|
copy-after-failure: true
|
|
node: '{node}'
|
|
|
|
# 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'
|
|
|
|
wrappers:
|
|
- build-timeout:
|
|
timeout: 40
|
|
- timestamps
|
|
|
|
builders:
|
|
- npm-install
|
|
- revoke-sudo
|
|
- gerrit-git-prep
|
|
- js-build:
|
|
command: 'build:draft'
|
|
envlist: 'grunt'
|
|
project: '{name}'
|
|
- assert-no-extra-files
|
|
|
|
publishers:
|
|
- console-log
|
|
- 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
|
|
node: '{node}'
|
|
|
|
# Builds a release tarball
|
|
- job-template:
|
|
name: '{name}-js-release-{branch-designator}'
|
|
|
|
builders:
|
|
- npm-install
|
|
- revoke-sudo
|
|
- gerrit-git-prep
|
|
- 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:
|
|
- console-log
|
|
- 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
|
|
node: '{node}'
|
|
|
|
- job-group:
|
|
name: javascript-jobs
|
|
jobs:
|
|
- 'gate-{name}-npm-run-{command}':
|
|
command: 'lint'
|
|
- 'gate-{name}-npm-run-{command}':
|
|
command: 'test'
|