Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

allow to provide yarn root options on build.sh + new job in github action #725

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ name: CI
on: [push, pull_request]

jobs:
build:
node-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout che-theia source code
- uses: actions/setup-node@v1
name: Configuring nodejs 10.x version
with:
node-version: '10.x'
- name: build
run: yarn
docker-build:
strategy:
matrix:
dist: [ 'alpine', 'ubi8' ]
Expand All @@ -30,4 +41,4 @@ jobs:
- name: build
run: |
docker image prune -a -f
./build.sh --build-args:THEIA_VERSION=master --tag:next --branch:master --git-ref:refs\\/heads\\/master --dockerfile:Dockerfile.${{matrix.dist}}
./build.sh --root-yarn-opts:--ignore-scripts --build-args:THEIA_VERSION=master --tag:next --branch:master --git-ref:refs\\/heads\\/master --dockerfile:Dockerfile.${{matrix.dist}}
12 changes: 12 additions & 0 deletions build.include
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ THEIA_BRANCH="master"
THEIA_GIT_REFS="refs\\/heads\\/master"
THEIA_DOCKER_IMAGE_VERSION=

prepare_yarn_root_args() {
IFS=',' read -r -a YARN_ARGS_ARRAY <<< "$@"
for i in ${YARN_ARGS_ARRAY[@]+"${YARN_ARGS_ARRAY[@]}"}; do
YARN_OPTS+="$i "
done
}

parse() {
PUBLISH_IMAGES=false
YARN_OPTS=""
FILTERED_ARGS=""
while [ $# -gt 0 ]; do
case $1 in
Expand All @@ -27,6 +35,10 @@ parse() {
--push)
PUBLISH_IMAGES=true
shift ;;
--root-yarn-opts*:*)
ROOT_YARN_CSV="${1#*:}"
prepare_yarn_root_args $ROOT_YARN_CSV
shift ;;
*)
FILTERED_ARGS="${FILTERED_ARGS} $1"
shift;;
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -e
set -o pipefail

parse "$@"
yarn
yarn ${YARN_OPTS}

buildImages

Expand Down