Git Product home page Git Product logo

Comments (24)

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

@vishal423 :

  • done for the 1st and 2nd point
  • about the last (SonarQube), it would take more time, I'll try to do it later, after my day work (don't hesitate to ping me if I forget...)

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

Here the repo: https://github.com/jhipster/jhipster-sample-app-svelte

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

thanks @pascalgrimaud

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

About Docker:
I added and configure the Docker image. You can pull it: docker pull jhipster/jhipster-svelte:main
The tags are here: https://hub.docker.com/repository/docker/jhipster/jhipster-svelte/tags?page=1

A new image will be built when there are new commits in main branch -> jhipster/jhipster-svelte:main
A new image will be built when there is a new tag: latest + tagname
Ex:
v1.0.0 -> so there will be jhipster/jhipster-svelte:latest and jhipster/jhipster-svelte:v1.0.0

About SonarCloud:
I added the SONAR_TOKEN to GitHub secrets.
Then, I added the project to SonarCloud : https://sonarcloud.io/project/configuration?id=jhipster_jhipster-sample-app-svelte

Here the information to launch the analyze:

sonar-scanner \
  -Dsonar.organization=jhipster \
  -Dsonar.projectKey=jhipster_jhipster-sample-app-svelte \
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sonarcloud.io

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

About NPM, I just created a new team svelte and added you in it.
I don't know if it's enough ?

Can you confirm me if everything is OK @vishal423 ?
Don't hesitate to ping me if needed, I'll do my best to help you.

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

Thanks a lot @pascalgrimaud. Can you change the docker repository name to jhipster/svelte-hipster?

Also, Instead of doing a release from main, I intend to use a separate branch probably release. This would require a slight change in the build process as:

  • A new image will be built when there are new commits in main branch -> jhipster/jhipster-svelte:main
  • A new image will be built when there is a new tag in release branch: latest + tagname

As you might have noticed the current docker file uses npm linking to consider the svelte blueprint. Though it's fine for development, I don't consider it as a good practice to release tagged build with that and instead, that should be done with a published npm module.

