diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24a63b809..f6e6b62ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,20 @@ stages: - build_and_deploy_website - test +.website_build: &website_build + stage: build_and_deploy_website + image: node:8 + before_script: + - cd gitlab-pages/website + - npm install + script: + - npm run version next + - npm run build + after_script: + - cp -r gitlab-pages/website/build/ligo public + artifacts: + paths: + - public .docker: &docker image: docker:1.11 @@ -16,7 +30,7 @@ stages: .docker_build: &docker_build 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: @@ -90,8 +104,9 @@ build-current-docker-image: <<: *docker_build except: - 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 build-and-publish-latest-docker-image: stage: build_and_deploy_docker @@ -99,25 +114,16 @@ build-and-publish-latest-docker-image: <<: *docker_build after_script: - docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD - - docker push $LIGO_REGISTRY_IMAGE:latest + - docker push $LIGO_REGISTRY_IMAGE:next only: - - master + - dev +# Pages are deployed from both master & dev, be careful not to override 'next' +# in case something gets merged into 'dev' while releasing. pages: - stage: build_and_deploy_website - image: node:8 - before_script: - - cd gitlab-pages/website - - npm install - script: - - npm run build - - pwd - - cd ../.. - - pwd - - cp -r gitlab-pages/website/build/ligo public - artifacts: - paths: - - public + <<: *website_build only: - master + - dev + diff --git a/gitlab-pages/.gitignore b/gitlab-pages/.gitignore index 5395ea795..3f87a979e 100644 --- a/gitlab-pages/.gitignore +++ b/gitlab-pages/.gitignore @@ -10,3 +10,5 @@ website/build/ website/yarn.lock website/node_modules website/i18n/* +website/versioned_docs/version-next +website/versioned_sidebars/version-next-sidebars.json \ No newline at end of file diff --git a/gitlab-pages/Makefile b/gitlab-pages/Makefile deleted file mode 100644 index fab8d821f..000000000 --- a/gitlab-pages/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -up: - docker-compose up diff --git a/gitlab-pages/docker-compose.yml b/gitlab-pages/docker-compose.yml index 6711192ae..79619bae3 100644 --- a/gitlab-pages/docker-compose.yml +++ b/gitlab-pages/docker-compose.yml @@ -13,6 +13,9 @@ services: - ./website/i18n:/app/website/i18n - ./website/pages:/app/website/pages - ./website/static:/app/website/static + - ./website/versioned_sidebars:/app/website/versioned_sidebars + - ./website/versioned_docs:/app/website/versioned_docs - ./website/sidebars.json:/app/website/sidebars.json - ./website/siteConfig.js:/app/website/siteConfig.js + - ./website/versions.json:/app/website/versions.json working_dir: /app/website diff --git a/gitlab-pages/docs/contributors/documentation-and-releases.md b/gitlab-pages/docs/contributors/documentation-and-releases.md new file mode 100644 index 000000000..977c9a9c7 --- /dev/null +++ b/gitlab-pages/docs/contributors/documentation-and-releases.md @@ -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. diff --git a/gitlab-pages/docs/contributors/contributing/getting-started.md b/gitlab-pages/docs/contributors/getting-started.md similarity index 100% rename from gitlab-pages/docs/contributors/contributing/getting-started.md rename to gitlab-pages/docs/contributors/getting-started.md diff --git a/gitlab-pages/docs/setup-installation.md b/gitlab-pages/docs/setup-installation.md index a08db5e30..09ef1b47c 100644 --- a/gitlab-pages/docs/setup-installation.md +++ b/gitlab-pages/docs/setup-installation.md @@ -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. -## Docker +## Dockerized installation (recommended) > 🐳 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. ### 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/raw/dev/scripts/installer.sh | bash "next" + +# e.g. 1.0.0 (stable) +curl https://gitlab.com/ligolang/ligo/raw/master/scripts/installer.sh | bash "1.0.0" +``` **Verify your ligo installation by running:** ```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). diff --git a/gitlab-pages/website/package.json b/gitlab-pages/website/package.json index e2dbb5afb..082937488 100644 --- a/gitlab-pages/website/package.json +++ b/gitlab-pages/website/package.json @@ -6,6 +6,8 @@ "publish-gh-pages": "docusaurus-publish", "write-translations": "docusaurus-write-translations", "version": "docusaurus-version", + "preversion": "node preversion.js", + "postversion": "node postversion.js", "rename-version": "docusaurus-rename-version" }, "devDependencies": { diff --git a/gitlab-pages/website/pages/en/index.js b/gitlab-pages/website/pages/en/index.js index 6836c9ff1..832ff325e 100644 --- a/gitlab-pages/website/pages/en/index.js +++ b/gitlab-pages/website/pages/en/index.js @@ -26,22 +26,22 @@ class HomeSplash extends React.Component {
-
-