Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
10bd948c
Commit
10bd948c
authored
Jul 27, 2016
by
Christof Dorner
Committed by
Nick Stenning
Jul 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish to NPM on Jenkins when a new tag is created (#55)
parent
b0952d5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
Jenkinsfile
Jenkinsfile
+22
-0
package.json
package.json
+2
-1
No files found.
Jenkinsfile
View file @
10bd948c
...
@@ -15,4 +15,26 @@ node {
...
@@ -15,4 +15,26 @@ node {
nodeEnv
.
inside
(
"-e HOME=${workspace}"
)
{
nodeEnv
.
inside
(
"-e HOME=${workspace}"
)
{
sh
'make test'
sh
'make test'
}
}
if
(
isTag
())
{
stage
'Publish'
nodeEnv
.
inside
(
"-e HOME=${workspace}"
)
{
withCredentials
([
[
$class
:
'StringBinding'
,
credentialsId:
'npm-token'
,
variable:
'NPM_TOKEN'
]])
{
sh
"echo '//registry.npmjs.org/:_authToken=${env.NPM_TOKEN}' >> \$HOME/.npmrc"
sh
"npm publish"
}
}
}
}
boolean
isTag
()
{
try
{
sh
'git describe --exact-match --tags'
return
true
}
catch
(
Exception
e
)
{
echo
e
.
toString
()
return
false
}
}
}
package.json
View file @
10bd948c
...
@@ -139,6 +139,7 @@
...
@@ -139,6 +139,7 @@
"test"
:
"gulp test-app"
,
"test"
:
"gulp test-app"
,
"preversion"
:
"npm run test"
,
"preversion"
:
"npm run test"
,
"version"
:
"make clean all && ./scripts/update-changelog.js && git add CHANGELOG.md"
,
"version"
:
"make clean all && ./scripts/update-changelog.js && git add CHANGELOG.md"
,
"postversion"
:
"git push && git push --tags && ./scripts/create-github-release.js"
"postversion"
:
"git push && git push --tags && ./scripts/create-github-release.js"
,
"prepublish"
:
"npm run-script build"
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment