-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,533 additions
and
981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules/ | ||
dist/ | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.