GithubHelp home page GithubHelp logo

init-service's Introduction

init-service

A python library to initialise a repository.

This library,

  • clones an existing repository
  • adds the Play project with up to date dependencies
  • commits and pushes the changes to Github

Run init-service --help for instructions.

Prerequisites

This library requires,

  • Python 3.9
  • the $WORKSPACE environment variable to be set - new repositories will be created in this directory
  • a github token with permissions to push to the repository that needs initialising

Additional development dependencies

  • poetry ( pip install poetry )

To install the dependencies run: make init

Or if you have nix installed, you can just run nix-shell

Installation

pip install -i https://artefacts.tax.service.gov.uk/artifactory/api/pypi/pips/simple init-service

Example usage

Create a frontend microservice like this: init-service my-frontend-microservice FRONTEND --github-token <token>

Create a backend microservice like this: init-service my-backend-microservice BACKEND --with-mongo --github-token <token>

Running the tests

In order to run the tests you will need pytest installed.

To run the tests run: make test

Manually testing a new repository

You can generate a repository for inspection with: init-service <repository-name> <type> --dry-run

The new repository will be created in $WORKSPACE/

You will then need to manually copy over the repository.yaml and LICENSE file (public repositories only) from another HMRC repository.

For example,

init-service test-frontend FRONTEND
cp ../contact-frontend/LICENSE ../test-frontend
cp ../contact-frontend/repository.yaml ../test-frontend
cd ../test-frontend
sbt run

Then navigate to http://localhost:9000/test-frontend

Adding a file specific to a backend or a frontend

If you need to add a file that should only exist in a frontend or backend, but not both, add the path to the file to templates/service/template/BACKEND.delete if frontend-specific or templates/service/template/FRONTEND.delete if backend-specific.

Publishing a new version

Increment the version found in pyproject.toml and run:

make publish

init-service's People

Contributors

aadam-ali avatar ashusingh avatar beny23 avatar beyond-code-github avatar chotai avatar cjwebb avatar colin-lamed avatar dabd avatar daveygit2050 avatar fruiti-lewis avatar hmrc-phil avatar hmrc-web-operations avatar ianmcshane avatar iteratoruk avatar jakobgrunig avatar jonnydh avatar jopintopaul avatar jordanrowe avatar konradwudkowski avatar macgrewal avatar matthewmascord avatar nigelhp avatar nivreddy14 avatar peteanning avatar raindeerr avatar shnick avatar swathimadhuri avatar thomas-vogel444 avatar tomasz-rosiek avatar tomwadeson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

init-service's Issues

Generate Test Scaffolding?

Just a quick question/suggestion on this - is it/can we make it so that it also scaffolds tests for the generated code? It would be fantastically useful to have some template tests as well as the controller, etc.

Enhance MicroserviceController scaffolding

Just a few suggestions to improve the scaffolding when you create a new service.

When you generate your new microservice using the script it the controller generates is called "MicroserviceHelloWorld". It might be good to use name conventions, e.g. "HelloWorldController" or "${ProjectName}HelloWorldController".

Scaffolding the folder structure (assets, controllers,connectors, services) might also be useful.

Within the controller there is also only 1 method to answer a "get" with hello world. Perhaps expanding this to have scaffolding for all the RESTful api calls would be nice as well.

Finally, is there a way to scaffold an authenticated controller vs a public controller, so that when starting out the auth requirements are baked in with specified Enrollments?

sbt idea generates out of date project config / import from sbt fails

When using sbt idea and then opening the project in Idea 2016.1.3 error messages are as shown. Given sbt support in Idea now, should this be removed?

When importing the sbt project within idea it does work ok after configuring the scala sdk to be used in with the project then rebuilding and restarting - otherwise it was not recognizing play libraries, which I suppose is configuration my end since the project files remain unchanged.

error
error2

Hardcoded assets-frontend version is out of date

The version of assets-frontend that's hard coded here is out of date.

Rather than it being hard coded and having to update it in the service every time one's been created, could it be made dynamic? it could pull the latest version from somewhere at run time.

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.