As I plan to automate the overall release including npm publishing via Github action, do you know if we can delay the docker image creation and publishing to be done after npm publishing (otherwise, that will fail as the published npm module wouldn't be available)? An alternative would be to do docker publishing via Github action

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

@vishal423 : I can't rename at Docker Hub. Do you want me to delete and create a new repo for image: jhipster/svelte-hipster ?

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

@pascalgrimaud, that would also work

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

@vishal423 : ok let's go, I'm deleting the Docker Hub image repo, and will recreate it

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

The Docker Hub project is created: https://hub.docker.com/repository/docker/jhipster/svelte-hipster/tags?page=1

Here the config:
docker-hub-svelte-hipster

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

As I plan to automate the overall release including npm publishing via Github action, do you know if we can delay the docker image creation and publishing to be done after npm publishing (otherwise, that will fail as the published npm module wouldn't be available)? An alternative would be to do docker publishing via Github action

I think you won't encounter this, as the npm publish will be done before the Docker build, as Docker build is sooooo long.

Then, I tried to automate this, but I can't as for publishing in NPM, I needed to activate two-factor authentication, so the CI needs an OTP (One Time Password) to publish: as it was impossible, I did it using ansible, with this project: https://github.com/jhipster/jhipster-ansible

  • I launch: ansible-playbook -v playbooks/jhipster-vuejs-prepare.yml
  • then: ansible-playbook -v playbooks/jhipster-vuejs-release.yml

I think it would be the same than git push origin release

So finally, it's manual but it's very fast. In the end, I'd prefer doing this manually, but it's just my opinion.

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

@pascalgrimaud, I just published the npm package https://www.npmjs.com/package/generator-jhipster-svelte to see how things will look and don't see the package included in the jhipster organization. It seems I don't have access to pull a package into JHipster organization. I have included you as a maintainer on the package so that you can pull that into the jhipster organization.

For docker:
I believe I need a separate docker file to distinguish from the one used in the CI. Can you please change the docker file name from Dockerfile to Dockerfile-release for the tag build? I am not sure if we need the first rule to trigger build on release branch check-ins. Can we remove that?

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

@vishal423 : I don't know how we can see the package included in jhipster organization. But I pull it into the jhipster organization. It is list under https://www.npmjs.com/settings/jhipster/packages?page=1&perPage=10

For Docker:

  • for branch release and tag: Dockerfile -> Dockerfile-release
  • for branch main: unchanged

After thinking more about your possible release process, I'll change the config to:

  • for branch main only: trigger an image for jhipster/svelte-hipster:main
  • for tag: trigger images for jhipster/svelte-hipster:vX.Y.Y and jhipster/svelte-hipster:latest, with Dockerfile -> Dockerfile-release

So in this solution, in your CI for release branch:

  • npm test
  • npm publish
  • git tag
  • so only after tag, the Docker build will trigger

I suggest you to keep "latest" to always have "latest" tag in Docker Hub.
It's easier for doing: docker pull jhipster/svelte-hipster

I'm doing this right now

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

Here the config at Docker Hub, tell me if it's good or not. Don't hesitate, it's easy to change:
docker-hub-svelte-hipster

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

@pascalgrimaud, Can you please share the JHipster Bot PAT on this repository as well (like done at https://github.com/jhipster/jdl-studio/blob/a6dda6f86776035ebc1fe8c1f828a03f20bf32c9/.github/workflows/update-jhipster-online.yml#L43)?

from generator-jhipster-svelte.

pascalgrimaud avatar pascalgrimaud commented on June 1, 2024

@vishal423 : I don't know what you're talking about. Maybe @deepu105 or @jdubois you can help @vishal423 ?

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

Then, I tried to automate this, but I can't as for publishing in NPM, I needed to activate two-factor authentication, so the CI needs an OTP (One Time Password) to publish: as it was impossible, I did it using ansible, with this project: https://github.com/jhipster/jhipster-ansible

@pascalgrimaud , FYI: NPM allows you to create an automation token (specifically to be used in CI to publish packages). That token doesn't require 2-factor authentication passcode (even though that's enabled). I haven't yet tried, however, will soon know 🤞

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

@jdubois, I believe you are aware about JHipster Bot being used in the jdl-studio. Can you share that user PAT in this repository secrets as well? Also, for the JHipster Bot user, can you grant write access on https://github.com/jhipster/jhipster-sample-app-svelte repository as I plan to use that in automation to synchronize sample code after each release build?

from generator-jhipster-svelte.

jdubois avatar jdubois commented on June 1, 2024

I'm sorry I have no idea what a "PAT" is, could you explain this to me?
And the bot has in fact no access at all. I just use it to do PRs to people's repositories with JHipster Online, but there's a trick: it's not really the bot that write stuff. It's doing a commit with his id (and email), but it uses the user's token to push: that gives him the right to publish (using the user token), and keeps its face in the commit. But it's not really the bot which commits, and I guess that's why its GitHub statistics are 0.
Have a look at the code here: https://github.com/jhipster/jhipster-online/blob/main/src/main/java/io/github/jhipster/online/service/GitService.java#L89

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

@jdubois , By PAT, I means Personal access token and is a recommended practice to use a BOT account instead of personal account for automation. I though you were aware as that's used in jdl-studio and as per comments under this PR, you created the PAT.

@SudharakaP, may be you can help over here?

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

btw, I do see the bot being used to commit directly on repository, not sure if that's being invoked using a real user PAT or via the bot PAT

from generator-jhipster-svelte.

jdubois avatar jdubois commented on June 1, 2024

Oh yes, then I know what it is 🤣
I just configured one 5 minutes ago in fact!
For the bot we don't use this at all: the issue is that people would need to invite the bot in their org, and then the bot would need to agree to join the org (that latest part is really annoying). And there is no Java API for this. It's much easier to use the user's OAuth2 token. Basically we act as the user, but with another ID, so that doesn't mix with his own commits.

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

The use case over here is to auto-generate the sample application (https://github.com/jhipster/jhipster-sample-app-svelte) on each release and since the sample repository is part of JHipster organization, we need to ensure the bot has write access

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on June 1, 2024

At last, I was able to configure and do end to end deployment. There is still an open action item to fix the sample app integration with sonar, which I think should track in that repository.

Closing the issue as everything looks good here.

from generator-jhipster-svelte.

Related Issues (20)

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.