diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 000000000..358b4e1a9 --- /dev/null +++ b/.gitpod.Dockerfile @@ -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 '(?)\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 diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..eaff20b92 --- /dev/null +++ b/.gitpod.yml @@ -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