Merge pull request #100 from threefoldfoundation/gitpod

Gitpod
This commit is contained in:
2021-07-11 19:57:12 +04:00
committed by GitHub
11 changed files with 181 additions and 97 deletions

5
.gitignore vendored
View File

@@ -14,8 +14,7 @@ node_modules
.env.*
yarn.lock
.installed
install.sh
run.sh
build.sh
package-lock.json
dist
.temp

19
.gitpod.Dockerfile vendored
View File

@@ -1,10 +1,15 @@
FROM threefolddev/publishtools:latest
ENV DEBIAN_FRONTEND=noninteractive
FROM gitpod/workspace-full:latest
USER root
RUN apt-get update && apt-get install -y mc rsync
#prepare for gitpod nodejs env
RUN rm -f /tmp/install_docker.sh && curl -s -o /tmp/install_docker.sh https://raw.githubusercontent.com/threefoldfoundation/data_threefold/development/gitpod_scripts/install_docker.sh && bash /tmp/install_docker.sh
# RUN apt-get clean && rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*
USER gitpod
RUN cd /tmp && wget https://raw.githubusercontent.com/threefoldfoundation/www_threefold_io/development/sites.json && sudo publishtools update && sudo publishtools install || echo "try 1"
USER root
RUN cd /tmp && sudo publishtools install --reset
ENTRYPOINT [ "entrypoint.sh" ]
# ENTRYPOINT [ "/usr/bin/bash" ]

View File

@@ -2,7 +2,13 @@ image:
file: .gitpod.Dockerfile
# # Commands to start on workspace startup
tasks:
- command: sudo /etc/init.d/redis-server start && sudo publishtools develop --repo www_threefold_io
# - init: bash /workspace/www_threefold_io/gitpod/install.sh
- command: |
rm -f /tmp/install.sh
curl -s -o /tmp/install.sh https://raw.githubusercontent.com/threefoldfoundation/data_threefold/development/install.sh
bash /tmp/install.sh
bash /workspace/data_threefold/gitpod_scripts/install.sh
bash /workspace/data_threefold/gitpod_scripts/run.sh
ports:
- port: 8080
onOpen: open-browser

View File

@@ -6,7 +6,27 @@ navLinks:
external: false
expandable: false
- name: Grid
- name: Token
link: ""
external: false
expandable: true
submenu:
- title: Token Introduction
path: /token
- title: Buy TFT
path: https://threefold.io/info/threefold#/threefold__how_to_buy_and_sell
external: true
- title: Tokenomics
path: https://threefold.io/info/threefold#/threefold__tokenomics
external: true
- title: Distribution
path: https://threefold.io/info/threefold#/threefold__token_overview
external: true
- title: FAQ
path: https://forum.threefold.io/c/threefold-token/tft-faq/57
external: true
- name: Farming
link: "" # /dropdown
external: false
expandable: true
@@ -24,43 +44,36 @@ navLinks:
path: https://forum.threefold.io/c/farming/farming-faq/53
external: true
- name: Token
link: ""
external: false
expandable: true
submenu:
- title: Token Introduction
path: /token
- title: How to buy TFT
path: https://threefold.io/info/threefold#/threefold__how_to_buy_and_sell
external: true
- title: ThreeFold Tokenomics
path: https://threefold.io/info/threefold#/threefold__tokenomics
external: true
- title: Token Distribution
path: https://threefold.io/info/threefold#/threefold__token_overview
external: true
- title: FAQ
path: https://forum.threefold.io/c/threefold-token/tft-faq/57
external: true
- name: Use
link: ""
external: false
link: "https://cloud.threefold.io/"
external: true
expandable: true
submenu:
- title: Kubernetes Cloud
path: https://threefold.io/info/cloud#/cloud__evdc
external: true
- title: Quantum-Safe Storage
path: https://threefold.io/info/cloud#/cloud__threefold_filesystem
external: true
- title: Partners
path: /partners
- title: ThreeFold Cloud
path: https://cloud.threefold.io
external: true
- title: ThreeFold Marketplace
path: https://threefold.io/marketplace
external: true
- title: Digital Twin
path: https://mydigitaltwin.io/
external: true
- title: Developers (SDK)
path: https://sdk.threefold.io/
external: true
# - title: Kubernetes Cloud
# path: https://threefold.io/info/cloud#/cloud__evdc
# external: true
# - title: Quantum-Safe Storage
# path: https://threefold.io/info/cloud#/cloud__threefold_filesystem
# external: true
# - name: Partners
# link: "/partners" # /dropdown
# external: false
# expandable: false
- name: Technology
link: "" # /dropdown
@@ -68,7 +81,7 @@ navLinks:
expandable: true
submenu:
- title: Grid Technology
path: https://threefold.io/info/threefold#/internet4__zos_3node_tfgrid_intro
path: https://threefold.io/info/threefold#/internet4__technology
external: true
- title: Zero-OS
path: https://threefold.io/info/threefold#/internet4__tfgrid_primitives
@@ -82,7 +95,7 @@ navLinks:
- title: Web2 vs Web3 vs P2P
path: https://threefold.io/info/threefold#/threefold__grid_compare
external: true
- title: FAQ
- title: FAQ / Forum
path: https://forum.threefold.io/c/technical-discussion/technical-faq/55
external: true

