Coder Social home page Coder Social logo

cake-contrib / cake.hosts Goto Github PK

View Code? Open in Web Editor NEW
6.0 8.0 1.0 63 KB

Cake.Hosts addon for Cake Build: manipulation of hosts file from Cake

Home Page: https://cakebuild.net/extensions/cake-hosts/

License: MIT License

C# 82.87% PowerShell 17.13%
cake cake-build cake-addin hosts trailmax augustoproiete hacktoberfest

cake.hosts's Introduction

Cake.Hosts

Cake.Hosts addon for Cake Build: manipulation of hosts file from Cake. This addon provides the following functionality:

  • Check if a record already exists in your hosts file
  • Add a new record to your hosts file
  • Remove a record from hosts file

Release Notes

This addon is aimed on automation and helping setting up of local development environment rather than for anything else. I can not see a need to change hosts file on any server in a production environment/build. However, please let me know if you do use it in production - I'm interested to hear your story.

You can add this addon added to your cake script via nuget:

#addin "Cake.Hosts"

Check if Record Exists

HostsRecordExists("127.0.0.1", "myproject.dev");

This does regex match through your hosts file and checks if there is a corresponding record.

Add New Record

AddHostsRecord("127.0.0.1", "myproject.dev");

This appends a new corresponding line to your hosts file.

Remove Recrod

RemoveHostsRecord("127.0.0.1", "myproject.dev");

Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.

Join in the discussion on the Cake repository

cake.hosts's People

Contributors

augustoproiete avatar trailmax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cake.hosts's Issues

Would it be possible to use the Cake Contrib Icon for your NuGet Package?

Thanks again for creating this Cake Addin, we really appreciate the effort that you have put in to creating it.

We, the Cake Team, recently announced a new Cake Contrib Icon, details of which can be found here:

http://cakebuild.net/blog/2017/06/new-cake-contrib-icon

Would you consider changing the nuspec file for your NuGet Package to use this new Cake Contrib Icon? If so, the recommended URL to use is:

https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png

Details of the above URL can be found in the repository here:

https://github.com/cake-contrib/graphics

Please let me know if you have any questions.

Make part of Cake site

Need to speak to cake-contrib team to make this repo appear in cake website and add cake-contrib to nuget contributor

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>.

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.

This issue was created by a tool: Cake.AddinDiscoverer version 3.12.1

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.27.1. Please upgrade to 0.28.0
  • Your addin should target netstandard2.0. Please note that there is no need to multi-target, netstandard2.0 is sufficient.
  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</PackageIconUrl>.

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.org and in the project on github.

Appveyor

Set up build on appveyor and push to myget automatically

Failed to install addin 'Cake.Hosts'

I get the following error when trying to install Cake.Hosts with #addin "Cake.Hosts" command

Error: Cake.Core.CakeException: Failed to install addin 'Cake.Hosts'.                                                                                                                   
   at Cake.Core.Scripting.ScriptProcessor.InstallAddins(IReadOnlyCollection`1 addins, DirectoryPath installPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptProcessor.cs:line 106
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 152         
   at Cake.Commands.BuildCommand.Execute(CakeOptions options) in C:\projects\cake\src\Cake\Commands\BuildCommand.cs:line 41                                                             
   at Cake.CakeApplication.Run(CakeOptions options) in C:\projects\cake\src\Cake\CakeApplication.cs:line 45                                                                             
   at Cake.Program.Main() in C:\projects\cake\src\Cake\Program.cs:line 73                                                                                                               

But the installation works with the previous version
#addin "nuget:?package=Cake.Hosts&version=1.2.1"

Tried with dontet cake global tool and with the classic build.ps1 script.
Cake version is 0.30

Update Cake.Hosts README: Add link to GitHub Discussions

We've started using GitHub Discussions as the preferred communication channel moving forward (instead of Gitter) because it makes it easier to keep track of discussions in a structured way, especially if multiple discussions are happening at the same time. It also allows to search for previous questions/answers, which can be a helpful resource.

As such, we're recommending addin maintainers to update any links to Gitter to point to the GH discussions.

image

Template:

## Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.

[![Join in the discussion on the Cake repository](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/cake-build/cake/discussions)

Log messages

Need to put a log message when adding/deleting records from hosts.

Update Cake.Hosts to target Cake v1.0.0

Cake v1.0.0 has been released earlier this year and includes breaking changes in the API. It's recommended to reference Cake.Core and/or Cake.Common v1.0.0 for compatibility with the latest Cake runners.

Today, users running modern versions of Cake receive a warning similar to the below:

The assembly 'Cake.Hosts, Version=1.5.1.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.33.0).

More info: https://cakebuild.net/blog/2021/02/cake-v1.0.0-released

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.