Skip to content

Commit 66b6c54

Browse files
committed
test: use semanticrelease/npm-registry-docker Docker image for tests
1 parent 4e89a09 commit 66b6c54

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/helpers/npm-registry.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ import got from 'got';
44
import delay from 'delay';
55
import pRetry from 'p-retry';
66

7-
const IMAGE = 'npmjs/npm-docker-couchdb:1.6.1';
7+
const IMAGE = 'semanticrelease/npm-registry-docker:latest';
88
const SERVER_PORT = 25986;
99
const COUCHDB_PORT = 5984;
1010
const SERVER_HOST = 'localhost';
11+
const COUCHDB_USER = 'admin';
12+
const COUCHDB_PASSWORD = 'password';
1113
const NPM_USERNAME = 'integration';
1214
const NPM_PASSWORD = 'suchsecure';
1315
const NPM_EMAIL = '[email protected]';
1416
const docker = new Docker();
1517
let 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
*/
2022
async 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
*/
7174
async function stop() {
7275
await container.stop();

0 commit comments

Comments
 (0)