{"id":17121453,"url":"https://github.com/hellojukay/jenkins-experience","last_synced_at":"2025-03-24T02:28:24.202Z","repository":{"id":140615430,"uuid":"189326693","full_name":"hellojukay/jenkins-experience","owner":"hellojukay","description":"some experience about jenkins","archived":false,"fork":false,"pushed_at":"2019-05-30T06:24:51.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T08:34:06.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellojukay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-30T01:51:06.000Z","updated_at":"2019-05-30T06:24:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc5e4f3a-73fd-4f7e-b5e4-1a0fe264d1c1","html_url":"https://github.com/hellojukay/jenkins-experience","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"f68a74ddc74226393fb1166ac8b95e1435ce90a5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellojukay%2Fjenkins-experience","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellojukay%2Fjenkins-experience/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellojukay%2Fjenkins-experience/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellojukay%2Fjenkins-experience/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellojukay","download_url":"https://codeload.github.com/hellojukay/jenkins-experience/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245197798,"owners_count":20576262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T18:02:37.449Z","updated_at":"2025-03-24T02:28:24.182Z","avatar_url":"https://github.com/hellojukay.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jenkins-experience\n\nsome experience about jenkins\n\n## problems\n\n### git clone to special dir\n```groovy\ncheckout scm: [$class: 'GitSCM',extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'deploy-smac']], userRemoteConfigs: [[url: \"${REPO}\", credentialsId: \"${credential}\"]], branches: [[name: \"${VERSION}\"]]],poll: false\n```\n\n### read ini config\n```groovy\ndef call(String file) {\n    def m = [:]\n    def lines = new File(file).readLines()\n    for(line in lines) {\n        def kv = line.split(\"=\")\n        if(kv.length == 2) {\n            def k = kv[0]\n            def v = kv[1]\n            m[k] = v\n        }\n    }\n    return m\n}\n```\n\n### list git remote tags \n```groovy\ndef call(String git_url, String credentialsId = \"gitlab\") {\n    def GIT_USER = \"\"\n    def GIT_PW = \"\"\n    withCredentials([usernamePassword(credentialsId: \"${credentialsId}\", passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {\n            def u = URLEncoder.encode(GIT_USERNAME,'UTF-8')\n            def p = URLEncoder.encode(GIT_PASSWORD,'UTF-8')\n            GIT_USER = u\n            GIT_PW = p\n    }\n    git_url = git_url.replace(\"//\",\"//${GIT_USER}:${GIT_PW}@\")\n    def gettags = (\"git ls-remote -t -h ${git_url}\").execute()\n    return gettags.text.readLines().collect { \n        it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', '').replaceAll(\"\\\\^\\\\{\\\\}\", '')\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellojukay%2Fjenkins-experience","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellojukay%2Fjenkins-experience","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellojukay%2Fjenkins-experience/lists"}