Skip to content

Pass quality to code build process #9819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/code-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
export LEEWAY_WORKSPACE_ROOT=$(pwd)
headCommit=$(curl -H 'Accept: application/vnd.github.VERSION.sha' https://api.github.com/repos/gitpod-io/openvscode-server/commits/gp-code/main)
cd components/ide/code
leeway build -Dversion=nightly -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DcodeCommit=$headCommit .:docker
leeway build -Dversion=nightly -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DcodeCommit=$headCommit -DcodeQuality=insider .:docker
- name: Slack Notification
if: always()
uses: rtCamp/action-slack-notify@v2
Expand Down
3 changes: 2 additions & 1 deletion WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ defaultArgs:
jbMarketplacePublishTrigger: "false"
publishToJBMarketplace: true
localAppVersion: unknown
codeCommit: 30d694d1f41945af7f8d757d3ddf176b283752cb
codeCommit: 85a18060d91c11ff6de8ba44e02c6c31a5cd907c
codeQuality: stable
jetbrainsBackendQualifier: stable
intellijDownloadUrl: "https://download.jetbrains.com/idea/ideaIU-2022.1.1.tar.gz"
golandDownloadUrl: "https://download.jetbrains.com/go/goland-2022.1.tar.gz"
Expand Down
2 changes: 2 additions & 0 deletions components/ide/code/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ packages:
argdeps:
- imageRepoBase
- codeCommit
- codeQuality
config:
dockerfile: leeway.Dockerfile
metadata:
helm-component: workspace.codeImage
buildArgs:
CODE_COMMIT: ${codeCommit}
CODE_QUALITY: ${codeQuality}
image:
- ${imageRepoBase}/ide/code:${version}
- ${imageRepoBase}/ide/code:commit-${__git_commit}
20 changes: 20 additions & 0 deletions components/ide/code/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN yarn --cwd remote --frozen-lockfile --network-timeout 180000
FROM gitpod/openvscode-server-linux-build-agent:bionic-x64 as code_builder

ARG CODE_COMMIT
ARG CODE_QUALITY

ARG NODE_VERSION=16.15.0
ARG NVM_DIR="/root/.nvm"
Expand All @@ -45,6 +46,25 @@ RUN yarn --frozen-lockfile --network-timeout 180000
RUN rm -rf remote/node_modules/
COPY --from=dependencies_builder /gp-code/remote/node_modules/ /gp-code/remote/node_modules/

RUN nameShort=$(jq --raw-output '.nameShort' product.json) && \
nameLong=$(jq --raw-output '.nameLong' product.json) && \
echo $CODE_QUALITY && \
if [ "$CODE_QUALITY" = "insider" ]; then \
nameShort="$nameShort - Insiders" \
nameLong="$nameLong - Insiders" \
; fi && \
setQuality='setpath(["quality"]; $codeQuality)' && \
setNameShort='setpath(["nameShort"]; $nameShort)' && \
setNameLong='setpath(["nameLong"]; $nameLong)' && \
jqCommands="${setQuality} | ${setNameShort} | ${setNameLong}" && \
cat product.json | jq \
--arg codeQuality "$CODE_QUALITY" \
--arg nameShort "$nameShort" \
--arg nameLong "$nameLong" \
"${jqCommands}" > product.json.tmp && \
mv product.json.tmp product.json && \
cat product.json

RUN yarn --cwd extensions compile \
&& yarn gulp vscode-web-min \
&& yarn gulp vscode-reh-linux-x64-min
Expand Down