Skip to content

Commit

Permalink
🚀 Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenKn committed Sep 18, 2019
2 parents c20684b + 9dbc8ab commit 209e789
Show file tree
Hide file tree
Showing 35 changed files with 1,533 additions and 981 deletions.
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/--feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "✨ Feature request"
about: Suggest an idea for this project
title: "✨ Short Summary of the Feature"
labels: feature-request
assignees: SteffenKn

---

## Description

> A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Possible Solution

> A clear and concise description of what you want to happen.
# Additional Context

> Add any other context or screenshots about the feature request here.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
title: "🐛 Short Summary of the Bug"
labels: bug
assignees: SteffenKn

---

## Description

> A clear and concise description of what the bug is.
## Reproduction

> Steps to reproduce the behavior:
> 1. Go to '...'
> 2. Click on '....'
> 3. Scroll down to '....'
> 4. See error
## Expected Behavior

> A clear and concise description of what you expected to happen.
## Screenshots

> If applicable, add screenshots (or even gifs) to help explain your problem.
## Setup

- OS: [`Windows`/`macOS`/`Linux` + `version`]
- Node: [`node --version`]
- Browser [`chrome`/`firefox`/`...` + version]

## Additional context

> Add any other context about the problem here.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Changes

1. Change 1
2. Change 2
3. (...)

## Issues

Closes #YourIssueNumber

PR: #NumberOfThisPR

## Checks

- [ ] The code is covered by tests.
- [ ] The code is ready to get merged.
40 changes: 40 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test-Workflow

on:
push:
branches:
- develop
- feature/*
- release/*

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm install

- name: npm lint
run: npm run lint

- name: npm build
run: npm run build

- name: npm test
env:
CLOUDFLARE_EMAIL: ${{ secrets.TESTS__CLOUDFLARE_EMAIL }}
CLOUDFLARE_KEY: ${{ secrets.TESTS__CLOUDFLARE_KEY }}
CLOUDFLARE_DOMAIN: ${{ secrets.TESTS__CLOUDFLARE_DOMAIN }}
run: npm test -- --email=$CLOUDFLARE_EMAIL --key=$CLOUDFLARE_KEY --domain=$CLOUDFLARE_DOMAIN
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules/
dist/

package-lock.json
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules/
.github/
src/
dist/tests

package-lock.json
tsconfig.json
tslint.json
Jenkinsfile
133 changes: 133 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#!/usr/bin/env groovy

def cleanup_workspace() {
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
dir("${env.WORKSPACE}@script") {
deleteDir()
}
dir("${env.WORKSPACE}@script@tmp") {
deleteDir()
}
}

def setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "/~https://github.com/SteffenKn/Cloudflare-DDNS-Sync"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "Jenkins"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}

pipeline {
agent any
tools {
nodejs "nodejs-lts"
}
environment {
NODE_JS_VERSION = 'nodejs-lts'
}

stages {
stage('Prepare') {
steps {
setBuildStatus('Building...', 'PENDING')

script {
raw_package_version = sh(script: 'node --print --eval "require(\'./package.json\').version"', returnStdout: true)
package_version = raw_package_version.trim()
branch = env.BRANCH_NAME;
branch_is_master = branch == 'master';

echo("Package version is '${package_version}'")
echo("Branch is '${branch}'")
}

nodejs(configId: env.NPM_RC_FILE, nodeJSInstallationName: env.NODE_JS_VERSION) {
sh('node --version')
}
}
}

stage('Install') {
steps {
sh('node --version')

sh('npm install')
}
}

stage('Lint') {
steps {
sh('node --version')

sh('npm run lint')
}
}

stage('Build') {
steps {
sh('node --version')

sh('npm run build')
}
}

stage('Test') {
steps {
sh('node --version')

withCredentials([string(credentialsId: 'CLOUDFLARE_EMAIL', variable: 'CLOUDFLARE_EMAIL'), string(credentialsId: 'CLOUDFLARE_KEY', variable: 'CLOUDFLARE_KEY'), string(credentialsId: 'CLOUDFLARE_DOMAIN', variable: 'CLOUDFLARE_DOMAIN')]) {
sh('npm run test-jenkins -- --email="'+CLOUDFLARE_EMAIL+'" --key="'+CLOUDFLARE_KEY+'" --domain="'+CLOUDFLARE_DOMAIN+'"')

junit 'report.xml'
}
}
}

stage('Publish') {
when {
expression {
branch_is_master
}
}
steps {
sh('node --version')

withNPM(npmrcConfig: 'Jenkins-Npmrc') {
sh('npm publish')
}
}
}

stage('Cleanup') {
steps {
script {
// this stage just exists, so the cleanup-work that happens in the post-script
// will show up in its own stage in Blue Ocean
sh(script: ':', returnStdout: true);
}
}
}
}

post {
always {
script {
cleanup_workspace();
}
}

success {
setBuildStatus('Build succeeded.', 'SUCCESS');
}

failure {
setBuildStatus('Build failed!', 'FAILURE');
}
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018, Steffen Knaup
Copyright (c) 2019, Steffen Knaup

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
Loading

0 comments on commit 209e789

Please sign in to comment.