{"action":"closed","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/8358","repository_url":"https://api.github.com/repos/jhipster/generator-jhipster","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/8358/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/8358/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/8358/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/8358","id":361143302,"node_id":"MDU6SXNzdWUzNjExNDMzMDI=","number":8358,"title":"Use gitlab ci stages","user":{"login":"atomfrede","id":203401,"node_id":"MDQ6VXNlcjIwMzQwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/203401?v=4","gravatar_id":"","url":"https://api.github.com/users/atomfrede","html_url":"https://github.com/atomfrede","followers_url":"https://api.github.com/users/atomfrede/followers","following_url":"https://api.github.com/users/atomfrede/following{/other_user}","gists_url":"https://api.github.com/users/atomfrede/gists{/gist_id}","starred_url":"https://api.github.com/users/atomfrede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomfrede/subscriptions","organizations_url":"https://api.github.com/users/atomfrede/orgs","repos_url":"https://api.github.com/users/atomfrede/repos","events_url":"https://api.github.com/users/atomfrede/events{/privacy}","received_events_url":"https://api.github.com/users/atomfrede/received_events","type":"User","site_admin":false},"labels":[{"id":241999106,"node_id":"MDU6TGFiZWwyNDE5OTkxMDY=","url":"https://api.github.com/repos/jhipster/generator-jhipster/labels/feature%20request","name":"feature request","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":{"login":"atomfrede","id":203401,"node_id":"MDQ6VXNlcjIwMzQwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/203401?v=4","gravatar_id":"","url":"https://api.github.com/users/atomfrede","html_url":"https://github.com/atomfrede","followers_url":"https://api.github.com/users/atomfrede/followers","following_url":"https://api.github.com/users/atomfrede/following{/other_user}","gists_url":"https://api.github.com/users/atomfrede/gists{/gist_id}","starred_url":"https://api.github.com/users/atomfrede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomfrede/subscriptions","organizations_url":"https://api.github.com/users/atomfrede/orgs","repos_url":"https://api.github.com/users/atomfrede/repos","events_url":"https://api.github.com/users/atomfrede/events{/privacy}","received_events_url":"https://api.github.com/users/atomfrede/received_events","type":"User","site_admin":false},"assignees":[{"login":"atomfrede","id":203401,"node_id":"MDQ6VXNlcjIwMzQwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/203401?v=4","gravatar_id":"","url":"https://api.github.com/users/atomfrede","html_url":"https://github.com/atomfrede","followers_url":"https://api.github.com/users/atomfrede/followers","following_url":"https://api.github.com/users/atomfrede/following{/other_user}","gists_url":"https://api.github.com/users/atomfrede/gists{/gist_id}","starred_url":"https://api.github.com/users/atomfrede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomfrede/subscriptions","organizations_url":"https://api.github.com/users/atomfrede/orgs","repos_url":"https://api.github.com/users/atomfrede/repos","events_url":"https://api.github.com/users/atomfrede/events{/privacy}","received_events_url":"https://api.github.com/users/atomfrede/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-09-18T05:41:12Z","updated_at":"2018-09-21T07:59:42Z","closed_at":"2018-09-21T07:59:42Z","author_association":"MEMBER","body":"##### Improve generated gitlab ci pipeline\r\n\r\nCurrently there is only one step in the gitlab ci pipeline. We should use different stages\r\n\r\n##### **Motivation for or Use Case**\r\n\r\nIn case one step fails we we have to execute all steps of teh script before. Furthermore when using deploy to heroku we can't see which commit is currently deployed in gitlabs environment overview and maybe rollback. \r\n\r\nAn example looks like this:\r\n\r\n```\r\nimage: jhipster/jhipster:v5.3.4\r\n\r\ncache:\r\n    key: \"$CI_COMMIT_REF_NAME\"\r\n    paths:\r\n        - .gradle/wrapper\r\n        - .gradle/caches\r\nstages:\r\n    - build\r\n    - test\r\n    - analyze\r\n    - assemble\r\n    - deploy\r\n\r\nbefore_script:\r\n    - export GRADLE_USER_HOME=`pwd`/.gradle\r\n    - ./gradlew npmInstall -PnodeInstall --no-daemon\r\n\r\ngradle-build:\r\n    stage: build\r\n    script:\r\n        - ./gradlew compileJava -x check -PnodeInstall --no-daemon\r\ngradle-test:\r\n    stage: test\r\n    script:\r\n        - ./gradlew test -PnodeInstall --no-daemon\r\nnpm-test:\r\n    stage: test\r\n    script: \r\n        - ./gradlew npm_test -PnodeInstall --no-daemon\r\nsonar-check:\r\n    stage: analyze\r\n    script:\r\n        - ./gradlew sonarqube --no-daemon -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN\r\ngradle-assemble:\r\n    stage: assemble\r\n    script:\r\n        - ./gradlew bootWar -Pprod -x check -PnodeInstall --no-daemon\r\n    artifacts:\r\n        paths:\r\n            - build/libs/*.war\r\n        # Uncomment following to expire the artifacts after defined period, https://docs.gitlab.com/ee/ci/yaml/README.html#artifacts-expire_in\r\n        # expire_in: 90 day\r\nheroku-deploy-to-production:\r\n    stage: deploy\r\n    environment:\r\n        name: production\r\n    only:\r\n        - master\r\n    script:\r\n        - ./gradlew deployHeroku --no-daemon\r\n```\r\nAlso gound gradle seems not to support deploy to artifactory. Can do a PR for both if you think this is useful. We could also use the gitlab container registry to build and push a docker image of the application.\r\n\r\n##### **Related issues or PR**\r\n\r\nNone found.\r\n\r\n- [x] Checking this box is mandatory (this is just to show you read everything)\r\n\r\n"}}
{"actor":{"display_login":"atomfrede"}}