Skip to content

Commit

Permalink
Use circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
tusbar committed Oct 23, 2018
1 parent 92b8258 commit f26da6c
Show file tree
Hide file tree
Showing 7 changed files with 873 additions and 42 deletions.
171 changes: 171 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
version: 2

defaults:
workspace_root: &workspace_root
~/wfs-client

nodejs_container: &nodejs_container
working_directory: *workspace_root
docker:
- image: circleci/node:8-stretch

golang_container: &golang_container
working_directory: *workspace_root
docker:
- image: circleci/golang:1-stretch

filters: &default_filters
tags:
only: '/v[0-9]+(\.[0-9]+)*/'

attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root

restore_node_modules: &restore_node_modules
restore_cache:
name: Restore node_modules cache
keys:
- v1-wfs-client-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-wfs-client-node-master-{{ checksum "yarn.lock" }}
- v1-wfs-client-node-master-

jobs:
checkout:
<<: *nodejs_container
steps:
- checkout

- persist_to_workspace:
root: *workspace_root
paths:
- ./

install:
<<: *nodejs_container
steps:
- *attach_workspace
- *restore_node_modules

- restore_cache:
name: Restore yarn cache
keys:
- v1-wfs-client-yarn-{{ checksum "yarn.lock" }}
- v1-wfs-client-yarn-

- run:
name: Install dependencies
command: yarn

- save_cache:
name: Save yarn cache
key: v1-wfs-client-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn/

- save_cache:
name: Save node_modules cache
key: v1-wfs-client-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/

lint:
<<: *nodejs_container
steps:
- *attach_workspace
- *restore_node_modules

- run:
name: Lint JavaScript
command: yarn xo


changelog:
<<: *nodejs_container
steps:
- *attach_workspace
- *restore_node_modules

- restore_cache:
name: Restore changelog cache
keys:
- v1-wfs-client-changelog-{{ .BuildNum }}
- v1-wfs-client-changelog-

- run:
name: Generate changelog
command: |
if [ $CIRCLE_TAG ]; then
PREV_TAG=$(git describe --abbrev=0 --tags $CIRCLE_TAG^)
echo "[+] Running for range $PREV_TAG...$CIRCLE_TAG"
node_modules/.bin/lerna-changelog --from $PREV_TAG --to $CIRCLE_TAG > CHANGELOG.md
else
PREV_TAG=$(git describe --abbrev=0 --tags)
echo "[+] Running from $PREV_TAG"
node_modules/.bin/lerna-changelog --from $PREV_TAG > CHANGELOG.md
fi
- save_cache:
name: Save changelog cache
key: v1-wfs-client-changelog-{{ .BuildNum }}
paths:
- .changelog/

- run:
name: Display changelog
command: cat CHANGELOG.md

- persist_to_workspace:
name: Persist changelog
root: *workspace_root
paths:
- CHANGELOG.md

release:
<<: *golang_container
steps:
- *attach_workspace
- *restore_node_modules

- run:
name: Install github-release
command: go get github.com/aktau/github-release

- run:
name: Create GitHub release
command: github-release release --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --description "$(cat CHANGELOG.md)" --name $CIRCLE_TAG

workflows:
version: 2

push:
jobs:
- checkout:
filters: *default_filters

- install:
requires:
- checkout
filters: *default_filters

- lint:
requires:
- install
filters: *default_filters

- changelog:
requires:
- install
filters: *default_filters

- release:
requires:
- changelog
filters:
<<: *default_filters
branches:
ignore: /.*/
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
28 changes: 9 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
# Logs
logs
*.log
npm-debug.log*
CHANGELOG.md

# Runtime data
pids
*.pid
*.seed
# Cache
.yarn-cache
.changelog

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Node
node_modules

# Coverage directory used by tools like istanbul
# Reports
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
reports
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# wfs-client [![Build Status](https://secure.travis-ci.org/jdesboeufs/wfs-client.svg)](http://travis-ci.org/jdesboeufs/wfs-client)
# wfs-client [![CircleCI](https://circleci.com/gh/geodatagouv/wfs-client.svg?style=svg)](https://circleci.com/gh/geodatagouv/wfs-client)

A very simple WFS client
> A very simple WFS client
[![npm version](https://badgen.net/npm/v/wfs-client)](https://www.npmjs.com/package/wfs-client)
[![codecov](https://badgen.net/codecov/c/github/geodatagouv/wfs-client)](https://codecov.io/gh/geodatagouv/wfs-client)
[![dependencies Status](https://badgen.net/david/dep/geodatagouv/wfs-client)](https://david-dm.org/geodatagouv/wfs-client)
[![XO code style](https://badgen.net/badge/code%20style/XO/cyan)](https://github.com/xojs/xo)

## Features

Expand Down
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"version": "0.3.0",
"description": "A very simple WFS client",
"main": "index.js",
"scripts": {
"test": "xo"
},
"repository": {
"type": "git",
"url": "git://github.com/inspireteam/wfs-client.git"
Expand All @@ -28,6 +25,7 @@
"semver": "^4.3.3"
},
"devDependencies": {
"lerna-changelog": "^0.8.2",
"xo": "^0.23.0"
},
"engines": {
Expand All @@ -36,5 +34,18 @@
"xo": {
"semicolon": false,
"space": 2
},
"changelog": {
"cacheDir": ".changelog",
"labels": {
"bug": ":bug: Bug Fix",
"build": ":building_construction: Build Process",
"cleanup": ":shower: Cleanup",
"documentation": ":memo: Documentation",
"enhancement": ":rocket: Enhancement",
"performance": ":racehorse: Performance",
"security": ":policeman: Security"
},
"repo": "geodatagouv/wfs-client"
}
}
Loading

0 comments on commit f26da6c

Please sign in to comment.