Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
chore: publish docker images as RCs
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Mar 26, 2020
1 parent eeb933a commit 11d1673
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*

24 changes: 18 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ branches:
stages:
- check
- test
- release-rc
- release-rc-npm
- release-rc-docker
- test-external

node_js:
Expand Down Expand Up @@ -134,18 +135,29 @@ jobs:
- npm run build
- npm run test -- $RUN_SINCE --scope=example* --concurrency=1

- stage: release-rc
- stage: release-rc-npm
# only run on changes to master
if: branch = master AND type = push AND fork = false
name: release rc
name: release npm rc
script:
# travis does not fetch the whole repo history, but we need that to work out the
# ref count to publish canary releases properly
- git fetch --unshallow
# need tags to work out what has changed since the last release
- git fetch --tags
- npm run build -- --scope=ipfs*
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- npm run release:rc -- --yes

- stage: release-rc-docker
# only run on changes to master
if: branch = master AND type = push AND fork = false
name: release docker rc
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build . --tag js-ipfs:next --file ./Dockerfile.next
- docker tag js-ipfs:next docker.io/ipfs/js-ipfs:next
- docker tag js-ipfs:next docker.io/ipfs/js-ipfs:v`npm show ipfs@next version -q`
- docker push ipfs/js-ipfs:next
- docker push ipfs/js-ipfs:v`npm show ipfs@next version -q`

- stage: test-external
# only run on changes to master
if: branch = master AND type = push AND fork = false
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile.latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM mhart/alpine-node:10

ENV IPFS_VERSION=latest
ENV IPFS_MONITORING=1
ENV IPFS_PATH=/root/.jsipfs
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'

RUN apk add --no-cache git
RUN apk add --no-cache python
RUN apk add --no-cache build-base

RUN npm install --unsafe-perm -g ipfs@"$IPFS_VERSION"

# Make the image a bit smaller
RUN npm cache clear --force

# Configure jsipfs
RUN jsipfs init

RUN jsipfs version

# Allow connections from any host
RUN sed -i.bak "s/127.0.0.1/0.0.0.0/g" $IPFS_PATH/config

EXPOSE 4002
EXPOSE 4003
EXPOSE 5002
EXPOSE 9090

CMD jsipfs daemon
30 changes: 30 additions & 0 deletions Dockerfile.next
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM mhart/alpine-node:10

ENV IPFS_VERSION=next
ENV IPFS_MONITORING=1
ENV IPFS_PATH=/root/.jsipfs
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'

RUN apk add --no-cache git
RUN apk add --no-cache python
RUN apk add --no-cache build-base

RUN npm install --unsafe-perm -g ipfs@"$IPFS_VERSION"

# Make the image a bit smaller
RUN npm cache clear --force

# Configure jsipfs
RUN jsipfs init

RUN jsipfs version

# Allow connections from any host
RUN sed -i.bak "s/127.0.0.1/0.0.0.0/g" $IPFS_PATH/config

EXPOSE 4002
EXPOSE 4003
EXPOSE 5002
EXPOSE 9090

CMD jsipfs daemon
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
"clean": "lerna run clean",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
"release": "npm run update-contributors && lerna publish",
"release": "npm run update-contributors && lerna publish && npm run release:docker",
"release:docker": "npm run release:docker:build && npm run release:docker:tag-latest && npm run release:docker:tag-version && npm run release:docker:push-latest && npm run release:docker:push-version",
"release:docker:build": "docker build . --tag js-ipfs:latest --file ./Dockerfile.latest",
"release:docker:tag-latest": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:latest",
"release:docker:tag-version": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
"release:docker:push-latest": "docker push ipfs/js-ipfs:latest",
"release:docker:push-version": "docker push ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
"release:rc": "lerna publish --canary --preid rc --dist-tag next",
"update-contributors": "aegir release --lint=false --test=false --bump=false --build=false --changelog=false --commit=false --tag=false --push=false --ghrelease=false --docs=false --publish=false"
},
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs/.dockerignore

This file was deleted.

30 changes: 0 additions & 30 deletions packages/ipfs/Dockerfile

This file was deleted.

0 comments on commit 11d1673

Please sign in to comment.