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 ++++++++++++++++++++++++++---------- python/.gitignore | 2 ++ python/build_tarball.sh | 8 ++++++++ rust/.gitignore | 2 ++ rust/build_tarball.sh | 10 ++++++++++ 5 files changed, 48 insertions(+), 10 deletions(-) create mode 100755 python/build_tarball.sh create mode 100755 rust/build_tarball.sh 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 diff --git a/python/.gitignore b/python/.gitignore index 48b921f1..e11492e6 100644 --- a/python/.gitignore +++ b/python/.gitignore @@ -5,6 +5,8 @@ build/ dist/ *.egg-info *.json.gz +fatcat-*.tar.gz + !example.env !.coveragerc !.pylintrc diff --git a/python/build_tarball.sh b/python/build_tarball.sh new file mode 100755 index 00000000..5c7f1944 --- /dev/null +++ b/python/build_tarball.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e -u -o pipefail + +PIPENV_VENV_IN_PROJECT=true pipenv install --dev --deploy + +rm -f fatcat-python.tar.gz +tar czf fatcat-python.tar.gz .venv *.py fatcat_tools fatcat_web Pipfile* *.ini README* diff --git a/rust/.gitignore b/rust/.gitignore index a2068a8a..03e50598 100644 --- a/rust/.gitignore +++ b/rust/.gitignore @@ -1,4 +1,6 @@ .env target/ +bin/ +fatcat-*.tar.gz !.cargo diff --git a/rust/build_tarball.sh b/rust/build_tarball.sh new file mode 100755 index 00000000..9eed2566 --- /dev/null +++ b/rust/build_tarball.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e -u -o pipefail + +cargo build --release +mkdir -p ./bin/ +cp target/release/{fatcatd,fatcat-auth,fatcat-export} bin + +rm -f fatcat-rust.tar.gz +tar czf fatcat-rust.tar.gz bin migrations README.md example.env -- cgit v1.2.3