-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Automated builds * Switched to Javascript Standard Style * Reverted Dockerfile changes
- Loading branch information
1 parent
1ddf886
commit 7782ce3
Showing
2 changed files
with
60 additions
and
0 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,15 @@ | ||
language: generic | ||
services: docker | ||
|
||
before_script: | ||
- docker build -t $DOCKER_TAG . | ||
|
||
script: | ||
- docker run -d -p 3000:3000 --name ytdl $DOCKER_TAG | ||
- sleep 10; ./test/e2e.js | ||
|
||
deploy: | ||
provider: script | ||
script: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD && docker push $DOCKER_TAG | ||
on: | ||
branch: master |
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,45 @@ | ||
#!/usr/bin/env node | ||
|
||
const http = require('http') | ||
const querystring = require('querystring') | ||
|
||
const postData = querystring.stringify({ | ||
'url': 'https://www.youtube.com/watch?v=qNf9nzvnd1k' | ||
}) | ||
|
||
const req = http.request( | ||
{ | ||
host: 'localhost', | ||
port: '3000', | ||
path: '/download', | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
'Content-Length': Buffer.byteLength(postData) | ||
} | ||
}, | ||
(res) => { | ||
const { statusCode } = res | ||
|
||
res.on('data', (chunk) => { | ||
console.log(`BODY: ${chunk}`) | ||
}) | ||
|
||
res.on('end', () => { | ||
console.log('No more data in response.') | ||
|
||
if (statusCode !== 200) { | ||
console.log(`Got status ${statusCode}`) | ||
process.exit(1) | ||
} | ||
|
||
console.log('Yay it works') | ||
}) | ||
} | ||
).on('error', (e) => { | ||
console.error(`Got error: ${e.message}`) | ||
process.exit(1) | ||
}) | ||
|
||
req.write(postData) | ||
req.end() |