Skip to content

Commit

Permalink
feat: 🎸 semantic-release (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
raduachim committed Sep 4, 2019
1 parent 8eb467d commit a6b7e96
Show file tree
Hide file tree
Showing 8 changed files with 13,871 additions and 6,435 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
7 changes: 7 additions & 0 deletions .deploy.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

oc login $OPENSHIFT_URL --token=$OPENSHIFT_TOKEN --certificate-authority=/tmp/openshift.crt
echo "Redeploying..."
oc rollout latest cv-ci -n mydata
oc logout
rm /tmp/openshift.crt
6 changes: 6 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
}
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.js": "npm run lint"
}
39 changes: 39 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/exec",
{
"publishCmd": "docker build -t jobtechswe/mydata-cv ."
}
],
[
"semantic-release-docker",
{
"registryUrl": "docker.io",
"name": "jobtechswe/mydata-cv"
}
],
[
"@semantic-release/exec",
{
"publishCmd": "bash ./.deploy.bash ${nextRelease.version}"
}
]
]
}
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# The jobs section declares jobs available in this build context
jobs:
include:
# lint and run tests
- stage: "lint-and-test"
name: "Lint, run tests"
language: node_js
install:
- npm ci
script:
- npm run testAndLint

- stage: publish
name: "Run semantic-release and publish a new version"
language: node_js
install:
- npm ci
# Install a new version of the openshift cli
- mkdir -p /opt/openshift
- wget -qO- https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz | tar xvzf - -C /opt/openshift --strip-components=1
- export PATH=$PATH:/opt/openshift
- echo $OPENSHIFT_CERT | base64 --decode > /tmp/openshift.crt
script:
- npx semantic-release

# Flow control
# This section defines the order in which stages are run and when to run certain stages
stages:
- name: lint-and-test
if: branch != master AND tag IS NOT present
- name: publish
if: (branch = master AND type != pull_request)

notifications:
email:
on_success: never
on_failure: change
Loading

0 comments on commit a6b7e96

Please sign in to comment.