Add updated installation guide, restructure docs

This commit is contained in:
Matej Sima 2019-06-06 16:49:47 +02:00
parent 0e6a3f6721
commit c0cc9c76dc
12 changed files with 68 additions and 83 deletions

View File

@ -31,7 +31,7 @@ stages:
.docker_build: &docker_build .docker_build: &docker_build
script: script:
- docker build -t $LIGO_REGISTRY_IMAGE:latest -f ./docker/Dockerfile . - docker build -t $LIGO_REGISTRY_IMAGE:next -f ./docker/Dockerfile .
.before_script: &before_script .before_script: &before_script
before_script: before_script:
@ -105,8 +105,9 @@ stages:
<<: *docker_build <<: *docker_build
except: except:
- master - master
- dev
# When a MR/PR is merged to master # When a MR/PR is merged to dev
# take the previous build and publish it to Docker Hub # take the previous build and publish it to Docker Hub
.build-and-publish-latest-docker-image: .build-and-publish-latest-docker-image:
stage: build_and_deploy_docker stage: build_and_deploy_docker
@ -114,9 +115,9 @@ stages:
<<: *docker_build <<: *docker_build
after_script: after_script:
- docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD - docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD
- docker push $LIGO_REGISTRY_IMAGE:latest - docker push $LIGO_REGISTRY_IMAGE:next
only: only:
- master - dev
# Pages are deployed from both master & dev, be careful not to override 'next' # Pages are deployed from both master & dev, be careful not to override 'next'

View File

