0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Jenkinsfileのlintをローカルマシンで行うための覚書

0
Last updated at Posted at 2021-01-29

参考記事

前提

  • Docker for Windows と VSCode を入れる

  • Jenkinsを起動(とりあえずローカルの50100/50101番ポートを使う|自動起動設定)
    docker run -d -p 50100:8080 -p 50101:50000 --restart=always jenkins/jenkins:lts

    • 起動したコンテナIDを落とすには
      docker kill $(docker ps -qf "ancestor=jenkins/jenkins:lts")
  • JenkinsのAdminパスワードを取得しておく
    docker logs $(docker ps -qf "ancestor=jenkins/jenkins:lts")

  • Jenkinsの初期セットアップをしておく(ここ自動化したいところ)

    • http://localhost:50100/ を開く
    • ↑で取得したパスワードでログイン
    • Install suggested plugins
    • ユーザー作成はスキップ
    • URL作成はそのまま進む
    • ログイン画面でadminを入力
    • JenkinsHomeに行ったら成功
  • VSCodeにJenkins Pipeline Linter Connectorを入れる

  • Jenkins Pipeline Linter Connectorの設定をする

    パラメータ名
    Connector: Url http://localhost:50100/pipeline-model-converter/validate
    Connector: Crumb Url http://localhost:50100/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,%22:%22,//crumb)
    Connector: User admin
    Connector: Pass ↑で取得したパスワード
    Connector: Strictssl false
  • あとはJenkinsfileを開いてvalidate jenkinsfileを実行する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?