Skip to content

Commit 56b3dd5

Browse files
authored
Install pre-commit hooks in prebuild (#19159)
* [dev/image] Install pre-commit hooks under /workspace during prebuilds * Separate task: Install pre-commit hooks * Update dev image with `env PRE_COMMIT_HOME`
1 parent 2f14d7a commit 56b3dd5

File tree

13 files changed

+24
-18
lines changed

13 files changed

+24
-18
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
1+
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
22

33
COPY entrypoint.sh /entrypoint.sh
44
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
1+
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
22

33
COPY entrypoint.sh /entrypoint.sh
44
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
1+
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
22

33
COPY entrypoint.sh /entrypoint.sh
44
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
1+
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
22

33
COPY entrypoint.sh /entrypoint.sh
44
ENTRYPOINT ["/entrypoint.sh"]

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
9999
runs-on: ${{ needs.create-runner.outputs.label }}
100100
container:
101-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
101+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
102102
outputs:
103103
previewctl_hash: ${{ steps.build.outputs.previewctl_hash }}
104104
steps:
@@ -161,7 +161,7 @@ jobs:
161161
ports:
162162
- 6379:6379
163163
container:
164-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
164+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
165165
env:
166166
DB_HOST: "mysql"
167167
DB_PORT: "23306"
@@ -401,7 +401,7 @@ jobs:
401401
- create-runner
402402
runs-on: ${{ needs.create-runner.outputs.label }}
403403
container:
404-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
404+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
405405
if: needs.configuration.outputs.with_integration_tests != ''
406406
concurrency:
407407
group: ${{ needs.configuration.outputs.preview_name }}-integration-test

.github/workflows/code-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ${{ needs.create-runner.outputs.label }}
1717
needs: [create-runner]
1818
container:
19-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
19+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
2020
steps:
2121
- uses: actions/checkout@v4
2222
- uses: ./.github/actions/setup-environment

.github/workflows/ide-integration-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ${{ needs.create-runner.outputs.label }}
3232
needs: [create-runner]
3333
container:
34-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
34+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
3535
outputs:
3636
name: ${{ steps.configuration.outputs.name }}
3737
version: ${{ steps.configuration.outputs.version }}
@@ -101,7 +101,7 @@ jobs:
101101
needs: [configuration, infrastructure, create-runner]
102102
runs-on: ${{ needs.create-runner.outputs.label }}
103103
container:
104-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
104+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
105105
volumes:
106106
- /var/tmp:/var/tmp
107107
- /tmp:/tmp

.github/workflows/lacework-inline-scanner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
needs: [configuration,create-runner]
5252
if: ${{ needs.configuration.outputs.skip == 'false' }}
5353
container:
54-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
54+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
5555
steps:
5656
# Most of this is taken over from the Build workflow/preview-env-check-regressions workflow
5757
- uses: actions/checkout@v4

.github/workflows/preview-env-check-regressions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
if: ${{ needs.configuration.outputs.skip == 'false' }}
8787
runs-on: ${{ needs.create-runner.outputs.label }}
8888
container:
89-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
89+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
9090
volumes:
9191
- /var/tmp:/var/tmp
9292
- /tmp:/tmp

.github/workflows/preview-env-gc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ${{ needs.create-runner.outputs.label }}
1616
needs: [create-runner]
1717
container:
18-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
18+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
1919
outputs:
2020
names: ${{ steps.set-matrix.outputs.names }}
2121
count: ${{ steps.set-matrix.outputs.count }}

.github/workflows/workspace-integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
runs-on: ${{ needs.create-runner.outputs.label }}
4646
needs: [create-runner]
4747
container:
48-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
48+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
4949
outputs:
5050
name: ${{ steps.configuration.outputs.name }}
5151
version: ${{ steps.configuration.outputs.version }}
@@ -136,7 +136,7 @@ jobs:
136136
needs: [configuration, infrastructure, create-runner]
137137
runs-on: ${{ needs.create-runner.outputs.label }}
138138
container:
139-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
139+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
140140
steps:
141141
- uses: actions/checkout@v4
142142
- id: auth
@@ -167,7 +167,7 @@ jobs:
167167
if: inputs.skip_delete != 'true' && always()
168168
runs-on: ${{ needs.create-runner.outputs.label }}
169169
container:
170-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
170+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
171171
steps:
172172
- uses: actions/checkout@v4
173173
- name: Delete preview environment

.gitpod.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:se-update-leeway-gha.20594
1+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:at-user-getauthenticated-dashboard-gha.20954
22
workspaceLocation: gitpod/gitpod-ws.code-workspace
33
checkoutLocation: gitpod
44
ports:
@@ -65,8 +65,11 @@ tasks:
6565
leeway exec --package components/ide/jetbrains/backend-plugin:plugin-latest --package components/ide/jetbrains/gateway-plugin:publish-latest --parallel -- ./gradlew buildPlugin
6666
- name: TypeScript
6767
init: yarn --network-timeout 100000 && yarn build
68+
- name: Install pre-commit hooks
69+
init: |
70+
pre-commit install --install-hooks
71+
exit 0
6872
- name: Go
69-
before: pre-commit install --install-hooks
7073
init: |
7174
./components/gitpod-protocol/go/scripts/generate-config.sh
7275
leeway exec --filter-type go -v -- go mod verify

dev/image/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,6 @@ RUN curl -fsSL https://github.com/csweichel/oci-tool/releases/download/v0.2.0/oc
267267
RUN go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
268268

269269
RUN sudo install-packages pigz
270+
271+
# Install pre-commit hooks under /workspace during prebuilds
272+
ENV PRE_COMMIT_HOME=/workspace/.pre-commit

0 commit comments

Comments
 (0)