Skip to content

Commit 0a2d6db

Browse files
mads-hartmannroboquat
authored andcommitted
Add more detailed slices
Also include a slice with the NODENAME and pretty print config json
1 parent ceb75eb commit 0a2d6db

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

.werft/build.yaml

+22-9
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,32 @@ pod:
228228
sleep 1
229229
set -Eeuo pipefail
230230
231-
sudo chown gitpod:gitpod $GOCACHE
232231
export GITHUB_TOKEN=$(echo $GITHUB_TOKEN | xargs)
233-
234232
export DOCKER_HOST=tcp://$NODENAME:2375
235-
sudo chown -R gitpod:gitpod /workspace
236233
237-
mkdir /workspace/.ssh
238-
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa /workspace/.ssh/id_rsa_harvester_vm
239-
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa.pub /workspace/.ssh/id_rsa_harvester_vm.pub
240-
sudo chmod 600 /workspace/.ssh/id_rsa_harvester_vm
241-
sudo chmod 644 /workspace/.ssh/id_rsa_harvester_vm.pub
234+
echo "Job is running on node $NODENAME" | werft log slice "Node information"
235+
236+
( \
237+
sudo chown gitpod:gitpod $GOCACHE && \
238+
sudo chown -R gitpod:gitpod /workspace && \
239+
echo "done" \
240+
) | werft log slice "chowning /workspace and $GOCACHE"
241+
242+
( \
243+
mkdir -p /workspace/.ssh && \
244+
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa /workspace/.ssh/id_rsa_harvester_vm && \
245+
cp /mnt/secrets/harvester-vm-ssh-keys/id_rsa.pub /workspace/.ssh/id_rsa_harvester_vm.pub && \
246+
sudo chmod 600 /workspace/.ssh/id_rsa_harvester_vm && \
247+
sudo chmod 644 /workspace/.ssh/id_rsa_harvester_vm.pub && \
248+
echo "done" \
249+
) | werft log slice "Prepare SSH keys"
250+
251+
( \
252+
cd .werft && \
253+
yarn install && \
254+
mv node_modules .. \
255+
) | werft log slice "Installing dependencies"
242256
243-
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
244257
printf '{{ toJson . }}' > context.json
245258
246259
npx ts-node .werft/build.ts

.werft/jobs/build/job-config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export function jobConfig(werft: Werft, context: any): JobConfig {
150150
withLargeVM,
151151
};
152152

153-
werft.log("job config", JSON.stringify(jobConfig));
153+
werft.logOutput(sliceId, JSON.stringify(jobConfig, null, 2));
154+
werft.log(sliceId, "Expand to see the parsed configuration")
154155
const globalAttributes = Object.fromEntries(
155156
Object.entries(jobConfig).map((kv) => {
156157
const [key, value] = kv;

0 commit comments

Comments
 (0)