Skip to content

Commit

Permalink
feat: ipfs cli works
Browse files Browse the repository at this point in the history
  • Loading branch information
desujoy committed Feb 21, 2024
1 parent 94a8281 commit e033858
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/

28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:focal

RUN apt-get update
RUN apt-get install -y curl wget
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get upgrade -y
RUN apt-get install -y nodejs

WORKDIR /home/app

RUN wget https://dist.ipfs.tech/kubo/v0.26.0/kubo_v0.26.0_linux-amd64.tar.gz
RUN tar -xvzf kubo_v0.26.0_linux-amd64.tar.gz
RUN cd kubo
RUN bash kubo/install.sh

RUN apt-get install git -y

COPY main.sh main.sh
COPY index.js index.js
COPY package*.json .

RUN npm install

RUN chmod +x main.sh
RUN chmod +x index.js


ENTRYPOINT [ "/home/app/main.sh" ]
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import fs from 'fs';
import path from 'path';
import { exec } from 'child_process';

const result = exec('ipfs --version')
result.stdout.on('data', (data) => {
console.log(data);
});
result.stderr.on('data', (data) => {
console.error(data);
});


7 changes: 7 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

export GIT_REPOSITORY__URL="$GIT_REPOSITORY__URL"

git clone "$GIT_REPOSITORY__URL" /home/app/output

exec node index.js
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "build-server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
5 changes: 5 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e033858

Please sign in to comment.