From f7de7e30399409c03ba820c9c7a33c95c38e3efa Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 20 Jun 2019 16:14:57 -0700 Subject: build deployable artifacts --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dc25d1a..d8724581 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ unified_test: variables: LC_ALL: "C.UTF-8" LANG: "C.UTF-8" + PIPENV_VENV_IN_PROJECT: "true" POSTGRES_DB: "fatcat_test" POSTGRES_USER: "fatcat_user" POSTGRES_PASSWORD: "fatcat_pw" @@ -36,8 +37,8 @@ unified_test: - pipenv run pylint -E fatcat*.py fatcat_tools fatcat_web tests/*.py rust_build_release: - only: - - tags # doesn't build for most commits; only tagged + stage: build + when: manual image: "rust:1.32-stretch" variables: LC_ALL: "C.UTF-8" @@ -48,15 +49,30 @@ rust_build_release: script: - rustc --version && cargo --version - cd rust - - cargo build --release - - cargo doc + - ./build_tarball.sh artifacts: paths: - - rust/target/release/fatcat* - - rust/target/doc/fatcat* - - rust/target/doc/*.css - - rust/target/doc/*.js - - rust/target/doc/*.woff - - rust/target/doc/*.svg + - rust/fatcat-rust.tar.gz expire_in: 1 year +python_build_release: + stage: build + when: manual + image: "rust:1.32-stretch" + variables: + LC_ALL: "C.UTF-8" + LANG: "C.UTF-8" + PIPENV_VENV_IN_PROJECT: "true" + before_script: + - apt update -qy + - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev + - pip3 install pipenv + script: + - python3 --version + - pipenv --version + - cd python + - ./build_tarball.sh + artifacts: + paths: + - python/fatcat-python.tar.gz + expire_in: 1 year -- cgit v1.2.3 From 0ecc8dd0c31412204fb1ac97e49504aa3ee77caa Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 20 Jun 2019 17:05:37 -0700 Subject: try caching/globals in gitlab-ci --- .gitlab-ci.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8724581..f64e864c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,21 @@ +cache: + key: "${CI_COMMIT_REF_SLUG}" + paths: + - python/.venv/ + - rust/target/ + - rust/.cargo_cache/ + +variables: + LC_ALL: "C.UTF-8" + LANG: "C.UTF-8" + PIPENV_VENV_IN_PROJECT: "true" + CARGO_HOME: ".cargo_cache" + +image: "rust:1.32-stretch" + unified_test: - image: "rust:1.32-stretch" variables: - LC_ALL: "C.UTF-8" - LANG: "C.UTF-8" - PIPENV_VENV_IN_PROJECT: "true" POSTGRES_DB: "fatcat_test" POSTGRES_USER: "fatcat_user" POSTGRES_PASSWORD: "fatcat_pw" @@ -13,9 +24,9 @@ unified_test: services: - "postgres:11" before_script: - - cargo install diesel_cli --version 1.3.1 - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev + - cargo install diesel_cli --version 1.3.1 - pip3 install pipenv - pipenv --version script: @@ -39,10 +50,6 @@ unified_test: rust_build_release: stage: build when: manual - image: "rust:1.32-stretch" - variables: - LC_ALL: "C.UTF-8" - LANG: "C.UTF-8" before_script: - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev @@ -58,11 +65,6 @@ rust_build_release: python_build_release: stage: build when: manual - image: "rust:1.32-stretch" - variables: - LC_ALL: "C.UTF-8" - LANG: "C.UTF-8" - PIPENV_VENV_IN_PROJECT: "true" before_script: - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev -- cgit v1.2.3 From 0c17cc94a7c2020aff2958a6dd942396fce58db1 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 20 Jun 2019 18:51:02 -0700 Subject: keep cargo home on the path --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f64e864c..36565bb4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ variables: LANG: "C.UTF-8" PIPENV_VENV_IN_PROJECT: "true" CARGO_HOME: ".cargo_cache" + PATH: "$PATH:$CARGO_HOME/bin" image: "rust:1.32-stretch" -- cgit v1.2.3 From 6066628a58b2446e124b3778642130599616d96d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 20 Jun 2019 18:54:03 -0700 Subject: try cargo path tweak again --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36565bb4..6a2be733 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,6 @@ variables: LANG: "C.UTF-8" PIPENV_VENV_IN_PROJECT: "true" CARGO_HOME: ".cargo_cache" - PATH: "$PATH:$CARGO_HOME/bin" image: "rust:1.32-stretch" @@ -25,6 +24,7 @@ unified_test: services: - "postgres:11" before_script: + - export PATH="$PATH:$CARGO_HOME/bin" - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev - cargo install diesel_cli --version 1.3.1 @@ -52,6 +52,7 @@ rust_build_release: stage: build when: manual before_script: + - export PATH="$PATH:$CARGO_HOME/bin" - apt update -qy - apt install -y python3-dev python3-pip python3-wheel python3-requests python3-six python3-pytest libsnappy-dev libsodium-dev script: -- cgit v1.2.3