Skip to content

Commit fadac54

Browse files
committed
gitpod: add first draft version to version control for testing
Signed-off-by: Andrei Jiroh Eugenio Halili <[email protected]>
1 parent cff1ee6 commit fadac54

File tree

2 files changed

+291
-0
lines changed

2 files changed

+291
-0
lines changed

.gitpod.Dockerfile

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
# Most of the stuff here are copied from the main Dockerfile, which tweaked to be worked in Debian way,
2+
# which may need automation in the futur to keep things up-to-date.
3+
FROM cljkondo/clj-kondo:2021.06.18-alpine as clj-kondo
4+
FROM ghcr.io/assignuser/chktex-alpine:latest as chktex
5+
FROM yoheimuta/protolint:latest as protolint
6+
FROM ghcr.io/assignuser/lintr-lib:0.2.0 as lintr-lib
7+
FROM ghcr.io/terraform-linters/tflint:latest as tflint
8+
FROM checkmarx/kics:alpine as kics
9+
10+
# This image should be the last one to be used inside an workspace container. In this cause, we use an varation of
11+
# the official Gitpod workspace image as the final image.
12+
# Source Dockerfile: https://gitlab.com/gitpodify/gitpodified-workspace-images/-/blob/recaptime-dev-mainline/full/Dockerfile
13+
FROM quay.io/gitpodified-workspace-images/full:latest as devenv-gitpod
14+
15+
ARG PWSH_VERSION='latest'
16+
ARG ARM_TTK_NAME='master.zip'
17+
ARG ARM_TTK_URI='https://github.com/Azure/arm-ttk/archive/master.zip'
18+
ARG ARM_TTK_DIRECTORY='/opt/microsoft'
19+
ARG DART_VERSION='2.8.4'
20+
ARG PSSA_VERSION='latest'
21+
22+
RUN mkdir -p /home/gitpod/dotnet && curl -fsSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --install-dir /home/gitpod/dotnet
23+
ENV DOTNET_ROOT=/home/gitpod/dotnet
24+
ENV PATH=$PATH:/home/gitpod/dotnet
25+
26+
# Ignore npm package issues
27+
RUN yarn config set ignore-engines true
28+
29+
# Python
30+
RUN pip3 install --no-cache-dir --upgrade \
31+
'cpplint' \
32+
'cfn-lint' \
33+
'pylint' \
34+
'black' \
35+
'flake8' \
36+
'isort' \
37+
'bandit' \
38+
'mypy' \
39+
'restructuredtext_lint' \
40+
'rstcheck' \
41+
'sphinx<4.0' \
42+
'rstfmt' \
43+
'snakemake' \
44+
'snakefmt' \
45+
'sqlfluff' \
46+
'yamllint'
47+
48+
# npm - actually we're not in the root directory so we should be fine
49+
RUN npm install --no-cache --ignore-scripts --global \
50+
sfdx-cli \
51+
typescript \
52+
asl-validator \
53+
@coffeelint/cli \
54+
55+
56+
@secretlint/[email protected] \
57+
stylelint \
58+
stylelint-config-standard \
59+
stylelint-config-sass-guidelines \
60+
stylelint-scss \
61+
dockerfilelint \
62+
editorconfig-checker \
63+
gherkin-lint \
64+
graphql-schema-linter \
65+
npm-groovy-lint \
66+
htmlhint \
67+
eslint \
68+
eslint-config-airbnb \
69+
eslint-config-prettier \
70+
eslint-config-standard \
71+
eslint-plugin-import \
72+
eslint-plugin-jest \
73+
eslint-plugin-node \
74+
eslint-plugin-prettier \
75+
eslint-plugin-promise \
76+
eslint-plugin-vue \
77+
babel-eslint \
78+
@babel/core \
79+
@babel/eslint-parser \
80+
81+
prettier \
82+
jsonlint \
83+
eslint-plugin-jsonc \
84+
85+
eslint-plugin-react \
86+
eslint-plugin-jsx-a11y \
87+
markdownlint-cli \
88+
remark-cli \
89+
remark-preset-lint-recommended \
90+
markdown-link-check \
91+
markdown-table-formatter \
92+
@stoplight/[email protected] \
93+
cspell \
94+
sql-lint \
95+
tekton-lint \
96+
prettyjson \
97+
@typescript-eslint/eslint-plugin \
98+
@typescript-eslint/parser
99+
100+
# Install packages from Homebrew as much as possible
101+
RUN brew update; brew upgrade; \
102+
brew install actionlint terraform terrascan tflint
103+
104+
# Ruby
105+
RUN bash -lc "echo 'gem: --no-document' >> ~/.gemrc && \
106+
gem install \
107+
scss_lint \
108+
puppet-lint \
109+
rubocop:0.82.0 \
110+
rubocop-github:0.16.0 \
111+
rubocop-performance:1.7.1 \
112+
rubocop-rails:2.5 \
113+
rubocop-rspec:1.41.0"
114+
115+
RUN sudo install-packages linux-headers-gcp
116+
SHELL [ "/usr/bin/bash", "-o", "pipefail", "-lc" ]
117+
RUN wget --tries=5 -q -O /tmp/phive.phar https://phar.io/releases/phive.phar \
118+
&& wget --tries=5 -q -O /tmp/phive.phar.asc https://phar.io/releases/phive.phar.asc \
119+
&& PHAR_KEY_ID="0x9D8A98B29B2D5D79" \
120+
&& ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \
121+
|| gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$PHAR_KEY_ID" \
122+
|| gpg --keyserver pgp.mit.edu --recv-keys "$PHAR_KEY_ID" \
123+
|| gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys "$PHAR_KEY_ID" ) \
124+
&& gpg --verify /tmp/phive.phar.asc /tmp/phive.phar \
125+
&& chmod +x /tmp/phive.phar \
126+
&& sudo mv /tmp/phive.phar /usr/local/bin/phive \
127+
&& rm /tmp/phive.phar.asc
128+
# Powershell installation
129+
SHELL [ "/usr/bin/bash", "-o", "pipefail", "-lc" ]
130+
RUN curl --retry 5 --retry-delay 5 -s https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION} \
131+
| grep browser_download_url \
132+
| grep powershell_ \
133+
| cut -d '"' -f 4 \
134+
| xargs -n 1 wget -O /tmp/powershell-deb-amd64.deb \
135+
&& sudo dpkg -i /tmp/powershell-deb-amd64.deb \
136+
&& rm /tmp/powershell-deb-amd64.deb
137+
# SCALA installation
138+
RUN sudo curl -fLo /usr/local/bin/coursier https://git.io/coursier-cli && \
139+
sudo chmod +x /usr/local/bin/coursier
140+
# arm-ttk installation
141+
ENV ARM_TTK_PSD1="${ARM_TTK_DIRECTORY}/arm-ttk-master/arm-ttk/arm-ttk.psd1"
142+
RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
143+
&& sudo unzip "${ARM_TTK_NAME}" -d "${ARM_TTK_DIRECTORY}" \
144+
&& sudo rm "${ARM_TTK_NAME}" \
145+
&& sudo ln -sTf "${ARM_TTK_PSD1}" /usr/bin/arm-ttk \
146+
&& sudo chmod a+x /usr/bin/arm-ttk
147+
# bash-exec installation
148+
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' | sudo tee /usr/bin/bash-exec
149+
150+
# shfmt installation
151+
ENV GO111MODULE=on
152+
# Don't use go get, as per https://golang.org/doc/go-get-install-deprecation. Also I set GOPATH
153+
# due to fact that /workspace directory is mounted when an workspace container in Gitpod starts.
154+
RUN GOPATH=/home/gitpod/gopkgs go install mvdan.cc/sh/v3/cmd/[email protected] \
155+
&& echo "export PATH=\$PATH:/home/gitpod/gopkgs" | tee /home/gitpod/.bashrc.d/10-gopath-shfmt
156+
157+
# clj-kondo installation
158+
COPY --from=clj-kondo /bin/clj-kondo /usr/bin/
159+
160+
# dotnet-format installation
161+
RUN dotnet tool install -g dotnet-format
162+
163+
# dartanalyzer installation
164+
RUN wget --tries=5 https://storage.googleapis.com/dart-archive/channels/stable/release/${DART_VERSION}/sdk/dartsdk-linux-x64-release.zip -O - -q | unzip -q - \
165+
&& chmod +x dart-sdk/bin/dart* \
166+
&& mv dart-sdk/bin/* /usr/bin/ && mv dart-sdk/lib/* /usr/lib/ && mv dart-sdk/include/* /usr/include/ \
167+
&& rm -r dart-sdk/
168+
169+
# dotenv-linter installation
170+
RUN wget -q -O - https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh | sh -s
171+
172+
# golangci-lint installation
173+
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
174+
&& golangci-lint --version
175+
176+
177+
# revive installation
178+
RUN go get -u github.com/mgechev/revive
179+
180+
# checkstyle installation
181+
RUN CHECKSTYLE_LATEST=$(curl -s https://api.github.com/repos/checkstyle/checkstyle/releases/latest \
182+
| grep browser_download_url \
183+
| grep ".jar" \
184+
| cut -d '"' -f 4) \
185+
&& curl --retry 5 --retry-delay 5 -sSL $CHECKSTYLE_LATEST \
186+
--output /usr/bin/checkstyle
187+
188+
189+
# ktlint installation
190+
RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/download/0.40.0/ktlint && \
191+
chmod a+x ktlint && \
192+
mv "ktlint" /usr/bin/
193+
194+
195+
# kubeval installation
196+
RUN wget -q https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz \
197+
&& tar xf kubeval-linux-amd64.tar.gz \
198+
&& cp kubeval /usr/local/bin
199+
200+
201+
# chktex installation
202+
COPY --from=chktex /usr/bin/chktex /usr/bin/
203+
RUN cd ~ && touch .chktexrc
204+
205+
# luacheck installation
206+
RUN wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
207+
&& cd lua-5.3.5 \
208+
&& make linux \
209+
&& make install \
210+
&& cd .. && rm -r lua-5.3.5/ \
211+
&& wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \
212+
&& cd luarocks-3.3.1-super-linter \
213+
&& ./configure --with-lua-include=/usr/local/include \
214+
&& make \
215+
&& make -b install \
216+
&& cd .. && rm -r luarocks-3.3.1-super-linter/ \
217+
&& luarocks install luacheck
218+
219+
220+
# perlcritic installation
221+
RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
222+
223+
# phpcs installation
224+
RUN phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192
225+
226+
227+
# phpstan installation
228+
RUN phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720
229+
230+
231+
# psalm installation
232+
RUN phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5
233+
234+
235+
# phplint installation
236+
RUN composer global require overtrue/phplint ^3.0 \
237+
&& composer global config bin-dir --absolute
238+
239+
ENV PATH="/root/.composer/vendor/bin:$PATH"
240+
241+
# powershell installation
242+
RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force'
243+
244+
# protolint installation
245+
COPY --from=protolint /usr/local/bin/protolint /usr/bin/
246+
247+
# lintr installation
248+
COPY --from=lintr-lib /usr/lib/R/library/ /home/r-library
249+
RUN R -e "install.packages(list.dirs('/home/r-library',recursive = FALSE), repos = NULL, type = 'source')"
250+
251+
# raku installation
252+
RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/gpg.0DD4CA7EB1C6CC6B.key' | gpg --dearmor | sudo tee /usr/share/keyrings/rakudo-pkg-archive.gpg \
253+
&& echo "deb [signed-by=/usr/share/keyrings/rakudo-pkg-archive.gpg] https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/deb/ubuntu focal main" | sudo tee /etc/apt/sources.d/rakudo-pkg.list >>/dev/null \
254+
&& echo "deb-src [/usr/share/keyrings/rakudo-pkg-archive.gpg] https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/deb/ubuntu focal main"| sudo tee /etc/apt/sources.d/rakudo-pkg.list >> /dev/null \
255+
&& sudo install-packages rakudo-pkg
256+
257+
ENV PATH="~/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH"
258+
259+
# clippy installation
260+
RUN rustup component add clippy
261+
262+
# sfdx-scanner-ape, sfdx-scanner-lwc and sfdx-scanner-lwc installation
263+
RUN sfdx plugins:install @salesforce/sfdx-scanner \
264+
&& sfdx plugins:install @salesforce/sfdx-scanner \
265+
&& sfdx plugins:install @salesforce/sfdx-scanner
266+
267+
# scalafix installation
268+
RUN coursier install scalafix --quiet --install-dir /usr/bin
269+
270+
# misspell installation
271+
RUN curl -L -o /tmp/install-misspell.sh https://git.io/misspell \
272+
&& sh /tmp/install-misspell.sh; rm /tmp/install-misspell.sh
273+
274+
# tsqllint installation
275+
RUN dotnet tool install --global TSQLLint
276+
277+
# terrascan setup
278+
RUN terrascan init
279+
280+
# checkov installation
281+
RUN pip3 install --upgrade --no-cache-dir pip && pip3 install --upgrade --no-cache-dir setuptools \
282+
&& pip3 install --no-cache-dir checkov
283+
284+
# kics installation
285+
COPY --from=kics /app/bin/kics /usr/bin/
286+
RUN mkdir -p /opt/kics/assets
287+
ENV KICS_QUERIES_PATH=/opt/kics/assets/queries KICS_LIBRARIES_PATH=/opt/kics/assets/libraries
288+
COPY --from=kics /app/bin/assets /opt/kics/assets/

.gitpod.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ vscode:
1515
- esbenp.prettier-vscode
1616
- exiasr.hadolint
1717
- timonwong.shellcheck
18+
19+
image:
20+
file: .gitpod.Dockerfile

0 commit comments

Comments
 (0)