Skip to content

Commit 94efda5

Browse files
committed
Merge branch 'main' into ti/template-build-avg-time
2 parents 96b358f + 9c0cc65 commit 94efda5

File tree

860 files changed

+37211
-18786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

860 files changed

+37211
-18786
lines changed

.devcontainer/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM ubuntu
2+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3+
4+
ENV EDITOR=vim
5+
6+
RUN apt-get update && apt-get upgrade
7+
8+
RUN apt-get install --yes \
9+
ca-certificates \
10+
bash-completion \
11+
build-essential \
12+
curl \
13+
cmake \
14+
direnv \
15+
emacs-nox \
16+
gnupg \
17+
htop \
18+
jq \
19+
less \
20+
lsb-release \
21+
lsof \
22+
man-db \
23+
nano \
24+
neovim \
25+
ssl-cert \
26+
sudo \
27+
unzip \
28+
xz-utils \
29+
zip
30+
31+
# configure locales to UTF8
32+
RUN apt-get install locales && locale-gen en_US.UTF-8
33+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
34+
35+
# configure direnv
36+
RUN direnv hook bash >> $HOME/.bashrc
37+
38+
# install nix
39+
RUN sh <(curl -L https://nixos.org/nix/install) --daemon
40+
41+
RUN mkdir -p $HOME/.config/nix $HOME/.config/nixpkgs \
42+
&& echo 'sandbox = false' >> $HOME/.config/nix/nix.conf \
43+
&& echo '{ allowUnfree = true; }' >> $HOME/.config/nixpkgs/config.nix \
44+
&& echo '. $HOME/.nix-profile/etc/profile.d/nix.sh' >> $HOME/.bashrc
45+
46+
47+
# install docker and configure daemon to use vfs as GitHub codespaces requires vfs
48+
# https://github.com/moby/moby/issues/13742#issuecomment-725197223
49+
RUN mkdir -p /etc/apt/keyrings \
50+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
51+
&& echo \
52+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
53+
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \
54+
&& apt-get update \
55+
&& apt-get install --yes docker-ce docker-ce-cli containerd.io docker-compose-plugin \
56+
&& mkdir -p /etc/docker \
57+
&& echo '{"cgroup-parent":"/actions_job","storage-driver":"vfs"}' >> /etc/docker/daemon.json
58+
59+
# install golang and language tooling
60+
ENV GO_VERSION=1.19
61+
ENV GOPATH=$HOME/go-packages
62+
ENV GOROOT=$HOME/go
63+
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
64+
RUN curl -fsSL https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz | tar xzs
65+
RUN echo 'export PATH=$GOPATH/bin:$PATH' >> $HOME/.bashrc
66+
67+
RUN bash -c ". $HOME/.bashrc \
68+
go install -v golang.org/x/tools/gopls@latest \
69+
&& go install -v mvdan.cc/sh/v3/cmd/shfmt@latest \
70+
"
71+
72+
# install nodejs
73+
RUN bash -c "$(curl -fsSL https://deb.nodesource.com/setup_14.x)" \
74+
&& apt-get install -y nodejs
75+
76+
# install zstd
77+
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/horta/zstd.install/main/install)"
78+
79+
# install nfpm
80+
RUN echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list \
81+
&& apt update \
82+
&& apt install nfpm
83+

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// For format details, see https://aka.ms/devcontainer.json
2+
{
3+
"name": "Development environments on your infrastructure",
4+
5+
// Sets the run context to one level up instead of the .devcontainer folder.
6+
"context": ".",
7+
8+
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9+
"dockerFile": "Dockerfile",
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
"postStartCommand": "dockerd",
15+
16+
// privileged is required by GitHub codespaces - https://github.com/microsoft/vscode-dev-containers/issues/727
17+
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--privileged", "--init" ]
18+
}

.github/workflows/cla.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
8+
jobs:
9+
CLAssistant:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "CLA Assistant"
13+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14+
uses: contributor-assistant/github-action@v2.2.1
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
# the below token should have repo scope and must be manually added by you in the repository's secret
18+
PERSONAL_ACCESS_TOKEN : ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
19+
with:
20+
remote-organization-name: 'coder'
21+
remote-repository-name: 'cla'
22+
path-to-signatures: 'v2022-09-04/signatures.json'
23+
path-to-document: 'https://github.com/coder/cla/blob/main/README.md'
24+
# branch should not be protected
25+
branch: 'main'
26+
allowlist: dependabot*

.github/workflows/coder.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "*"
97

108
pull_request:
119

@@ -36,7 +34,7 @@ jobs:
3634
- name: Checkout
3735
uses: actions/checkout@v2
3836
- name: typos-action
39-
uses: crate-ci/typos@master
37+
uses: crate-ci/typos@v1.12.8
4038
with:
4139
config: .github/workflows/typos.toml
4240
- name: Fix Helper
@@ -489,6 +487,7 @@ jobs:
489487
go mod download
490488
491489
version="$(./scripts/version.sh)"
490+
make gen/mark-fresh
492491
make -j \
493492
build/coder_"$version"_windows_amd64.zip \
494493
build/coder_"$version"_linux_amd64.{tar.gz,deb}
@@ -629,7 +628,7 @@ jobs:
629628
with:
630629
name: failed-test-videos
631630
path: ./site/test-results/**/*.webm
632-
retention:days: 7
631+
retention-days: 7
633632