@ -10,5 +10,7 @@ website/build/
website/yarn.lock website/yarn.lock
website/node_modules website/node_modules
website/i18n/* website/i18n/*
website/versioned_docs/version-mock
website/versioned_docs/version-next website/versioned_docs/version-next
website/versioned_sidebars/version-mock-sidebars.json
website/versioned_sidebars/version-next-sidebars.json website/versioned_sidebars/version-next-sidebars.json

View File

@ -1,2 +0,0 @@
up:
docker-compose up

View File

@ -0,0 +1,20 @@
---
id: documentation-and-releases
title: Documentation and releases
---
## Documentation
In case you'd like to contribute to the docs, you can find them at [`gitlab-pages/docs`]() in their raw markdown form.
Deployment of the docs/website for LIGO is taken care of within the CI, from `dev` and `master` branches.
## Releases & versioning
### Development releases (next)
Development releases of Ligo are tagged as `next` and are built with each commit to the `dev` branch. Both the docker image & the website are published automatically.
### Stable releases
Releases tagged with version numbers `x.x.x` are built manually, both docs & the docker image. While deployment of the website is handled by the CI.

View File

@ -5,22 +5,24 @@ title: Installation
There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either the Docker image, or to compile & build the Ligo CLI yourself. There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either the Docker image, or to compile & build the Ligo CLI yourself.
## Docker ## Dockerized installation (recommended)
> 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/). > 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/).
Easiest way to use LIGO is through the Docker image available at [Docker Hub](https://hub.docker.com/r/stovelabs/granary-ligo). Sources for the image can be found on [Github](https://github.com/stove-labs/granary/blob/develop/docker/ligo/Dockerfile). Easiest way to use LIGO is through the Docker image available at [Docker Hub](https://hub.docker.com/r/ligolang/ligo). Sources for the image can be found on [Gitlab](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile).
You can either run the docker image yourself, or you can setup a global ligo executable as shown below. You can either run the docker image yourself, or you can setup a global ligo executable as shown below.
### Setting up a globally available `ligo` executable ### Setting up a globally available `ligo` executable
```zsh
wget https://gitlab.com/maht0rz/ligo-documentation/blob/master/ligo-docker.sh && \
sudo cp ligo-docker.sh /usr/local/bin/ligo && \
sudo chmod +x /usr/local/bin/ligo && \
rm ligo-docker.sh
```
> ⚠️ Please note that the **current docker image is quite chunky**, it may take a while to download depending on your internet connection. > You can install additional ligo versions by replacing `next` with the required version number
```zsh
# next (pre-release)
curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash "next"
# e.g. 1.0.0 (stable)
curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash "1.0.0"
```
**Verify your ligo installation by running:** **Verify your ligo installation by running:**
```zsh ```zsh
@ -28,9 +30,9 @@ ligo --help
``` ```
## Manual installation ## Manual installation (advanced)
For now, please refer to the steps described in the [Dockerfile](https://github.com/stove-labs/granary/blob/develop/docker/ligo/Dockerfile). For now, please refer to the steps described in the [Dockerfile](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile).

View File

@ -5,7 +5,7 @@
"API": ["api-cli-commands"] "API": ["api-cli-commands"]
}, },
"contributors-docs": { "contributors-docs": {
"Introduction": ["contributors/origin", "contributors/philosophy"], "Introduction": ["contributors/origin", "contributors/philosophy", "contributors/getting-started", "contributors/documentation-and-releases"],
"Big Picture": [ "Big Picture": [
"contributors/big-picture/overview", "contributors/big-picture/overview",
"contributors/big-picture/front-end", "contributors/big-picture/front-end",
@ -13,7 +13,6 @@
"contributors/big-picture/back-end", "contributors/big-picture/back-end",
"contributors/big-picture/vendors" "contributors/big-picture/vendors"
], ],
"Road Map": ["contributors/road-map/short-term", "contributors/road-map/long-term"], "Road Map": ["contributors/road-map/short-term", "contributors/road-map/long-term"]
"Contributing": ["contributors/contributing/getting-started"]
} }
} }

View File

@ -1,41 +0,0 @@
---
id: version-next-getting-started
title: Getting started
original_id: getting-started
---
## Where
As weve seen, LIGO is big, as such, it is easier to start focus on a specific part of LIGO. As very vague suggestions:
If you want to immediately see the result of your contributions, you might want to start with the Front-End. This is what most people will directly see of LIGO.
If you want to get into Programming Language Theory, you might want to start with the Middle-End. This is where the Type System and the Language Definition are (the closest thing so far that youll find in a research paper).
If you want to get into the nitty gritty details of compiling to special targets, youll want to focus on the Back-End.
If you want to develop tooling on top of LIGO (editor integration, for instance), youll want to look at `Ast_typed/types.ml`. This is where most information that is relevant to devs will be (for now).
If you really want to get a grasp of the whole pipeline, search for issues tagged with “Everything”, theyll have you look at multiple parts of the code base.
## What
Likely, the first issues will be about:
Adding tests
Extending the languages by adding new operators
Adding tests
Refactoring
Writing documentation and tutorials for users
Adding tests
Writing internal documentation when you understand a part of the code base
>Tests are **really** important, we dont have lots of them, and mostly regression ones. This cant be stressed enough. Some features are missing not because we cant add them, but because we dont know so as no tests tell us they are missing.
## How
Issues will be added to the Gitlab, tagged with On-boarding and Front-End / Middle-End / Back-End / Everything. If you try to tackle one issue, and you have **any** problem, please tell us, by creating a new Gitlab issue, contacting us on Riot, Discord or even by mail! Problems might include:
Installing the repository or the tools needed to work on it
OCaml weirdness
Understanding undocumented parts of the code base
Documented parts of the code base too
**Anything really**
---
## FAQ
### I dont know much about OCaml, where should I start? What should I have in mind?
Id suggesting going through Real World OCaml to get a feel for the language, to know what are its features, and to know what to Google when youre lost.
Beyond that, Id say, start hacking! Either on LIGOs code base, or on any personal project.
There is a Discord server if you want real-time help (which makes things go way faster than waiting for an answer on stackoverflow or looking mindlessly at the monitor).
### I want to add [X] to LIGO! Where should I begin?
Trying to add a new feature from scratch instead of building upon one can be quite complicated. However, if youre motivated, contact us! Well tell you what we see as the most likely plan to get the result you want to achieve.

View File

@ -6,22 +6,24 @@ original_id: setup-installation
There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either the Docker image, or to compile & build the Ligo CLI yourself. There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either the Docker image, or to compile & build the Ligo CLI yourself.
## Docker ## Dockerized installation (recommended)
> 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/). > 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/).
Easiest way to use LIGO is through the Docker image available at [Docker Hub](https://hub.docker.com/r/stovelabs/granary-ligo). Sources for the image can be found on [Github](https://github.com/stove-labs/granary/blob/develop/docker/ligo/Dockerfile). Easiest way to use LIGO is through the Docker image available at [Docker Hub](https://hub.docker.com/r/ligolang/ligo). Sources for the image can be found on [Gitlab](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile).
You can either run the docker image yourself, or you can setup a global ligo executable as shown below. You can either run the docker image yourself, or you can setup a global ligo executable as shown below.
### Setting up a globally available `ligo` executable ### Setting up a globally available `ligo` executable
```zsh
wget https://gitlab.com/maht0rz/ligo-documentation/blob/master/ligo-docker.sh && \
sudo cp ligo-docker.sh /usr/local/bin/ligo && \
sudo chmod +x /usr/local/bin/ligo && \
rm ligo-docker.sh
```
> ⚠️ Please note that the **current docker image is quite chunky**, it may take a while to download depending on your internet connection. > You can install additional ligo versions by replacing `next` with the required version number
```zsh
# next (pre-release)
curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash "next"
# e.g. 1.0.0 (stable)
curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash "1.0.0"
```
**Verify your ligo installation by running:** **Verify your ligo installation by running:**
```zsh ```zsh
@ -29,11 +31,9 @@ ligo --help
``` ```
## Manual installation ## Manual installation (advanced)
For now, please refer to the steps described in the [Dockerfile](https://github.com/stove-labs/granary/blob/develop/docker/ligo/Dockerfile). For now, please refer to the steps described in the [Dockerfile](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile).
## next-2

View File

@ -16,7 +16,9 @@
"version-next-contributors-docs": { "version-next-contributors-docs": {
"Introduction": [ "Introduction": [
"version-next-contributors/origin", "version-next-contributors/origin",
"version-next-contributors/philosophy" "version-next-contributors/philosophy",
"version-next-contributors/getting-started",
"version-next-contributors/documentation-and-releases"
], ],
"Big Picture": [ "Big Picture": [
"version-next-contributors/big-picture/overview", "version-next-contributors/big-picture/overview",
@ -28,9 +30,6 @@
"Road Map": [ "Road Map": [
"version-next-contributors/road-map/short-term", "version-next-contributors/road-map/short-term",
"version-next-contributors/road-map/long-term" "version-next-contributors/road-map/long-term"
],
"Contributing": [
"version-next-contributors/contributing/getting-started"
] ]
} }
} }

View File

@ -1 +1 @@
["0.0.1"] []

View File

@ -3,10 +3,15 @@
# curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash # curl https://gitlab.com/ligolang/ligo/blob/master/scripts/installer.sh | bash
# Make sure the marigold/ligo image is published at docker hub first # Make sure the marigold/ligo image is published at docker hub first
set -euET -o pipefail set -euET -o pipefail
echo "Installing LIGO" version=$1
printf "\nInstalling LIGO ($version)\n\n"
# Install the ligo.sh from master # Install the ligo.sh from master
wget https://gitlab.com/ligolang/ligo/blob/master/scripts/ligo.sh wget https://gitlab.com/ligolang/ligo/raw/master/scripts/ligo.sh
# Overwrite LIGO version in the executable
sed -i '' "s/latest/$version/g" ligo.sh
# Copy the exucutable to the appropriate directory # Copy the exucutable to the appropriate directory
sudo cp ligo.sh /usr/local/bin/ligo sudo cp ligo.sh /usr/local/bin/ligo
@ -14,7 +19,7 @@ sudo chmod +x /usr/local/bin/ligo
rm ligo.sh rm ligo.sh
# Pull the docker image used by ligo.sh # Pull the docker image used by ligo.sh
docker pull ligolang/ligo:latest docker pull "ligolang/ligo:$version"
# Installation finished, try running 'ligo' from your CLI # Installation finished, try running 'ligo' from your CLI
echo "Installation successful, try to run 'ligo --help' now. \n" printf "\nInstallation successful, try to run 'ligo --help' now.\n"