Merge branch 'webide/generate-deploy-script' of gitlab.com:edmondlee/ligo into webide/generate-deploy-script

This commit is contained in:
Edmond Lee 2020-05-25 11:24:06 -07:00
commit 5ae429c4ef
10 changed files with 2662 additions and 2248 deletions

View File

@ -7,6 +7,7 @@ variables:
stages:
- build
- push
- ide-deploy
- versioning
.docker-image:
@ -29,6 +30,7 @@ version_scheduled_job:
before_script:
- find "$CI_PROJECT_DIR" -path "$CI_PROJECT_DIR/.git" -prune -o "(" -type d -a -not -perm -u=w ")" -exec chmod --verbose u+w {} ";"
- nix-env -f channel:nixos-unstable -iA gnutar gitMinimal
- export COMMIT_DATE="$(git show --no-patch --format=%ci)"
# The binary produced is useless by itself
binary:
@ -66,15 +68,12 @@ test:
paths:
- coverage
# FIXME For some reason, e2e tests can't build on CI.
.webide-e2e:
webide-e2e:
extends: .nix
rules:
- changes:
- tools/webide/**
when: always
- if: '$CI_COMMIT_REF_NAME =~ /^(dev|.*-run-dev)$/ && $CI_PROJECT_PATH == "ligolang/ligo"'
when: always
only:
- merge_requests
- dev
- /^.*-run-dev$/
script:
- nix-build nix -A ligo-editor.e2e
@ -121,7 +120,6 @@ webide-docker:
paths:
- webide.tar.gz
webide-push:
extends: .docker-image
dependencies:
@ -138,6 +136,17 @@ webide-push:
- docker tag ligo-editor "${WEBIDE_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}"
- docker push "${WEBIDE_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}"
deploy-handoff:
# Handoff deployment duties to private repo
stage: ide-deploy
variables:
IDE_DOCKER_IMAGE: "registry.gitlab.com/${CI_PROJECT_PATH}/ligo_webide"
LIGO_COMMIT_REF_NAME: "${CI_COMMIT_SHORT_SHA}"
trigger: ligolang/ligo-webide-deploy
rules:
- if: '$CI_COMMIT_REF_NAME == "dev"'
when: always
static-binary:
extends: .nix
only:

View File

@ -40,20 +40,31 @@ curl https://gitlab.com/ligolang/ligo/raw/master/scripts/installer.sh | bash -s
ligo --help
```
## Static Linux binary
The `ligo` executable is statically linked. It should run on most modern Linux distributions.
To use it, get it [here](/bin/linux/ligo), make it executable, you're done!
```zsh
wget https://ligolang.org/bin/linux/ligo
chmod +x ./ligo
```
Optionally, you can put it somewhere in your `PATH` for easy access:
```zsh
sudo cp ./ligo /usr/local/bin
```
## Debian Linux package installation
We have produced .deb packages for a few Debian Linux versions. They will install a global `ligo` executable.
First download one of the packages below, and then install using:
A `.deb` package containing the static `ligo` executable is also available.
First download [the package](/deb/ligo.deb), and then install using:
```zsh
sudo apt install ./ligo.deb
```
sudo apt install ./<package_name_here>.deb
```
- [Ubuntu 18.04](/deb/ligo_ubuntu-18.04.deb)
- [Ubuntu 19.10](/deb/ligo_ubuntu-19.10.deb)
- [Debian 9](/deb/ligo_debian-9.deb)
- [Debian 10](/deb/ligo_debian-10.deb)
## Release schedule

View File

@ -1,7 +1,8 @@
{ dockerTools, writeShellScriptBin, runCommand, mcpp, bash, coreutils, ligo, name ? "ligo" }:
{ dockerTools, writeShellScriptBin, runCommand, mcpp, bash, coreutils, ligo
, name ? "ligo", extraContents ? [ ] }:
dockerTools.buildLayeredImage {
inherit name;
tag = "latest";
contents = [ ligo bash ];
contents = [ ligo bash ] ++ extraContents;
config.Entrypoint = name;
}

View File

@ -9,7 +9,7 @@ buildNpmPackage {
'';
installPhase = ''
cp -Lr build $out
cp -r ${ligo-deb}/* $out/deb
cp -r ${ligo-deb}/*.deb $out/deb/ligo.deb
mkdir -p $out/bin/linux
cp -r ${ligo-static}/bin/ligo $out/bin/linux/ligo
cp -r ${ligo-doc}/share/doc $out/odoc

View File

@ -20,6 +20,9 @@ let
pkgs.runCommandNoCC "${pkg.name}-bin" { }
"mkdir -p $out/bin; cp -Lr ${pkg}/ligo $out/bin";
tmp = pkgs.runCommandNoCC "tmpdir" { } "mkdir -p $out/tmp";
in pkgs.extend (self: super: {
inherit (self.ocamlPackages) ligo ligo-out ligo-tests ligo-doc ligo-coverage;
ligo-bin = separateBinary self.ligo-out.bin;
@ -29,6 +32,7 @@ in pkgs.extend (self: super: {
ligo-editor-docker = self.callPackage ./docker.nix {
ligo = self.ligo-editor;
name = "ligo-editor";
extraContents = [ tmp ];
};
ligo-website = self.callPackage ./ligo-website.nix {
inherit (nix-npm-buildpackage) buildNpmPackage;

View File

@ -338,7 +338,7 @@ let rec compile_expression :
let (p , loc) = r_split p in
let var =
let name = Var.of_name p.struct_name.value in
e_variable name in
e_variable ~loc name in
let path = p.field_path in
let path' =
let aux (s:Raw.selection) =
@ -532,7 +532,7 @@ let rec compile_expression :
| EBytes x ->
let (x , loc) = r_split x in
return @@ e_literal ~loc (Literal_bytes (Hex.to_bytes @@ snd x))
| ETuple tpl -> compile_tuple_expression @@ (npseq_to_list tpl.value)
| ETuple tpl -> compile_tuple_expression ~loc:(Location.lift tpl.region) @@ (npseq_to_list tpl.value)
| ERecord r ->
let (r , loc) = r_split r in
let%bind fields = bind_list

View File

@ -45,14 +45,13 @@ module Errors = struct
] in
error ~data title message ()
let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () =
let unbound_variable (e:environment) (n:I.expression_variable) () =
let name () = Format.asprintf "%a" I.PP.expression_variable n in
let title = (thunk ("unbound variable "^(name ()))) in
let message () = "" in
let data = [
("variable" , name) ;
("environment" , fun () -> Format.asprintf "%a" Environment.PP.environment e) ;
("location" , fun () -> Format.asprintf "%a" Location.pp loc)
] in
error ~data title message ()
@ -698,7 +697,7 @@ and type_expression' : environment -> ?tv_opt:O.type_expression -> I.expression
(* Basic *)
| E_variable name ->
let%bind tv' =
trace_option (unbound_variable e name ae.location)
trace_option (unbound_variable e name)
@@ Environment.get_opt name e in
return (E_variable name) tv'.type_value
| E_literal Literal_unit ->

View File

@ -16168,6 +16168,11 @@
}
}
},
"slugify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.0.tgz",
"integrity": "sha512-FtLNsMGBSRB/0JOE2A0fxlqjI6fJsgHGS13iTuVT28kViI4JjUiNqp/vyis0ZXYcMnpR3fzGNkv+6vRlI2GwdQ=="
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",

View File

@ -3317,8 +3317,7 @@
"gensync": {
"version": "1.0.0-beta.1",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz",
"integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==",
"dev": true
"integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg=="
},
"get-caller-file": {
"version": "2.0.5",

File diff suppressed because it is too large Load Diff