Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Commit

Permalink
ipfs: use ipfs.ref file to trigger rebuilds
Browse files Browse the repository at this point in the history
This makes it consistent with the other services.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
  • Loading branch information
Lars Gierth committed Oct 23, 2015
1 parent 8e87963 commit 1e75827
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion solarnet/roles/ipfs/files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.5.1
MAINTAINER Lars Gierth <larsg@systemli.org>

# This IPFS repo should be copied into ./go-ipfs
ADD go-ipfs /go/src/github.com/ipfs/go-ipfs
ADD . /go/src/github.com/ipfs/go-ipfs

RUN cd /go/src/github.com/ipfs/go-ipfs/cmd/ipfs && go install

Expand Down
27 changes: 13 additions & 14 deletions solarnet/roles/ipfs/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
# build the docker image, if needed
- shell: "docker images -a | grep {{ ipfs_ref }}"
- shell: "cat /opt/ipfs.ref | grep {{ ipfs_ref }}"
ignore_errors: true
register: ipfs_image_present
- file:
path: /ipfs_build
state: directory
when: "ipfs_image_present.rc != 0"
- copy:
src: Dockerfile
dest: /ipfs_build/Dockerfile
when: "ipfs_image_present.rc != 0"
register: ipfs_ref_present
- git:
repo: https://github.com/ipfs/go-ipfs.git
dest: /ipfs_build/go-ipfs
dest: /opt/ipfs/src
version: "{{ ipfs_ref }}"
when: "ipfs_image_present.rc != 0"
- shell: "docker build -t ipfs:{{ ipfs_ref }} /ipfs_build"
when: "ipfs_image_present.rc != 0"
force: yes
when: "ipfs_ref_present.rc != 0"
- copy:
src: Dockerfile
dest: /opt/ipfs/src/Dockerfile
when: "ipfs_ref_present.rc != 0"
- shell: "docker build -t ipfs:{{ ipfs_ref }} /opt/ipfs/src"
when: "ipfs_ref_present.rc != 0"
- shell: "echo {{ ipfs_ref }} > /opt/ipfs.ref"
when: "ipfs_ref_present.rc != 0"

# generate ipfs repo
- command: "docker run -i -v /ipfs/ipfs_master:/ipfs ipfs:{{ ipfs_ref }} sh -c 'IPFS_PATH=/ipfs/repo ipfs init'"
Expand Down

0 comments on commit 1e75827

Please sign in to comment.