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

Commit 11d1673

Browse files
committed
chore: publish docker images as RCs
1 parent eeb933a commit 11d1673

File tree

7 files changed

+87
-38
lines changed

7 files changed

+87
-38
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+

.travis.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ branches:
1111
stages:
1212
- check
1313
- test
14-
- release-rc
14+
- release-rc-npm
15+
- release-rc-docker
1516
- test-external
1617

1718
node_js:
@@ -134,18 +135,29 @@ jobs:
134135
- npm run build
135136
- npm run test -- $RUN_SINCE --scope=example* --concurrency=1
136137

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

149+
- stage: release-rc-docker
150+
# only run on changes to master
151+
if: branch = master AND type = push AND fork = false
152+
name: release docker rc
153+
script:
154+
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
155+
- docker build . --tag js-ipfs:next --file ./Dockerfile.next
156+
- docker tag js-ipfs:next docker.io/ipfs/js-ipfs:next
157+
- docker tag js-ipfs:next docker.io/ipfs/js-ipfs:v`npm show ipfs@next version -q`
158+
- docker push ipfs/js-ipfs:next
159+
- docker push ipfs/js-ipfs:v`npm show ipfs@next version -q`
160+
149161
- stage: test-external
150162
# only run on changes to master
151163
if: branch = master AND type = push AND fork = false

Dockerfile.latest

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM mhart/alpine-node:10
2+
3+
ENV IPFS_VERSION=latest
4+
ENV IPFS_MONITORING=1
5+
ENV IPFS_PATH=/root/.jsipfs
6+
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'
7+
8+
RUN apk add --no-cache git
9+
RUN apk add --no-cache python
10+
RUN apk add --no-cache build-base
11+
12+
RUN npm install --unsafe-perm -g ipfs@"$IPFS_VERSION"
13+
14+
# Make the image a bit smaller
15+
RUN npm cache clear --force
16+
17+
# Configure jsipfs
18+
RUN jsipfs init
19+
20+
RUN jsipfs version
21+
22+
# Allow connections from any host
23+
RUN sed -i.bak "s/127.0.0.1/0.0.0.0/g" $IPFS_PATH/config
24+
25+
EXPOSE 4002
26+
EXPOSE 4003
27+
EXPOSE 5002
28+
EXPOSE 9090
29+
30+
CMD jsipfs daemon

Dockerfile.next

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM mhart/alpine-node:10
2+
3+
ENV IPFS_VERSION=next
4+
ENV IPFS_MONITORING=1
5+
ENV IPFS_PATH=/root/.jsipfs
6+
ENV BUILD_DEPS='libnspr4 libnspr4-dev libnss3'
7+
8+
RUN apk add --no-cache git
9+
RUN apk add --no-cache python
10+
RUN apk add --no-cache build-base
11+
12+
RUN npm install --unsafe-perm -g ipfs@"$IPFS_VERSION"
13+
14+
# Make the image a bit smaller
15+
RUN npm cache clear --force
16+
17+
# Configure jsipfs
18+
RUN jsipfs init
19+
20+
RUN jsipfs version
21+
22+
# Allow connections from any host
23+
RUN sed -i.bak "s/127.0.0.1/0.0.0.0/g" $IPFS_PATH/config
24+
25+
EXPOSE 4002
26+
EXPOSE 4003
27+
EXPOSE 5002
28+
EXPOSE 9090
29+
30+
CMD jsipfs daemon

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
"clean": "lerna run clean",
2323
"lint": "lerna run lint",
2424
"dep-check": "lerna run dep-check",
25-
"release": "npm run update-contributors && lerna publish",
25+
"release": "npm run update-contributors && lerna publish && npm run release:docker",
26+
"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",
27+
"release:docker:build": "docker build . --tag js-ipfs:latest --file ./Dockerfile.latest",
28+
"release:docker:tag-latest": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:latest",
29+
"release:docker:tag-version": "docker tag js-ipfs:latest docker.io/ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
30+
"release:docker:push-latest": "docker push ipfs/js-ipfs:latest",
31+
"release:docker:push-version": "docker push ipfs/js-ipfs:v`npm show ipfs@latest version -q`",
2632
"release:rc": "lerna publish --canary --preid rc --dist-tag next",
2733
"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"
2834
},

packages/ipfs/.dockerignore

-1
This file was deleted.

packages/ipfs/Dockerfile

-30
This file was deleted.

0 commit comments

Comments
 (0)