Skip to content

Commit

Permalink
fix: refactor docker build command
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
  • Loading branch information
vitaliy-guliy committed Jul 28, 2023
1 parent cf45f1d commit e3594b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/smoke-test-pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ jobs:
steps:

- name: Checkout che-code source code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configuring nodejs 14.x version
uses: actions/setup-node@v3
with:
node-version: '16'
# - name: Configuring nodejs 14.x version
# uses: actions/setup-node@v3
# with:
# node-version: '16'

# - name: Install yq
# run: sudo pip install yq

- name: Install yq
run: sudo pip install yq
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Prepare Che-Code Dockerfile ( remove tests )
run: |
#
# truncate Dockerfile, remove section that runs tests
#
cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile
REMOVE_FROM="### Testing"
REMOVE_TO="# Store the content of the result"
REMOVE_FROM="### Beginning of tests"
REMOVE_TO="### Ending of tests"
sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile
#
Expand All @@ -59,9 +64,9 @@ jobs:
# build linux-libc-amd64:latest docker image
#
docker image prune -a -f
# docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 .
docker buildx build --memory-swap -1 --memory 10g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 .
docker buildx build --memory-swap -1 --memory 12g --platform linux/amd64 -f build/dockerfiles/linux-libc.no-test.Dockerfile --load -t linux-libc-amd64 .
- name: Build Che-Code Docker image
run: |
Expand Down
7 changes: 6 additions & 1 deletion build/dockerfiles/linux-libc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
RUN chmod a+x /checode/out/server-main.js \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode

### Testing
### Beginning of tests
# Do not change line above! It is used to cut this section to skip tests

# Compile tests
RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \
compile-extension:markdown-language-features \
Expand Down Expand Up @@ -120,6 +122,9 @@ RUN [[ $(uname -m) == "x86_64" ]] && NODE_ARCH=$(echo "console.log(process.arch)
VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"

# Do not change line below! It is used to cut this section to skip tests
### Ending of tests

# Store the content of the result
FROM scratch as linux-libc-content
COPY --from=linux-libc-builder /checode /checode-linux-libc

0 comments on commit e3594b5

Please sign in to comment.