53
gitpod/install.sh Normal file
View File

@@ -0,0 +1,53 @@
set -e
export base=/nodejs
sudo chown gitpod:gitpod -R $base
export PATH=$base/bin:$PATH
source $base/nvm.sh
cd $base
rm -f yarn.lock
rm -rf .cache
nvm install --lts
nvm use --lts
npm install --global @gridsome/cli
#go to the website
cd /workspace/www_threefold_io
rm -f yarn.lock
rm -rf .cache
#copy from the docker image to speedup
echo "sync node modules to website"
rsync -ra --delete $base/node_modules/ node_modules/
echo "done"
#make sure all modules are there
npm install
cd /workspace
if ! [ -d "/workspace/data_threefold" ]
then
git clone https://github.com/threefoldfoundation/data_threefold
fi
rm -f ../content/blog
ln -s /workspace/data_threefold/content/blog ../content/blog
rm -f ../content/news
ln -s /workspace/data_threefold/content/news ../content/news
rm -f ../content/person
ln -s /workspace/data_threefold/content/person ../content/person
rm -f ../content/project
ln -s /workspace/data_threefold/content/project ../content/project

25
gitpod/install_docker.sh Normal file
View File

@@ -0,0 +1,25 @@
set -ex
sudo chown gitpod:gitpod -R /tmp
export base=/nodejs
export lts=14.17.3
echo $base
sudo mkdir -p $base
sudo chown gitpod:gitpod -R $base
cd $base
rm -f $base/nvm.sh
curl -s -o nvm.sh https://raw.githubusercontent.com/nvm-sh/nvm/master/nvm.sh
bash nvm.sh
export NVM_DIR=$base
source $base/nvm.sh
nvm install --lts
nvm use --lts
cp /tmp/package.json .
npm install --global @gridsome/cli
npm install

18
gitpod/run.sh Normal file
View File

@@ -0,0 +1,18 @@
set -e
export base=/nodejs
export PATH=$base/bin:$PATH
source $base/nvm.sh
nvm use --lts
#go to the website
cd /workspace/www_threefold_io
if [ -f vue.config.js ]; then
npm run-script serve
else
gridsome develop
fi

7
install_gitpod.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
rm -f /tmp/install.sh
curl -s -o /tmp/install.sh https://raw.githubusercontent.com/threefoldfoundation/data_threefold/development/install.sh
bash /tmp/install.sh
bash /workspace/data_threefold/gitpod_scripts/install.sh
bash /workspace/data_threefold/gitpod_scripts/run.sh

2
run.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
bash /workspace/data_threefold/gitpod_scripts/run.sh

View File

@@ -1,55 +0,0 @@
[{
"name": "www_threefold_io",
"url": "https://github.com/threefoldfoundation/www_threefold_io",
"branch": "",
"pull": false,
"reset": false,
"cat": 2,
"shortname": "threefold",
"path_code": "",
"domains": ["www.threefold.io", "www.threefold.me", "threefold.me", "new.threefold.io", "staging.threefold.io", "threefold.io"],
"descr": "is our entry point for everyone, redirect to the detailed websites underneith.",
"groups": [{
"name": "tf1",
"members_users": ["kristof", "adnan", "rob"],
"members_groups": []
}, {
"name": "tf2",
"members_users": ["polleke"],
"members_groups": ["tf1"]
}],
"acl": [],
"trackingid": "",
"opengraph": {
"title": "",
"description": "",
"url": "",
"type_": "article",
"image": "",
"image_width": "1200",
"image_height": "630"
}
}, {
"name": "data_threefold",
"url": "https://github.com/threefoldfoundation/data_threefold",
"branch": "",
"pull": false,
"reset": false,
"cat": 1,
"shortname": "data",
"path_code": "",
"domains": [],
"descr": "",
"groups": [],
"acl": [],
"trackingid": "",
"opengraph": {
"title": "",
"description": "",
"url": "",
"type_": "article",
"image": "",
"image_width": "1200",
"image_height": "630"
}
}]

11
workspace.code-workspace Normal file
View File

@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "."
},
{
"path": "../data_threefold"
}
],
"settings": {}
}