2019-05-27 19:06:18 +04:00
|
|
|
# TODO: remove this as submodules aren't used anymore.
|
2019-05-14 20:16:14 +04:00
|
|
|
variables:
|
2019-05-14 20:17:39 +04:00
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
2020-02-07 06:43:24 +04:00
|
|
|
LIGO_REGISTRY_IMAGE_BASE_NAME: "${CI_PROJECT_PATH}/${CI_PROJECT_NAME}"
|
2020-02-14 03:10:02 +04:00
|
|
|
WEBIDE_IMAGE_NAME: "registry.gitlab.com/${CI_PROJECT_PATH}/ligo_webide"
|
2019-05-14 20:16:14 +04:00
|
|
|
|
2019-05-27 14:06:56 +04:00
|
|
|
stages:
|
2020-05-18 15:09:40 +04:00
|
|
|
- build
|
|
|
|
- push
|
2020-05-21 20:03:15 +04:00
|
|
|
- ide-deploy
|
2020-05-15 19:57:22 +04:00
|
|
|
- versioning
|
2019-08-12 12:41:53 +04:00
|
|
|
|
2020-05-20 16:33:44 +04:00
|
|
|
.docker-image:
|
|
|
|
stage: push
|
2020-02-15 18:49:39 +04:00
|
|
|
image: docker:19.03.5
|
2019-05-27 14:06:56 +04:00
|
|
|
services:
|
2020-02-15 18:49:39 +04:00
|
|
|
- docker:19.03.5-dind
|
2019-05-27 18:31:57 +04:00
|
|
|
|
2020-05-15 19:57:22 +04:00
|
|
|
version_scheduled_job:
|
|
|
|
stage: versioning
|
|
|
|
script:
|
|
|
|
- scripts/versioning.sh
|
|
|
|
only:
|
|
|
|
- schedules
|
|
|
|
|
2020-05-20 16:33:44 +04:00
|
|
|
.nix:
|
|
|
|
stage: build
|
2020-05-18 15:09:40 +04:00
|
|
|
tags:
|
|
|
|
- nix
|
2020-03-25 22:14:18 +04:00
|
|
|
before_script:
|
2020-05-18 15:09:40 +04:00
|
|
|
- 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
|
2020-03-25 22:14:18 +04:00
|
|
|
|
|
|
|
# The binary produced is useless by itself
|
2020-05-18 15:09:40 +04:00
|
|
|
binary:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-bin
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
doc:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-doc
|
2020-05-18 15:09:40 +04:00
|
|
|
- cp -Lr --no-preserve=mode,ownership,timestamps result/share/doc .
|
2020-03-25 22:14:18 +04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-05-18 15:09:40 +04:00
|
|
|
- doc
|
2020-03-25 22:14:18 +04:00
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
test:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-coverage
|
2020-05-18 15:09:40 +04:00
|
|
|
- cp -Lr --no-preserve=mode,ownership,timestamps result/share/coverage .
|
2020-03-25 22:14:18 +04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-05-18 15:09:40 +04:00
|
|
|
- coverage
|
2020-03-25 22:14:18 +04:00
|
|
|
|
2020-05-21 20:13:11 +04:00
|
|
|
webide-e2e:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-editor.e2e
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
docker:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-docker
|
|
|
|
- cp -L result ligo.tar.gz
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ligo.tar.gz
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
docker-push:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .docker-image
|
2020-03-25 22:14:18 +04:00
|
|
|
dependencies:
|
2020-05-18 15:09:40 +04:00
|
|
|
- docker
|
2020-03-25 22:14:18 +04:00
|
|
|
needs:
|
2020-05-18 15:09:40 +04:00
|
|
|
- docker
|
2020-03-25 22:14:18 +04:00
|
|
|
rules:
|
|
|
|
# Only deploy docker when from the dev branch AND on the canonical ligolang/ligo repository
|
|
|
|
- if: '$CI_COMMIT_REF_NAME =~ /^(dev|.*-run-dev)$/ && $CI_PROJECT_PATH == "ligolang/ligo"'
|
|
|
|
when: always
|
|
|
|
script:
|
|
|
|
- echo ${LIGO_REGISTRY_PASSWORD} | docker login -u ${LIGO_REGISTRY_USER} --password-stdin
|
|
|
|
- docker load -i=./ligo.tar.gz
|
2020-05-18 15:09:40 +04:00
|
|
|
- export LIGO_REGISTRY_FULL_NAME=${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:$(if test "$CI_COMMIT_REF_NAME" = "dev"; then echo next; else echo next-attempt; fi)
|
2020-03-25 22:14:18 +04:00
|
|
|
- docker tag ligo "${LIGO_REGISTRY_FULL_NAME}"
|
|
|
|
- docker push "${LIGO_REGISTRY_FULL_NAME}"
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
webide-docker:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-editor-docker
|
|
|
|
- cp -L result webide.tar.gz
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- webide.tar.gz
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
webide-push:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .docker-image
|
2020-03-25 22:14:18 +04:00
|
|
|
dependencies:
|
2020-05-18 15:09:40 +04:00
|
|
|
- webide-docker
|
2020-03-25 22:14:18 +04:00
|
|
|
needs:
|
2020-05-18 15:09:40 +04:00
|
|
|
- webide-docker
|
2020-03-25 22:14:18 +04:00
|
|
|
rules:
|
|
|
|
# Only deploy docker when from the dev branch AND on the canonical ligolang/ligo repository
|
|
|
|
- if: '$CI_COMMIT_REF_NAME =~ /^(dev|.*-run-dev)$/ && $CI_PROJECT_PATH == "ligolang/ligo"'
|
|
|
|
when: always
|
|
|
|
script:
|
|
|
|
- echo "${CI_BUILD_TOKEN}" | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
|
|
|
|
- docker load -i=./webide.tar.gz
|
2020-05-18 15:09:40 +04:00
|
|
|
- docker tag ligo-editor "${WEBIDE_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}"
|
|
|
|
- docker push "${WEBIDE_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}"
|
2020-03-25 22:14:18 +04:00
|
|
|
|
2020-05-21 20:03:15 +04:00
|
|
|
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
|
|
|
|
|
2020-05-18 15:09:40 +04:00
|
|
|
static-binary:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
only:
|
2020-05-18 15:09:40 +04:00
|
|
|
- merge_requests
|
2020-03-25 22:14:18 +04:00
|
|
|
- dev
|
|
|
|
- /^.*-run-dev$/
|
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-static
|
|
|
|
# Check that the binary is truly static and has 0 dependencies
|
|
|
|
- test $(nix-store -q --references ./result | wc -l) -eq 0
|
2020-05-18 15:09:40 +04:00
|
|
|
- cp -L result/bin/ligo ligo
|
|
|
|
- chmod +rwx ligo
|
2020-03-25 22:14:18 +04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-05-18 15:09:40 +04:00
|
|
|
- ligo
|
2020-03-25 22:14:18 +04:00
|
|
|
|
2020-05-20 16:33:44 +04:00
|
|
|
.website:
|
|
|
|
extends: .nix
|
2020-03-25 22:14:18 +04:00
|
|
|
script:
|
|
|
|
- nix-build nix -A ligo-website
|
2020-05-18 15:09:40 +04:00
|
|
|
- cp -Lr --no-preserve=mode,ownership,timestamps result/ public
|
2020-03-25 22:14:18 +04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-05-18 15:09:40 +04:00
|
|
|
- public
|
|
|
|
|
|
|
|
pages:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .website
|
2020-05-18 15:09:40 +04:00
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_REF_NAME == "dev" && $CI_PROJECT_PATH == "ligolang/ligo"'
|
|
|
|
when: always
|
|
|
|
|
|
|
|
pages-attempt:
|
2020-05-20 16:33:44 +04:00
|
|
|
extends: .website
|
2020-05-18 15:09:40 +04:00
|
|
|
only:
|
|
|
|
- merge_requests
|
|
|
|
- /^.*-run-dev$/
|