@@ -4,18 +4,20 @@ import got from 'got';
44import delay from 'delay' ;
55import pRetry from 'p-retry' ;
66
7- const IMAGE = 'npmjs /npm-docker-couchdb:1.6.1 ' ;
7+ const IMAGE = 'semanticrelease /npm-registry-docker:latest ' ;
88const SERVER_PORT = 25986 ;
99const COUCHDB_PORT = 5984 ;
1010const SERVER_HOST = 'localhost' ;
11+ const COUCHDB_USER = 'admin' ;
12+ const COUCHDB_PASSWORD = 'password' ;
1113const NPM_USERNAME = 'integration' ;
1214const NPM_PASSWORD = 'suchsecure' ;
1315const NPM_EMAIL = '[email protected] ' ; 1416const docker = new Docker ( ) ;
1517let container ;
1618
1719/**
18- * Download the `npm-docker-couchdb ` Docker image, create a new container and start it.
20+ * Download the `npm-registry-docker ` Docker image, create a new container and start it.
1921 */
2022async function start ( ) {
2123 await getStream ( await docker . pull ( IMAGE ) ) ;
@@ -24,10 +26,11 @@ async function start() {
2426 Tty : true ,
2527 Image : IMAGE ,
2628 PortBindings : { [ `${ COUCHDB_PORT } /tcp` ] : [ { HostPort : `${ SERVER_PORT } ` } ] } ,
29+ Env : [ `COUCHDB_USER=${ COUCHDB_USER } ` , `COUCHDB_PASSWORD=${ COUCHDB_PASSWORD } ` ] ,
2730 } ) ;
2831
2932 await container . start ( ) ;
30- await delay ( 3000 ) ;
33+ await delay ( 4000 ) ;
3134
3235 try {
3336 // Wait for the registry to be ready
@@ -43,7 +46,7 @@ async function start() {
4346 // Create user
4447 await got ( `http://${ SERVER_HOST } :${ SERVER_PORT } /_users/org.couchdb.user:${ NPM_USERNAME } ` , {
4548 json : true ,
46- auth : 'admin:admin' ,
49+ auth : ` ${ COUCHDB_USER } : ${ COUCHDB_PASSWORD } ` ,
4750 method : 'PUT' ,
4851 body : {
4952 _id : `org.couchdb.user:${ NPM_USERNAME } ` ,
@@ -66,7 +69,7 @@ const authEnv = {
6669} ;
6770
6871/**
69- * Stop and remote the `npm-docker-couchdb ` Docker container.
72+ * Stop and remote the `npm-registry-docker ` Docker container.
7073 */
7174async function stop ( ) {
7275 await container . stop ( ) ;
0 commit comments