Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM gitpod/workspace-full:latest

USER gitpod

# Install .NET SDK
ADD global.json ./
RUN mkdir -p /home/gitpod/dotnet \
&& curl -fsSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile global.json --install-dir /home/gitpod/dotnet \
&& rm global.json
ENV DOTNET_ROOT=/home/gitpod/dotnet
ENV PATH=$PATH:/home/gitpod/dotnet

# Install Consul Server
ADD Directory.Build.props ./
RUN CONSUL_VERSION=$(cat Directory.Build.props|grep -oP '(?<VersionPrefix>)\d{1,3}\.\d{1,3}\.\d{1,3}') \
&& CONSUL_ARCH=$(dpkg --print-architecture) \
&& rm Directory.Build.props \
&& echo "Installing Consul ${CONSUL_VERSION}_${CONSUL_ARCH} ..." \
&& cd /usr/local/bin \
&& sudo wget "https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_${CONSUL_ARCH}.zip" \
&& sudo unzip -o "consul_${CONSUL_VERSION}_linux_${CONSUL_ARCH}.zip" \
&& sudo rm "consul_${CONSUL_VERSION}_linux_${CONSUL_ARCH}.zip" \
&& cd \
&& consul --version

# Install Mono JIT compiler
RUN sudo apt install -y gnupg ca-certificates \
&& sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list \
&& sudo apt update \
&& sudo apt install -y mono-complete \
&& mono --version
53 changes: 53 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
image:
file: .gitpod.Dockerfile

# Adding vscode C# extension
vscode:
extensions:
- muhammad-sammy.csharp

# Ports to expose
ports:
- name: Consul Dev Server UI
port: 8500
onOpen: open-preview

# Start-up tasks
tasks:
- name: Consul.NET Client # this task is optional (used as workaround for OmniSharp/omnisharp-vscode/issues/4783)
before: |
dotnet --version
init: |
dotnet build
cd Consul.Test/ && pwd
dotnet build
cd ..
command: |
cd Consul.Test/ && pwd
dotnet run --framework "net6.0"
cd ..
- name: Consul Server
before: |
consul --version
command: |
cd Consul.Test/
consul agent -dev -config-file test_config.json
openMode: split-right

# Configuring pre-builds
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: false
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: false