Skip to content

Commit

Permalink
Compose improvements and release publishing (#461)
Browse files Browse the repository at this point in the history
* minimal refactor to share repeated dependency version numbers or build context

Signed-off-by: Aaron Sutula <hi@asutula.com>

* add gh action to publish docker artifacts

Signed-off-by: Aaron Sutula <hi@asutula.com>

* consolidate release jobs

Signed-off-by: Aaron Sutula <hi@asutula.com>

* Better name for archive

Signed-off-by: Aaron Sutula <hi@asutula.com>

* remove some debug prints

Signed-off-by: Aaron Sutula <hi@asutula.com>

* newline cleanup

Signed-off-by: Aaron Sutula <hi@asutula.com>
  • Loading branch information
asutula authored Jun 20, 2020
1 parent b809c7c commit 7189f4c
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
name: Publish JS gRPC bindings
name: Release
on:
release:
types: [published]
types: [created]
jobs:

publish_docker:
name: Publish Docker Compose Setup
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Get latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Update powergate image version
run: sed -i.bak 's/latest/${{steps.latesttag.outputs.tag}}/g' docker/powergate-image.yaml
- name: Update Makefile
run: sed -i.bak 's/powergate-build-context/powergate-image/g' docker/Makefile
- name: Remove sed backups
run: rm -rf docker/*.bak
- name: Create archive
run: |
mv docker powergate-docker
zip -r powergate-docker.zip powergate-docker
- name: Upload artifacts to release
uses: AButler/upload-release-assets@v2.0
with:
files: 'powergate-docker.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
publish_grpc_lib:
name: Publish JS gRPC bindings
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ make devnet
```
This will build Powergate `powd`, a Lotus devnet, a IPFS node and wire them correctly to be ready to use.
**Note**: There also exists a `make devnet-small` command that will create the Lotus devent using 2Kib sectors. This may be more appropriate for certain development or testing scenarios.
**Note**: Running `BIGSECTORS=false make devnet` will create the Lotus devent using 2Kib sectors. This may be more appropriate for certain development or testing scenarios.
Here is a full example of using the devnet run:
Terminal 1:
Expand Down
28 changes: 20 additions & 8 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
down:
docker-compose down
docker-compose -p devnet down
docker-compose \
-f docker-compose.yaml \
-f ipfs-image.yaml \
-f powergate-build-context.yaml \
down
docker-compose -p devnet \
-f docker-compose-devnet.yaml \
-f ipfs-image.yaml \
-f powergate-build-context.yaml \
down
.PHONY: down

up: down
docker-compose up --build
docker-compose \
-f docker-compose.yaml \
-f ipfs-image.yaml \
-f powergate-build-context.yaml \
up --build
.PHONY: up

devnet:
docker-compose -p devnet -f docker-compose-devnet.yaml up --build -V
docker-compose -p devnet \
-f docker-compose-devnet.yaml \
-f ipfs-image.yaml \
-f powergate-build-context.yaml \
up --build -V
.PHONY: devnet

devnet-small:
BIGSECTORS=false docker-compose -p devnet -f docker-compose-devnet.yaml up --build -V
.PHONY: devnet-small
3 changes: 0 additions & 3 deletions docker/docker-compose-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ version: '3.7'
services:

powergate:
build:
context: ../
ports:
- 8889:8889
- 8888:8888
Expand All @@ -21,7 +19,6 @@ services:
restart: unless-stopped

ipfs:
image: ipfs/go-ipfs:v0.5.1
ports:
- 5001:5001

Expand Down
3 changes: 0 additions & 3 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ volumes:
services:

powergate:
build:
context: ../
ports:
- 8889:8889
- 8888:8888
Expand Down Expand Up @@ -44,7 +42,6 @@ services:
restart: unless-stopped

ipfs:
image: ipfs/go-ipfs:v0.5.1
ports:
- 5001:5001
volumes:
Expand Down
6 changes: 6 additions & 0 deletions docker/ipfs-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.7'

services:

ipfs:
image: ipfs/go-ipfs:v0.5.1
7 changes: 7 additions & 0 deletions docker/powergate-build-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.7'

services:

powergate:
build:
context: ../
5 changes: 5 additions & 0 deletions docker/powergate-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "3.7"

services:
powergate:
image: textile/powergate:latest

0 comments on commit 7189f4c

Please sign in to comment.