-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathdevfile.yaml
More file actions
159 lines (149 loc) · 5.37 KB
/
devfile.yaml
File metadata and controls
159 lines (149 loc) · 5.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Copyright (c) 2022-2024 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
schemaVersion: 2.2.2
metadata:
name: che-code
components:
- name: dev
container:
image: quay.io/che-incubator/che-code-dev:insiders
memoryLimit: 12Gi
memoryRequest: 512Mi
cpuRequest: 500m
cpuLimit: 3500m
endpoints:
- exposure: public
name: dev
secure: true
protocol: http
targetPort: 8000
env:
- name: KUBEDOCK_ENABLED
value: "true"
- name: projects
volume:
size: 10Gi
commands:
- id: npm-install
exec:
label: Install node dependencies
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
npm install
group:
kind: build
- id: npm-build
exec:
label: Compile with npm
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
npm run watch
group:
kind: build
isDefault: true
- id: npm-run
exec:
label: Run VS Code server on port 8000
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
npm run server
group:
kind: run
isDefault: true
- id: podman-compile-libc
exec:
label: Compile che-code in a ubi8-based container using Podman
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
echo "Compile libc-ubi8 mod"
cp -f build/dockerfiles/linux-libc-ubi8.Dockerfile build/dockerfiles/linux-libc-ubi8.no-test.Dockerfile
REMOVE_FROM="### Beginning of tests"
REMOVE_TO="### Ending of tests"
sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/d" build/dockerfiles/linux-libc-ubi8.no-test.Dockerfile
podman build -f build/dockerfiles/linux-libc-ubi8.no-test.Dockerfile -t linux-libc-ubi8-amd64 .
group:
kind: run
- id: podman-assemble-che-code
exec:
label: Build che-code image using Podman
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
echo "Build che-code image"
cp -f build/dockerfiles/assembly.Dockerfile build/dockerfiles/assembly.libc.Dockerfile
REPLACE="FROM linux-libc-ubi9-amd64 as linux-libc-ubi9-content"
sed -i -r -e "s|${REPLACE}||" build/dockerfiles/assembly.libc.Dockerfile
REPLACE="COPY --from=linux-libc-ubi9-content --chown=0:0 /checode-linux-libc/ubi9 /mnt/rootfs/checode-linux-libc/ubi9"
sed -i -r -e "s|${REPLACE}||" build/dockerfiles/assembly.libc.Dockerfile
REPLACE="FROM linux-musl-amd64 as linux-musl-content"
sed -i -r -e "s|${REPLACE}||" build/dockerfiles/assembly.libc.Dockerfile
REPLACE="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl"
sed -i -r -e "s|${REPLACE}||" build/dockerfiles/assembly.libc.Dockerfile
podman build -f build/dockerfiles/assembly.libc.Dockerfile -t che-code .
group:
kind: run
- id: install-git-subtree
exec:
label: Install git-subtree
component: dev
workingDir: ${PROJECTS_ROOT}
commandLine: |
mkdir temp && cd temp
git clone https://github.com/git/git.git
cd git/contrib/subtree
make && make prefix=${PROJECTS_ROOT}/temp install
cp -r ${PROJECTS_ROOT}/temp/libexec/git-core/ ~/bin
rm -rf ${PROJECTS_ROOT}/temp
- id: add-remote-upstream
exec:
label: Add remote for upstream
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
git remote add upstream-code https://github.com/microsoft/vscode
- id: fetch-upstream-changes
exec:
label: Fetch upstream changes
component: dev
workingDir: ${PROJECTS_ROOT}/che-code
commandLine: |
git stash save --include-untracked
git fetch upstream-code main
./rebase.sh
- id: install-claude
exec:
label: Install Claude CLI
component: dev
env:
- name: DISABLE_AUTOUPDATER
value: "1"
commandLine: |
set -euo pipefail
# Bump version: https://github.com/anthropics/claude-code/releases
CLAUDE_VERSION="2.1.92"
GCS_BASE="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"
PLATFORM="linux-x64"
INSTALL_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR"
echo "Installing Claude Code v${CLAUDE_VERSION} for ${PLATFORM}..."
MANIFEST=$(curl -fsSL "${GCS_BASE}/${CLAUDE_VERSION}/manifest.json")
EXPECTED_SHA=$(echo "$MANIFEST" | python3 -c "import json,sys; print(json.load(sys.stdin)['platforms']['${PLATFORM}']['checksum'])")
curl -fSL --progress-bar -o "${INSTALL_DIR}/claude" "${GCS_BASE}/${CLAUDE_VERSION}/${PLATFORM}/claude"
ACTUAL_SHA=$(sha256sum "${INSTALL_DIR}/claude" | cut -d' ' -f1)
if [ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]; then
echo "SHA-256 mismatch! expected=${EXPECTED_SHA} actual=${ACTUAL_SHA}" >&2
rm -f "${INSTALL_DIR}/claude"
exit 1
fi
chmod +x "${INSTALL_DIR}/claude"
echo "Verified and installed Claude Code v${CLAUDE_VERSION} to ${INSTALL_DIR}/claude"