@@ -18,81 +18,11 @@ jobs:
1818 docker :
1919 - image : circleci/node:12
2020 << : *node_steps
21-
2221 node_10 :
2322 docker :
2423 - image : circleci/node:10
2524 << : *node_steps
2625
27- docker_test :
28- machine : true
29- steps :
30- - checkout
31- # Check whether "docker build" is successful or not
32- - run : docker build -t piping-server .
33- - run :
34- name : Working test with Docker image
35- command : |
36- set -eux
37- # Run a server
38- docker run -d -p 8080:80 --name=piping piping-server --http-port=80
39- # Wait for server running
40- sleep 1
41- # Create a file to send
42- echo 'hello, world' > /tmp/hello.txt
43- # Send and wait for a receiver
44- curl -T /tmp/hello.txt localhost:8080/mypath &
45- # Get data as a file
46- curl localhost:8080/mypath > /tmp/download.txt
47- # Print downloaded file
48- cat /tmp/download.txt
49- # Test the equality
50- diff /tmp/hello.txt /tmp/download.txt
51- # Print server log
52- docker logs piping
53- # Delete container
54- docker rm -f piping
55- - run :
56- name : Working test with Docker image for HTTPS
57- command : |
58- set -eux
59- mkdir ssl_certs
60- cd ssl_certs
61- openssl genrsa 2024 > server.key
62- openssl req -new -key server.key -subj "/C=US" > server.csr
63- openssl x509 -req -days 3650 -signkey server.key < server.csr > server.crt
64- cd ..
65- # Run a server
66- 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
67- # Wait for server running
68- sleep 1
69- # Create a file to send
70- echo 'hello, world' > /tmp/hello.txt
71- # Send and wait for a receiver
72- curl -kT /tmp/hello.txt https://localhost:8443/mypath &
73- # Get data as a file
74- curl -k https://localhost:8443/mypath > /tmp/download.txt
75- # Print downloaded file
76- cat /tmp/download.txt
77- # Test the equality
78- diff /tmp/hello.txt /tmp/download.txt
79- # Print server log
80- docker logs piping
81- # Delete container
82- docker rm -f piping
83-
84- # (from: https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/)
85- npm_publish :
86- docker :
87- - image : circleci/node:12
88- steps :
89- - checkout
90- - run : npm ci
91- - run :
92- name : Authenticate with registry
93- command : echo -e "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
94- - run : npm publish
95-
9626workflows :
9727 version : 2
9828 node_tests :
@@ -109,14 +39,3 @@ workflows:
10939 filters :
11040 tags :
11141 only : /.*/
112- - docker_test
113- - npm_publish :
114- requires :
115- - node_14
116- - node_12
117- - node_10
118- filters :
119- tags :
120- only : /.*/
121- branches :
122- ignore : /.*/
0 commit comments