Skip to content

Commit

Permalink
Merge branch 'release/1.11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Feb 5, 2022
2 parents f5b39de + ec25ce5 commit c155d4e
Show file tree
Hide file tree
Showing 9 changed files with 3,347 additions and 111 deletions.
81 changes: 0 additions & 81 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,81 +18,11 @@ jobs:
docker:
- image: circleci/node:12
<<: *node_steps

node_10:
docker:
- image: circleci/node:10
<<: *node_steps

docker_test:
machine: true
steps:
- checkout
# Check whether "docker build" is successful or not
- run: docker build -t piping-server .
- run:
name: Working test with Docker image
command: |
set -eux
# Run a server
docker run -d -p 8080:80 --name=piping piping-server --http-port=80
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -T /tmp/hello.txt localhost:8080/mypath &
# Get data as a file
curl localhost:8080/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
- run:
name: Working test with Docker image for HTTPS
command: |
set -eux
mkdir ssl_certs
cd ssl_certs
openssl genrsa 2024 > server.key
openssl req -new -key server.key -subj "/C=US" > server.csr
openssl x509 -req -days 3650 -signkey server.key < server.csr > server.crt
cd ..
# Run a server
docker run -d -p 8080:80 -p 8443:443 -v $PWD/ssl_certs:/ssl_certs --name=piping piping-server --http-port=80 --enable-https=true --https-port=443 --key-path=/ssl_certs/server.key --crt-path=/ssl_certs/server.crt
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -kT /tmp/hello.txt https://localhost:8443/mypath &
# Get data as a file
curl -k https://localhost:8443/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
# (from: https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/)
npm_publish:
docker:
- image: circleci/node:12
steps:
- checkout
- run: npm ci
- run:
name: Authenticate with registry
command: echo -e "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- run: npm publish

workflows:
version: 2
node_tests:
Expand All @@ -109,14 +39,3 @@ workflows:
filters:
tags:
only: /.*/
- docker_test
- npm_publish:
requires:
- node_14
- node_12
- node_10
filters:
tags:
only: /.*/
branches:
ignore: /.*/
7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ updates:
open-pull-requests-limit: 99
reviewers: [ nwtgck ]
assignees: [ nwtgck ]
ignore:
- dependency-name: "@types/node"
versions:
- ">= 11.a, < 12"
- dependency-name: "@types/node"
versions:
- ">= 13.a, < 14"
- package-ecosystem: docker
directory: "/"
schedule:
Expand Down
53 changes: 50 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-18.04

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -22,3 +19,53 @@ jobs:
- run: npm run lint
- run: npm run build
- run: npm test

docker_test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- run: docker build -t piping-server .
- name: Working test with Docker image
run: |
set -eux
# Run a server
docker run -d -p 8080:80 --name=piping piping-server --http-port=80
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -T /tmp/hello.txt localhost:8080/mypath &
# Get data as a file
curl localhost:8080/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
- name: Working test with Docker image for HTTPS
run: |
set -eux
# Create certificates
(mkdir ssl_certs && cd ssl_certs && openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -sha256 -nodes --subj '/CN=localhost/')
# Run a server
docker run -d -p 8080:80 -p 8443:443 -v $PWD/ssl_certs:/ssl_certs --name=piping piping-server --http-port=80 --enable-https=true --https-port=443 --key-path=/ssl_certs/server.key --crt-path=/ssl_certs/server.crt
# Wait for server running
sleep 1
# Create a file to send
echo 'hello, world' > /tmp/hello.txt
# Send and wait for a receiver
curl -kT /tmp/hello.txt https://localhost:8443/mypath &
# Get data as a file
curl -k https://localhost:8443/mypath > /tmp/download.txt
# Print downloaded file
cat /tmp/download.txt
# Test the equality
diff /tmp/hello.txt /tmp/download.txt
# Print server log
docker logs piping
# Delete container
docker rm -f piping
17 changes: 17 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: npm publish
on:
push:
tags:
- 'v*'
jobs:
npm_publish:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- run: npm ci
- name: Authenticate with registry
run: echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: npm publish
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.11.1] - 2022-02-05
### Changed
* Update dependencies
* (Docker) Use node 16 as base docker image
* (internal) Update package-lock.json version to 2

## [1.11.0] - 2022-01-24
### Changed
* Update dependencies
Expand Down Expand Up @@ -405,7 +411,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Docker automated build on Docker Hub
* Support HTTPS

[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.11.0...HEAD
[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.11.1...HEAD
[1.11.1]: https://github.com/nwtgck/piping-server/compare/v1.11.0...v1.11.1
[1.11.0]: https://github.com/nwtgck/piping-server/compare/v1.10.2...v1.11.0
[1.10.2]: https://github.com/nwtgck/piping-server/compare/v1.10.1...v1.10.2
[1.10.1]: https://github.com/nwtgck/piping-server/compare/v1.10.0...v1.10.1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14.18.3-alpine
FROM node:16.13.2-alpine

LABEL maintainer="Ryo Ota <nwtgck@nwtgck.org>"

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# (based on: https://www.appveyor.com/docs/lang/nodejs-iojs/)

environment:
# NOTE: Only test in Node.js 10 to shorten time
nodejs_version: "10"
# NOTE: Only test in Node.js 16 to shorten time
nodejs_version: "16"

# Install scripts. (runs after repo cloning)
install:
Expand Down
Loading

0 comments on commit c155d4e

Please sign in to comment.