634633
chromatic:
635634
# REMARK: this is only used to build storybook and deploy it to Chromatic.

.github/workflows/dependabot.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Dependabot is annoying, but this makes it a bit less so.
2+
name: Auto Approve Dependabot
3+
4+
on: pull_request_target
5+
6+
jobs:
7+
auto-approve:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: hmarr/auto-approve-action@v2
13+
if: github.actor == 'dependabot[bot]'

.github/workflows/dogfood.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "*"
97
paths:
108
- "dogfood/**"
119
pull_request:
@@ -14,12 +12,12 @@ on:
1412
workflow_dispatch:
1513

1614
jobs:
17-
deploy:
15+
deploy_image:
1816
runs-on: ubuntu-latest
1917
steps:
2018
- name: Get branch name
2119
id: branch-name
22-
uses: tj-actions/branch-names@v5.4
20+
uses: tj-actions/branch-names@v6.1
2321

2422
- name: "Branch name to Docker tag name"
2523
id: docker-tag-name
@@ -49,3 +47,27 @@ jobs:
4947
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
5048
cache-from: type=registry,ref=codercom/oss-dogfood:latest
5149
cache-to: type=inline
50+
deploy_template:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
- name: Get short commit SHA
56+
id: vars
57+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
58+
- name: "Install latest Coder"
59+
run: |
60+
curl -L https://coder.com/install.sh | sh
61+
# env:
62+
# VERSION: 0.x
63+
- name: "Push template"
64+
run: |
65+
coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
66+
env:
67+
# Consumed by Coder CLI
68+
CODER_URL: https://dev.coder.com
69+
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
70+
# Template source & details
71+
CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
72+
CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
73+
CODER_TEMPLATE_DIR: ./dogfood

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
# v5.1.0 has a weird bug that makes stalebot add then remove its own label
1515
# https://github.com/actions/stale/pull/775
16-
- uses: actions/stale@v5.0.0
16+
- uses: actions/stale@v6.0.0
1717
with:
1818
stale-issue-label: stale
1919
stale-pr-label: stale

.github/workflows/welcome.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
jobs:
66
test:
77
runs-on: ubuntu-latest
8+
permissions:
9+
pull-requests: write
810
steps:
911
- uses: wow-actions/welcome@v1
1012
with:

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ vendor
1515
yarn-error.log
1616
gotests.coverage
1717
.idea
18+
.gitpod.yml
1819
.DS_Store
1920

2021
# Front-end ignore
@@ -30,8 +31,8 @@ site/**/*.typegen.ts
3031
site/build-storybook.log
3132

3233
# Build
33-
build/
34-
dist/
34+
/build/
35+
/dist/
3536
site/out/
3637

3738
*.tfstate

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"circbuf",
99
"cliflag",
1010
"cliui",
11+
"codecov",
1112
"coderd",
13+
"coderdenttest",
1214
"coderdtest",
1315
"codersdk",
1416
"cronstrue",
@@ -22,6 +24,7 @@
2224
"drpcmux",
2325
"drpcserver",
2426
"Dsts",
27+
"enablements",
2528
"fatih",
2629
"Formik",
2730
"gitsshkey",
@@ -31,6 +34,7 @@
3134
"gonet",
3235
"gossh",
3336
"gsyslog",
37+
"GTTY",
3438
"hashicorp",
3539
"hclsyntax",
3640
"httpapi",
@@ -67,6 +71,7 @@
6771
"ntqry",
6872
"OIDC",
6973
"oneof",
74+
"opty",
7075
"paralleltest",
7176
"parameterscopeid",
7277
"pqtype",
@@ -76,7 +81,9 @@
7681
"provisionerd",
7782
"provisionersdk",
7883
"ptty",
84+
"ptys",
7985
"ptytest",
86+
"quickstart",
8087
"reconfig",
8188
"retrier",
8289
"rpty",
@@ -87,6 +94,7 @@
8794
"sourcemapped",
8895
"Srcs",
8996
"stretchr",
97+
"STTY",
9098
"stuntest",
9199
"tailbroker",
92100
"tailcfg",
@@ -105,17 +113,20 @@
105113
"tfjson",
106114
"tfplan",
107115
"tfstate",
116+
"tios",
108117
"tparallel",
109118
"trimprefix",
110119
"tsdial",
111120
"tslogger",
112121
"tstun",
113122
"turnconn",
114123
"typegen",
124+
"typesafe",
115125
"unconvert",
116126
"Untar",
117127
"Userspace",
118128
"VMID",
129+
"walkthrough",
119130
"weblinks",
120131
"webrtc",
121132
"wgcfg",
@@ -135,6 +146,10 @@
135146
"xstate",
136147
"yamux"
137148
],
149+
"cSpell.ignorePaths": [
150+
"site/package.json",
151+
".vscode/settings.json"
152+
],
138153
"emeraldwalk.runonsave": {
139154
"commands": [
140155
{

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ COPY --chown=coder:coder --chmod=700 empty-dir /home/coder
2525

2626
USER coder:coder
2727
ENV HOME=/home/coder
28+
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt
2829
WORKDIR /home/coder
2930

3031
ENTRYPOINT [ "/opt/coder", "server" ]

0 commit comments

Comments
 (0)