From a3a6d4d701a50d419054e45b04c2737eaae54bc1 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 11 Feb 2021 15:12:03 -0600 Subject: [PATCH] Replace Docker script with pure --- ci/dev/image/run.sh | 30 ------------------------------ docs/CONTRIBUTING.md | 42 ++++++++++++++++++++---------------------- pure.yaml | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 52 deletions(-) delete mode 100755 ci/dev/image/run.sh create mode 100644 pure.yaml diff --git a/ci/dev/image/run.sh b/ci/dev/image/run.sh deleted file mode 100755 index d89e35d5..00000000 --- a/ci/dev/image/run.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -main() { - cd "$(dirname "$0")/../../.." - source ./ci/lib.sh - mkdir -p .home - - docker run \ - -it \ - --rm \ - -v "$PWD:/src" \ - -e HOME="/src/.home" \ - -e USER="coder" \ - -e GITHUB_TOKEN \ - -e MINIFY \ - -w /src \ - -p 127.0.0.1:8080:8080 \ - -u "$(id -u):$(id -g)" \ - -e CI \ - "$(docker_build ./ci/images/"${IMAGE-debian10}")" \ - "$@" -} - -docker_build() { - docker build "$@" >&2 - docker build -q "$@" -} - -main "$@" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 4c987ed8..026315af 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -50,8 +50,8 @@ yarn watch To develop inside an isolated Docker container: ```shell -./ci/dev/image/run.sh yarn -./ci/dev/image/run.sh yarn watch +pure yarn +pure yarn watch ``` `yarn watch` will live reload changes to the source. @@ -63,7 +63,6 @@ If you need to update VS Code, you can update the subtree with one line. Here's ```shell # Add vscode as a new remote if you haven't already and fetch git remote add -f vscode https://github.com/microsoft/vscode.git - git subtree pull --prefix lib/vscode vscode release/1.52 --squash --message "Update VS Code to 1.52" ``` @@ -72,41 +71,40 @@ git subtree pull --prefix lib/vscode vscode release/1.52 --squash --message "Upd You can build using: ```shell -./ci/dev/image/run.sh ./ci/steps/release.sh +pure release ``` -Run your build with: +This builds the release into the `release` directory. You can run this built +release directly with: ```shell -cd release -yarn --production -# Runs the built JavaScript with Node. -node . +node ./release ``` -Build the release packages (make sure that you run `./ci/steps/release.sh` first): +Build the release packages (make sure that you run `pure release` first): ```shell -IMAGE=centos7 ./ci/dev/image/run.sh ./ci/steps/release-packages.sh -# The standalone release is in ./release-standalone -# .deb, .rpm and the standalone archive are in ./release-packages +pure package ``` -The `release.sh` script is equal to running: +The standalone release will be in `./release-standalone` The `.deb`, `.rpm` and +the standalone archive will be in `./release-packages`. + +Running `pure release` is equal to running: ```shell -yarn -yarn build -yarn build:vscode -yarn release +pure yarn --frozen-lockfile +pure yarn build +pure yarn build:vscode +pure yarn release ``` -And `release-packages.sh` is equal to: +And `pure package` is equal to: ```shell -yarn release:standalone -yarn test:standalone-release -yarn package +pure yarn release:standalone +pure yarn test:standalone-release +pure yarn package ``` ## Structure diff --git a/pure.yaml b/pure.yaml new file mode 100644 index 00000000..4066f7e1 --- /dev/null +++ b/pure.yaml @@ -0,0 +1,20 @@ +commands: + yarn: + image: ./ci/images/centos7/Dockerfile + usage: Install dependencies + run: yarn + env: + - YARN_CACHE=/yarn-cache # YARN_CACHE: /yarn-cache + ports: + - 8080 + caches: + - key: yarn-cache + path: /yarn-cache + release: + image: ./ci/images/centos7/Dockerfile + usage: Build a release + run: ./ci/steps/release.sh + package: + image: ./ci/images/centos7/Dockerfile + usage: Package a release + run: ./ci/steps/release-packages.sh