This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add docker build step to travis [build-image] (#12)
- Loading branch information
Showing
8 changed files
with
89 additions
and
3 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,12 @@ | ||
.idea | ||
.git | ||
packages | ||
node_modules | ||
.travis.yml | ||
package-lock.json | ||
Dockerfile | ||
CHANGELOG.md | ||
README.md | ||
test-config.json | ||
test/ | ||
.env.example |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
.nyc_output | ||
package-lock.json |
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,18 @@ | ||
name = "couch-url-rewrite-proxy" | ||
description = "a proxy that rewrites URLs on their way out of couch, making registry migrations easier" | ||
start = "./bin/couch-url-rewrite-proxy.js start" | ||
|
||
[environment] | ||
FRONT_DOOR_URL = "{{front_door_url}}" | ||
PORT = "{{port}}" | ||
UPSTREAM_URL = "{{upstream_url}}" | ||
|
||
[default] | ||
FRONT_DOOR_URL = "https://registry.example.com" | ||
PORT = 5001 | ||
UPSTREAM_URL = "http://127.0.0.1:5000" | ||
|
||
[argument] | ||
front-door-host = "FRONT_DOOR_HOST" | ||
port = "PORT" | ||
upstream = "UPSTREAM_URL" |
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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "node" | ||
- "6" | ||
- "8" | ||
before_install: | ||
- npm i dockyard@latest -g | ||
- printf "@npm:registry=https://enterprise.npmjs.com" >> ~/.npmrc | ||
after_success: npm run coverage | ||
|
||
after_success: | ||
- npm run coverage | ||
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
- dockyard build image --repo=npmjs --name=couch-url-rewrite-proxy |
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,20 @@ | ||
# Set the base image to alpine Node LTS | ||
FROM npmjs/npm-docker-baseline:6-alpine | ||
|
||
# File Author / Maintainer | ||
MAINTAINER Alex Robson | ||
|
||
WORKDIR /app/src | ||
COPY ./bin/ /app/src/bin/ | ||
COPY ./package.json /app/src/ | ||
COPY ./server.js /app/src/ | ||
COPY ./.kicker.toml /app/src/ | ||
|
||
RUN echo '@npm:registry=https://enterprise.npmjs.com/' >> ~/.npmrc && \ | ||
cat ~/.npmrc && \ | ||
npm install && \ | ||
rm ~/.npmrc | ||
|
||
RUN npm uninstall node-gyp -g && apk del python make g++ && rm -rf /var/cache/apk/* | ||
|
||
EXPOSE 8080 |
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker build . -t npme-url-rewrite-proxy |
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,6 @@ | ||
#!/bin/bash | ||
|
||
node ./bin/couch-url-rewrite-proxy.js start \ | ||
--port=8080 \ | ||
--front-door-host=$FRONT_DOOR_HOST \ | ||
--upstream=$UPSTREAM |
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,18 @@ | ||
#!/bin/bash | ||
|
||
if [[ $1 == debug ]]; then | ||
docker run -it --rm --name npme-url-rewrite-proxy \ | ||
-e FRONT_DOOR_HOST=172.16.123.1 \ | ||
-e PORT=8080 \ | ||
-e UPSTREAM=http://172.16.123.1:5984/upstream \ | ||
-p 8080:8080 \ | ||
npme-url-rewrite-proxy | ||
bash | ||
else | ||
docker run -d --name npme-url-rewrite-proxy \ | ||
-e FRONT_DOOR_HOST=172.16.123.1 \ | ||
-e PORT=8080 \ | ||
-e UPSTREAM=http://172.16.123.1:5984/upstream \ | ||
-p 8080:8080 \ | ||
npme-url-rewrite-proxy | ||
fi |