他アカウントの CodeCommit を使用した CodePipeline

開発アカウントに CodeCommit を使用して、プロダクションアカウントでビルドやデプロイを行うためのメモ。

f:id:section27:20180924032104p:plain

1. プロダクションアカウント

1-1. CodePipeline のサービスロールのためのポリシーを作成する

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:GetObject",
                "s3:GetObjectVersion",
                "s3:GetBucketVersioning"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "s3:PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::codepipeline*",
                "arn:aws:s3:::elasticbeanstalk*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "codecommit:CancelUploadArchive",
                "codecommit:GetBranch",
                "codecommit:GetCommit",
                "codecommit:GetUploadArchiveStatus",
                "codecommit:UploadArchive"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "codedeploy:CreateDeployment",
                "codedeploy:GetApplicationRevision",
                "codedeploy:GetDeployment",
                "codedeploy:GetDeploymentConfig",
                "codedeploy:RegisterApplicationRevision"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "elasticbeanstalk:*",
                "ec2:*",
                "elasticloadbalancing:*",
                "autoscaling:*",
                "cloudwatch:*",
                "s3:*",
                "sns:*",
                "cloudformation:*",
                "rds:*",
                "sqs:*",
                "ecs:*",
                "iam:PassRole"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "lambda:InvokeFunction",
                "lambda:ListFunctions"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "opsworks:CreateDeployment",
                "opsworks:DescribeApps",
                "opsworks:DescribeCommands",
                "opsworks:DescribeDeployments",
                "opsworks:DescribeInstances",
                "opsworks:DescribeStacks",
                "opsworks:UpdateApp",
                "opsworks:UpdateStack"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "cloudformation:CreateStack",
                "cloudformation:DeleteStack",
                "cloudformation:DescribeStacks",
                "cloudformation:UpdateStack",
                "cloudformation:CreateChangeSet",
                "cloudformation:DeleteChangeSet",
                "cloudformation:DescribeChangeSet",
                "cloudformation:ExecuteChangeSet",
                "cloudformation:SetStackPolicy",
                "cloudformation:ValidateTemplate",
                "iam:PassRole"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "codebuild:BatchGetBuilds",
                "codebuild:StartBuild"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Effect": "Allow",
            "Action": [
                "devicefarm:ListProjects",
                "devicefarm:ListDevicePools",
                "devicefarm:GetRun",
                "devicefarm:GetUpload",
                "devicefarm:CreateUpload",
                "devicefarm:ScheduleRun"
            ],
            "Resource": "*"
        }
    ]
}

1-2. CodePipeline のサービスロールを作成する

CodePipeline サービスのロールを作成する

1-3. IAMの暗号化キーを作成する

  • IAM から 暗号化キー を選択して、使用するリージョンで キーの作成 を選択する
  • エイリアスと説明の作成で、エイリアス を入力し 次のステップ を選択する
  • タグの追加で必要に応じてタグを追加し、次のステップ を選択する
  • キーの使用アクセス許可の定義 の キー管理者 を必要に応じて設定し、次のステップ を選択する
  • キーの使用アクセス許可の定義 の このアカウント で 1-2 の手順で作成した CodePipeline のサービスロールを選択する、 外部アカウント で 外部アカウントの追加 を選択して開発アカウントIDを入力する
  • キーポリシーのプレビューで 完了 を選択する

1-4. CodePipeline のサービスロールに暗号化キーのポリシーを追加する

1-2 の手順で作成した CodePipeline のロールに 1-3 の手順で作成した暗号化キーの ARN をリソースに設定して作成したポリシーをアタッチする

{
    "Version": "2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Action": [
            "kms:*"
        ],
        "Resource": [
            "arn:aws:kms:ap-northeast-1:${ProductionAccount}:key/2222222-3333333-4444-556677EXAMPLE"
        ]
    }
}

1-5. CodeBuild のサービスロールのためのポリシーを作成する

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "codebuild:*",
                "iam:PassRole",
                "logs:FilterLogEvents",
                "logs:GetLogEvents",
                "logs:CreateLogStream",
                "logs:CreateLogGroup",
                "logs:PutLogEvents",
                "s3:CreateBucket",
                "s3:GetObject",
                "s3:List*",
                "s3:PutObject"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

1-6. CodeBuild のサービスロールを作成する

CodeBuild サービスのロールを作成し、1-5 の手順で作成した CodeBuild のポリシーと 1-4 の手順で作成したポリシーをアタッチする

2. 開発アカウント

2-1. CodeCommit にクロスアカウントアクセスのためのポリシーを作成する

1-3 の手順で作成した暗号化キーの ARN を設定して、 クローンしたイメージを暗号化して CodePipeline の S3 に PutObject するためのポリシーを作成する。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
              "codecommit:BatchGetRepositories",
              "codecommit:Get*",
              "codecommit:GitPull",
              "codecommit:List*",
              "codecommit:CancelUploadArchive",
              "codecommit:UploadArchive",
              "s3:*"
            ],
            "Resource": "*"
        },
        {
           "Effect": "Allow",
            "Action": [
                "kms:*"
            ],
            "Resource": [
                "arn:aws:kms:ap-northeast-1:${ProductionAccount}:key/2222222-3333333-4444-556677EXAMPLE"
            ]
        }
    ]
}

2-2. CodeCommit のロールを作成する

  • IAM から ロール を選択し ロールの作成 を選択する
  • 別のAWSアカウント を選択し、アカウントID にプロダクションアカウントのアカウントIDを入力し、次のステップ:アクセス権限 を選択する
  • 2-1 の手順で作成したポリシーをアタッチし、次のステップ:確認 を選択する
  • ロール名を入力し、ロールの作成 を選択する

2-3. CodeCommit を作成する

CodeCommit を作成する。CodeCommit は既存のでも、あらかじめ作成しておいてもよい。

3. プロダクションアカウント

3-1. CodePipeline のサービスロールに開発アカウントのポリシーを追加

CodePipeline に開発アカウントの CodeCommit のロールにアクセスするポリシーを作成しアタッチする

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sts:AssumeRole"
            ],
            "Resource": [
                "arn:aws:iam::${DevelopAccount}:role/${CodeCommitRoleName}"
            ]
        }
    ]
}

3-2. CodePipeline の Artifact Store となる S3 Bucket を作成する

codebuild.amazonaws.com サービスと開発アカウントの CodeCommit ロールからアクセスされる CodePipeline で使う S3 Bucket を作成する。

Key Description
BucketName CodePipeline が使用するバケット
CodeCommitRoleName 2-2 の手順で作成したロール名
DevelopAccount 開発アカウントID
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  BucketName:
    Type: String
  CodeCommitRoleName:
    Type: String
  DevelopAccount:
    Type: String
Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Ref BucketName
  BucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket: !Ref S3Bucket
      PolicyDocument:
        Statement:
        - Action: s3:*
          Effect: Allow
          Resource:
          - !Sub arn:aws:s3:::${BucketName}
          - !Sub arn:aws:s3:::${BucketName}/*
          Principal:
            Service:
            - codebuild.amazonaws.com
            AWS:
            - !Sub arn:aws:iam::${DevelopAccount}:role/${CodeCommitRoleName}

3-3. CodeBuild

Key Description
CacheLocation CodeBuild のキャッシュが使用するバケット
CodeBuildRoleName 1-6 の手順で作成したロール名
Image CodeBuildに使用するコンテナ名
Name CodeBuild名
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  CacheLocation:
    Type: String
  CodeBuildRoleName:
    Type: String
  Image:
    Type: String
  Name:
    Type: String
Resources:
  CodeBuild:
    Type: AWS::CodeBuild::Project
    Properties:
      Artifacts:
        Type: CODEPIPELINE
      Cache:
        Location: !Sub ${CacheLocation}/ivy2
        Type: S3
      Description: !Ref Name
      EncryptionKey: arn:aws:kms:ap-northeast-1:${ProductionAccount}:key/2222222-3333333-4444-556677EXAMPLE
      Environment:
        ComputeType: BUILD_GENERAL1_SMALL
        Image: !Ref Image
        EnvironmentVariables:
        - Name: BUCKET_NAME
          Value: !Ref CacheLocation
        PrivilegedMode: true
        Type: LINUX_CONTAINER
      Name: !Ref Name
      ServiceRole: !Sub arn:aws:iam::${AWS::AccountId}:role/${CodeBuildRoleName}
      Source:
        Type: CODEPIPELINE

3-4. CodePipeline

Key Description
BucketName 3-2 の手順で作成したバケット
CodeCommitRoleName 2-2 の手順で作成したロール名
CodePipelineRoleName 1-2 の手順で作成したロール名
DevelopAccount 開発アカウントID
Name CodePipeline名
RepositoryName 2-3 の手順で作成した CodeCommit リポジトリ
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  BucketName:
    Type: String
  CodeCommitRoleName:
    Type: String
  CodePipelineRoleName:
    Type: String
  DevelopAccount:
    Type: String
  Name:
    Type: String
  RepositoryName:
    Type: String
Resources:
  CodePipeline:
    Type: AWS::CodePipeline::Pipeline
    Properties:
      ArtifactStore:
        EncryptionKey:
          Id: arn:aws:kms:ap-northeast-1:${ProductionAccount}:key/2222222-3333333-4444-556677EXAMPLE
          Type: KMS
        Location: !Ref BucketName
        Type: S3
      Name: !Ref Name
      RoleArn: !Sub arn:aws:iam::${AWS::AccountId}:role/${CodePipelineRoleName}
      Stages:
      - Actions:
        - ActionTypeId:
            Category: Source
            Owner: AWS
            Provider: CodeCommit
            Version: 1
          Configuration:
            PollForSourceChanges: false
            RepositoryName: !Ref RepositoryName
            BranchName: master
          Name: source
          OutputArtifacts:
          - Name: MyApp
          RoleArn: !Sub arn:aws:iam::${DevelopAccount}:role/${CodeCommitRoleName}
        Name: source
      - Actions:
        - ActionTypeId:
            Category: Build
            Owner: AWS
            Provider: CodeBuild
            Version: 1
          Configuration:
            ProjectName: !Ref Name
          InputArtifacts:
          - Name: MyApp
          OutputArtifacts:
          - Name: App
          Name: build
        Name: build

参考

ECR のイメージを別のアカウントの ECR に転送する

準備

$ pip install boto3
$ pip install docker

ECR から pull

import boto3
import base64
import docker

account_id = '123456789012'
region = 'ap-northeast-1'
name = '%s.dkr.ecr.%s.amazonaws.com/%s' % (account_id, region, 'example')

session = boto3.Session(
    profile_name = SWITCH_ACCOUNT_PROFILE,
    region_name = region
)

ecr = session.client('ecr')
authorization_token = ecr.get_authorization_token()['authorizationData'][0]
token = base64.b64decode(authorization_token['authorizationToken']).split(':')
user = token[0]
pwd = token[1]
auth_cred = { 'username': user, 'password': pwd }

client = docker.from_env()
client.images.pull(name, auth_config = auth_cred)

転送先の ECR 用に tag を設定

import docker

src_account_id = '123456789012'
dist_account_id = '210987654321'
region = 'ap-northeast-1'

src = '%s.dkr.ecr.%s.amazonaws.com/%s' % (src_account_id, region, 'example')
dist = '%s.dkr.ecr.%s.amazonaws.com/%s' % (dist_account_id, region, 'example')

client = docker.from_env()
images = client.images.list(name = src)
for image in images:
    for tag in image.tags:
        t = tag.split(':')[1]
        image.tag(dist, t)

別のアカウントの ECR に push

import boto3
import base64
import docker

account_id = '210987654321'
region = 'ap-northeast-1'

session = boto3.Session(
    profile_name = SWITCH_ANOTHER_ACCOUNT_PROFILE,
    region_name = region
)

name = '%s.dkr.ecr.%s.amazonaws.com/%s' % (account_id, region, 'example')
ecr = session.client('ecr')
authorization_token = ecr.get_authorization_token()['authorizationData'][0]
token = base64.b64decode(authorization_token['authorizationToken']).split(':')
user = token[0]
pwd = token[1]
auth_cred = { 'username': user, 'password': pwd }
client = docker.from_env()
images = client.images.list(name = name)
for image in images:
    for tag in image.tags:
        client.images.push(tag, auth_config = auth_cred)

Excel 2016 for Mac でシート名のタブが表示されなくなったとき

ある日の夕方、わたしはパニックになっていた。

通常なら、エクセルの画面の下にはシート名がこんな感じで表示されていて、目的のシートを編集するだけだと思っていたからだ。

f:id:section27:20180902152241p:plain

ところが、実際に操作をしようとすると、なんとシート名が表示されていない。目的のシートはどこへ消えてしまったのだ。わからん、今日中になんとかしなければと思いつつもどうにもできない。わたしは編集ができなかったことを伝えてその日は帰るしかなかった。

f:id:section27:20180902152302p:plain

後日、設定がおかしかっただけというような話を聞いたので、あらためてググってみた。

まずは、エクセルのメニューから、「環境設定」を選んでみる。

f:id:section27:20180902152316p:plain

次に、「表示」というのを選んでみる。

f:id:section27:20180902152328p:plain

なるほど、「シート見出し」というところにチェックが入っていない。 なら、話は簡単だ、この「シート見出し」とやらにチェックを入れればいいはずだと気づいた。

f:id:section27:20180902152340p:plain

これで、元通りシート見出しが表示されるようになって、目的の作業を完遂することができた。

Serverless Framework で Pseudo Parameters を使う

Serverless FrameworkAWSPseudo Parameters を使うのに少し悩んだのでメモとして残します。

うまくいったパターン

2通りの方法で定義しています(var1 と var2)。

service: hello
provider:
  name: aws
  runtime: nodejs8.10

custom:
  accountId: 
    Ref: 'AWS::AccountId'

functions:
  hello:
    handler: handler.hello
    environment:
      var1: ${self:custom.accountId}
      var2: 
        Ref: 'AWS::AccountId'

うまくいかないパターン

Serverless Framework では ${} のように囲まれた部分を、定義されている変数で置換しようとするためエラーになってしまいました。

service: hello
provider:
  name: aws
  runtime: nodejs8.10

functions:
  hello:
    handler: handler.hello
    environment:
      var1:
        Fn::Sub:
          '${Ref: AWS::AccountId}'

さんちか

神戸三宮の地下街に入るとかならず耳にするあの曲ってなんだろうとしらべてみた

ばんばひろふみさんの「風に乗って」だとわかった

CDはすでに廃盤

なんとか曲を手に入れられないかいろいろ調べたら

mora.jp で販売されていた

音楽ダウンロード・音楽配信サイト mora ~WALKMAN®公式ミュージックストア~

これでさんちかに行かなくてもいつでも聴ける

sbt

AttributeKey

キー 説明
projectCommand sbt.internal.util.AttributeKey[scala.Boolean]
sessionSettings sbt.internal.util.AttributeKey[sbt.internal.SessionSettings]
stateBuildStructure sbt.internal.util.AttributeKey[sbt.internal.BuildStructure]
transformState sbt.internal.util.AttributeKey[scala.Function1[sbt.State, sbt.State]]
analysis sbt.internal.util.AttributeKey[xsbti.compile.CompileAnalysis]
stateCompilerCache sbt.internal.util.AttributeKey[xsbti.compile.GlobalsCache]
isModule sbt.internal.util.AttributeKey[scala.Boolean]
entryApiURL sbt.internal.util.AttributeKey[java.net.URL]
sessionVars sbt.internal.util.AttributeKey[sbt.SessionVar.Map]
taskDefinitionKey sbt.internal.util.AttributeKey[sbt.Def.ScopedKey[_]]
stateStreams sbt.internal.util.AttributeKey[Keys.Streams]
triggeredBy sbt.internal.util.AttributeKey[scala.collection.Seq[sbt.Task[_]]]
runBefore sbt.internal.util.AttributeKey[scala.collection.Seq[sbt.Task[_]]]

InputKey

キー 説明
run sbt.InputKey[scala.Unit]
runMain sbt.InputKey[scala.Unit]
bgStop sbt.InputKey[scala.Unit]
bgWaitFor sbt.InputKey[scala.Unit]
bgRun sbt.InputKey[sbt.JobHandle]
bgRunMain sbt.InputKey[sbt.JobHandle]
testOnly sbt.InputKey[scala.Unit]
testQuick sbt.InputKey[scala.Unit]

SettingKey

キー 説明
logLevel sbt.SettingKey[sbt.util.Level.Value]
persistLogLevel sbt.SettingKey[sbt.util.Level.Value]
traceLevel sbt.SettingKey[scala.Int]
persistTraceLevel sbt.SettingKey[scala.Int]
showSuccess sbt.SettingKey[scala.Boolean]
showTiming sbt.SettingKey[scala.Boolean]
timingFormat sbt.SettingKey[java.text.DateFormat]
extraLoggers sbt.SettingKey[scala.Function1[sbt.Def.ScopedKey[_], scala.Seq[org.apache.logging.log4j.core.Appender]]]
logManager sbt.SettingKey[sbt.internal.LogManager]
logBuffered sbt.SettingKey[scala.Boolean]
sLog sbt.SettingKey[sbt.util.Logger]
autoGeneratedProject sbt.SettingKey[scala.Boolean]
loadedBuild sbt.SettingKey[sbt.internal.LoadedBuild]
buildDependencies sbt.SettingKey[sbt.internal.BuildDependencies]
appConfiguration sbt.SettingKey[xsbti.AppConfiguration]
thisProject sbt.SettingKey[sbt.ResolvedProject]
thisProjectRef sbt.SettingKey[sbt.ProjectRef]
configuration sbt.SettingKey[sbt.librarymanagement.Configuration]
commands sbt.SettingKey[scala.Seq[sbt.Command]]
initialize sbt.SettingKey[scala.Unit]
onLoad sbt.SettingKey[scala.Function1[sbt.State, sbt.State]]
onUnload sbt.SettingKey[scala.Function1[sbt.State, sbt.State]]
onLoadMessage sbt.SettingKey[root.scala.Predef.String]
onComplete sbt.SettingKey[scala.Function0[scala.Unit]]
historyPath sbt.SettingKey[scala.Option[java.io.File]]
shellPrompt sbt.SettingKey[scala.Function1[sbt.State, root.scala.Predef.String]]
autoStartServer sbt.SettingKey[scala.Boolean]
serverPort sbt.SettingKey[scala.Int]
serverHost sbt.SettingKey[root.scala.Predef.String]
serverAuthentication sbt.SettingKey[root.scala.Predef.Set[sbt.ServerAuthentication]]
serverConnectionType sbt.SettingKey[sbt.ConnectionType]
watch sbt.SettingKey[sbt.Watched]
suppressSbtShellNotification sbt.SettingKey[scala.Boolean]
watchAntiEntropy sbt.SettingKey[scala.concurrent.duration.FiniteDuration]
pollInterval sbt.SettingKey[scala.concurrent.duration.FiniteDuration]
watchService sbt.SettingKey[scala.Function0[sbt.io.WatchService]]
watchingMessage sbt.SettingKey[scala.Function1[sbt.internal.io.WatchState, root.scala.Predef.String]]
triggeredMessage sbt.SettingKey[scala.Function1[sbt.internal.io.WatchState, root.scala.Predef.String]]
baseDirectory sbt.SettingKey[java.io.File]
target sbt.SettingKey[java.io.File]
crossTarget sbt.SettingKey[java.io.File]
sourceDirectory sbt.SettingKey[java.io.File]
sourceManaged sbt.SettingKey[java.io.File]
scalaSource sbt.SettingKey[java.io.File]
javaSource sbt.SettingKey[java.io.File]
sourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
unmanagedSourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
managedSourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
sourcesInBase sbt.SettingKey[scala.Boolean]
includeFilter sbt.SettingKey[sbt.io.FileFilter]
excludeFilter sbt.SettingKey[sbt.io.FileFilter]
resourceDirectory sbt.SettingKey[java.io.File]
resourceManaged sbt.SettingKey[java.io.File]
unmanagedResourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
managedResourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
resourceDirectories sbt.SettingKey[scala.Seq[java.io.File]]
classDirectory sbt.SettingKey[java.io.File]
cleanKeepFiles sbt.SettingKey[scala.Seq[java.io.File]]
crossPaths sbt.SettingKey[scala.Boolean]
taskTemporaryDirectory sbt.SettingKey[java.io.File]
sourceGenerators sbt.SettingKey[scala.Seq[sbt.Task[scala.Seq[java.io.File]]]]
resourceGenerators sbt.SettingKey[scala.Seq[sbt.Task[scala.Seq[java.io.File]]]]
autoCompilerPlugins sbt.SettingKey[scala.Boolean]
maxErrors sbt.SettingKey[scala.Int]
compileOrder sbt.SettingKey[xsbti.compile.CompileOrder]
initialCommands sbt.SettingKey[root.scala.Predef.String]
cleanupCommands sbt.SettingKey[root.scala.Predef.String]
asciiGraphWidth sbt.SettingKey[scala.Int]
scalaHome sbt.SettingKey[scala.Option[java.io.File]]
scalaOrganization sbt.SettingKey[root.scala.Predef.String]
scalaVersion sbt.SettingKey[root.scala.Predef.String]
scalaBinaryVersion sbt.SettingKey[root.scala.Predef.String]
crossScalaVersions sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
crossVersion sbt.SettingKey[sbt.librarymanagement.CrossVersion]
classpathOptions sbt.SettingKey[xsbti.compile.ClasspathOptions]
sbtPlugin sbt.SettingKey[scala.Boolean]
crossSbtVersions sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
fileInputOptions sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
scalaCompilerBridgeSource sbt.SettingKey[sbt.librarymanagement.ModuleID]
scalaArtifacts sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
enableBinaryCompileAnalysis sbt.SettingKey[scala.Boolean]
aggregate sbt.SettingKey[scala.Boolean]
artifactPath sbt.SettingKey[java.io.File]
artifact sbt.SettingKey[sbt.librarymanagement.Artifact]
artifactClassifier sbt.SettingKey[scala.Option[root.scala.Predef.String]]
artifactName sbt.SettingKey[scala.Function3[sbt.librarymanagement.ScalaVersion, sbt.librarymanagement.ModuleID, sbt.librarymanagement.Artifact, root.scala.Predef.String]]
trapExit sbt.SettingKey[scala.Boolean]
fork sbt.SettingKey[scala.Boolean]
outputStrategy sbt.SettingKey[scala.Option[sbt.OutputStrategy]]
connectInput sbt.SettingKey[scala.Boolean]
javaHome sbt.SettingKey[scala.Option[java.io.File]]
bgJobService sbt.SettingKey[sbt.BackgroundJobService]
bgCopyClasspath sbt.SettingKey[scala.Boolean]
testFrameworks sbt.SettingKey[scala.Seq[sbt.TestFramework]]
testForkedParallel sbt.SettingKey[scala.Boolean]
testResultLogger sbt.SettingKey[sbt.TestResultLogger]
name sbt.SettingKey[root.scala.Predef.String]
normalizedName sbt.SettingKey[root.scala.Predef.String]
description sbt.SettingKey[root.scala.Predef.String]
homepage sbt.SettingKey[scala.Option[java.net.URL]]
startYear sbt.SettingKey[scala.Option[scala.Int]]
licenses sbt.SettingKey[scala.Seq[scala.Tuple2[root.scala.Predef.String, java.net.URL]]]
organization sbt.SettingKey[root.scala.Predef.String]
organizationName sbt.SettingKey[root.scala.Predef.String]
organizationHomepage sbt.SettingKey[scala.Option[java.net.URL]]
developers sbt.SettingKey[scala.List[sbt.librarymanagement.Developer]]
apiURL sbt.SettingKey[scala.Option[java.net.URL]]
autoAPIMappings sbt.SettingKey[scala.Boolean]
scmInfo sbt.SettingKey[scala.Option[sbt.librarymanagement.ScmInfo]]
projectInfo sbt.SettingKey[sbt.librarymanagement.ModuleInfo]
defaultConfiguration sbt.SettingKey[scala.Option[sbt.librarymanagement.Configuration]]
exportJars sbt.SettingKey[scala.Boolean]
trackInternalDependencies sbt.SettingKey[sbt.librarymanagement.TrackLevel]
exportToInternal sbt.SettingKey[sbt.librarymanagement.TrackLevel]
internalConfigurationMap sbt.SettingKey[scala.Function1[sbt.librarymanagement.Configuration, sbt.librarymanagement.Configuration]]
ivyConfigurations sbt.SettingKey[scala.Seq[sbt.librarymanagement.Configuration]]
unmanagedBase sbt.SettingKey[java.io.File]
updateConfiguration sbt.SettingKey[sbt.librarymanagement.UpdateConfiguration]
updateOptions sbt.SettingKey[sbt.librarymanagement.ivy.UpdateOptions]
evictionWarningOptions sbt.SettingKey[sbt.librarymanagement.EvictionWarningOptions]
transitiveClassifiers sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
sourceArtifactTypes sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
docArtifactTypes sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
makePomConfiguration sbt.SettingKey[sbt.librarymanagement.MakePomConfiguration]
publishMavenStyle sbt.SettingKey[scala.Boolean]
pomExtra sbt.SettingKey[scala.xml.NodeSeq]
pomPostProcess sbt.SettingKey[scala.Function1[scala.xml.Node, scala.xml.Node]]
pomIncludeRepository sbt.SettingKey[scala.Function1[sbt.librarymanagement.MavenRepository, scala.Boolean]]
pomAllRepositories sbt.SettingKey[scala.Boolean]
moduleName sbt.SettingKey[root.scala.Predef.String]
version sbt.SettingKey[root.scala.Predef.String]
isSnapshot sbt.SettingKey[scala.Boolean]
moduleID sbt.SettingKey[sbt.librarymanagement.ModuleID]
projectID sbt.SettingKey[sbt.librarymanagement.ModuleID]
overrideBuildResolvers sbt.SettingKey[scala.Boolean]
appResolvers sbt.SettingKey[scala.Option[scala.Seq[sbt.librarymanagement.Resolver]]]
resolvers sbt.SettingKey[scala.Seq[sbt.librarymanagement.Resolver]]
useJCenter sbt.SettingKey[scala.Boolean]
moduleConfigurations sbt.SettingKey[scala.Seq[sbt.librarymanagement.ModuleConfiguration]]
retrievePattern sbt.SettingKey[root.scala.Predef.String]
retrieveConfiguration sbt.SettingKey[scala.Option[sbt.librarymanagement.RetrieveConfiguration]]
offline sbt.SettingKey[scala.Boolean]
ivyPaths sbt.SettingKey[sbt.librarymanagement.ivy.IvyPaths]
libraryDependencies sbt.SettingKey[scala.Seq[sbt.librarymanagement.ModuleID]]
dependencyOverrides sbt.SettingKey[scala.Seq[sbt.librarymanagement.ModuleID]]
excludeDependencies sbt.SettingKey[scala.Seq[sbt.librarymanagement.InclExclRule]]
ivyXML sbt.SettingKey[scala.xml.NodeSeq]
scalaModuleInfo sbt.SettingKey[scala.Option[sbt.librarymanagement.ScalaModuleInfo]]
ivyValidate sbt.SettingKey[scala.Boolean]
ivyLoggingLevel sbt.SettingKey[sbt.librarymanagement.UpdateLogging]
artifacts sbt.SettingKey[scala.Seq[sbt.librarymanagement.Artifact]]
autoUpdate sbt.SettingKey[scala.Boolean]
retrieveManaged sbt.SettingKey[scala.Boolean]
retrieveManagedSync sbt.SettingKey[scala.Boolean]
configurationsToRetrieve sbt.SettingKey[scala.Option[scala.Seq[sbt.librarymanagement.ConfigRef]]]
managedDirectory sbt.SettingKey[java.io.File]
classpathTypes sbt.SettingKey[root.scala.Predef.Set[root.scala.Predef.String]]
publishArtifact sbt.SettingKey[scala.Boolean]
checksums sbt.SettingKey[scala.Seq[root.scala.Predef.String]]
forceUpdatePeriod sbt.SettingKey[scala.Option[scala.concurrent.duration.FiniteDuration]]
compatibilityWarningOptions sbt.SettingKey[sbt.internal.librarymanagement.CompatibilityWarningOptions]
conflictWarning sbt.SettingKey[sbt.librarymanagement.ConflictWarning]
conflictManager sbt.SettingKey[sbt.librarymanagement.ConflictManager]
autoScalaLibrary sbt.SettingKey[scala.Boolean]
managedScalaInstance sbt.SettingKey[scala.Boolean]
sbtResolver sbt.SettingKey[sbt.librarymanagement.Resolver]
sbtDependency sbt.SettingKey[sbt.librarymanagement.ModuleID]
sbtVersion sbt.SettingKey[root.scala.Predef.String]
sbtBinaryVersion sbt.SettingKey[root.scala.Predef.String]
templateResolverInfos sbt.SettingKey[scala.Seq[sbt.TemplateResolverInfo]]
insideCI sbt.SettingKey[scala.Boolean]
parallelExecution sbt.SettingKey[scala.Boolean]
tags sbt.SettingKey[scala.Seq[scala.Tuple2[sbt.Tags.Tag, scala.Int]]]
concurrentRestrictions sbt.SettingKey[scala.Seq[sbt.Tags.Rule]]
cancelable sbt.SettingKey[scala.Boolean]
forcegc sbt.SettingKey[scala.Boolean]
minForcegcInterval sbt.SettingKey[scala.concurrent.duration.Duration]
resolvedScoped sbt.SettingKey[sbt.Def.ScopedKey[_]]

TaskKey

キー 説明
serverLog sbt.TaskKey[scala.Unit]
buildStructure sbt.TaskKey[sbt.internal.BuildStructure]
watchSources sbt.TaskKey[scala.Seq[sbt.Watched.WatchSource]]
watchTransitiveSources sbt.TaskKey[scala.Seq[sbt.Watched.WatchSource]]
unmanagedSources sbt.TaskKey[scala.Seq[java.io.File]]
managedSources sbt.TaskKey[scala.Seq[java.io.File]]
sources sbt.TaskKey[scala.Seq[java.io.File]]
unmanagedResources sbt.TaskKey[scala.Seq[java.io.File]]
managedResources sbt.TaskKey[scala.Seq[java.io.File]]
resources sbt.TaskKey[scala.Seq[java.io.File]]
cleanFiles sbt.TaskKey[scala.Seq[java.io.File]]
scalacOptions sbt.TaskKey[scala.Seq[root.scala.Predef.String]]
javacOptions sbt.TaskKey[scala.Seq[root.scala.Predef.String]]
incOptions sbt.TaskKey[xsbti.compile.IncOptions]
compileOptions sbt.TaskKey[xsbti.compile.CompileOptions]
compileInputs sbt.TaskKey[xsbti.compile.Inputs]
scalaInstance sbt.TaskKey[sbt.internal.inc.ScalaInstance]
discoveredSbtPlugins sbt.TaskKey[sbt.internal.PluginDiscovery.DiscoveredNames]
pluginCrossBuild sbt.TaskKey[scala.Unit]
printWarnings sbt.TaskKey[scala.Unit]
clean sbt.TaskKey[scala.Unit]
console sbt.TaskKey[scala.Unit]
consoleQuick sbt.TaskKey[scala.Unit]
consoleProject sbt.TaskKey[scala.Unit]
compile sbt.TaskKey[xsbti.compile.CompileAnalysis]
manipulateBytecode sbt.TaskKey[xsbti.compile.CompileResult]
compileIncremental sbt.TaskKey[xsbti.compile.CompileResult]
previousCompile sbt.TaskKey[xsbti.compile.PreviousResult]
compilers sbt.TaskKey[xsbti.compile.Compilers]
compileAnalysisFilename sbt.TaskKey[root.scala.Predef.String]
compileIncSetup sbt.TaskKey[xsbti.compile.Setup]
compilerCache sbt.TaskKey[xsbti.compile.GlobalsCache]
classpathEntryDefinesClass sbt.TaskKey[scala.Function1[java.io.File, xsbti.compile.DefinesClass]]
doc sbt.TaskKey[java.io.File]
copyResources sbt.TaskKey[scala.Seq[scala.Tuple2[java.io.File, java.io.File]]]
sourcePositionMappers sbt.TaskKey[scala.Seq[scala.Function1[xsbti.Position, scala.Option[xsbti.Position]]]]
packageBin sbt.TaskKey[java.io.File]
package sbt.TaskKey[java.io.File]
packageDoc sbt.TaskKey[java.io.File]
packageSrc sbt.TaskKey[java.io.File]
packageOptions sbt.TaskKey[scala.Seq[sbt.PackageOption]]
packageConfiguration sbt.TaskKey[sbt.Package.Configuration]
mappings sbt.TaskKey[scala.Seq[scala.Tuple2[java.io.File, root.scala.Predef.String]]]
fileMappings sbt.TaskKey[scala.Seq[scala.Tuple2[java.io.File, java.io.File]]]
selectMainClass sbt.TaskKey[scala.Option[root.scala.Predef.String]]
mainClass sbt.TaskKey[scala.Option[root.scala.Predef.String]]
discoveredMainClasses sbt.TaskKey[scala.Seq[root.scala.Predef.String]]
runner sbt.TaskKey[sbt.ScalaRun]
forkOptions sbt.TaskKey[sbt.ForkOptions]
javaOptions sbt.TaskKey[scala.Seq[root.scala.Predef.String]]
envVars sbt.TaskKey[root.scala.Predef.Map[root.scala.Predef.String, root.scala.Predef.String]]
bgList sbt.TaskKey[scala.Seq[sbt.JobHandle]]
ps sbt.TaskKey[scala.Seq[sbt.JobHandle]]
testLoader sbt.TaskKey[java.lang.ClassLoader]
loadedTestFrameworks sbt.TaskKey[root.scala.Predef.Map[sbt.TestFramework, sbt.testing.Framework]]
definedTests sbt.TaskKey[scala.Seq[sbt.TestDefinition]]
definedTestNames sbt.TaskKey[scala.Seq[root.scala.Predef.String]]
executeTests sbt.TaskKey[sbt.Tests.Output]
test sbt.TaskKey[scala.Unit]
testOptions sbt.TaskKey[scala.Seq[sbt.TestOption]]
testListeners sbt.TaskKey[scala.Seq[sbt.TestReportListener]]
testExecution sbt.TaskKey[sbt.Tests.Execution]
testFilter sbt.TaskKey[scala.Function1[scala.Seq[root.scala.Predef.String], scala.Seq[scala.Function1[root.scala.Predef.String, scala.Boolean]]]]
testGrouping sbt.TaskKey[scala.Seq[sbt.Tests.Group]]
apiMappings sbt.TaskKey[root.scala.Predef.Map[java.io.File, java.net.URL]]
products sbt.TaskKey[scala.Seq[java.io.File]]
productDirectories sbt.TaskKey[scala.Seq[java.io.File]]
exportedProducts sbt.TaskKey[Keys.Classpath]
exportedProductsIfMissing sbt.TaskKey[Keys.Classpath]
exportedProductsNoTracking sbt.TaskKey[Keys.Classpath]
unmanagedClasspath sbt.TaskKey[Keys.Classpath]
unmanagedJars sbt.TaskKey[Keys.Classpath]
managedClasspath sbt.TaskKey[Keys.Classpath]
internalDependencyClasspath sbt.TaskKey[Keys.Classpath]
externalDependencyClasspath sbt.TaskKey[Keys.Classpath]
dependencyClasspath sbt.TaskKey[Keys.Classpath]
fullClasspath sbt.TaskKey[Keys.Classpath]
exportedProductJars sbt.TaskKey[Keys.Classpath]
exportedProductJarsIfMissing sbt.TaskKey[Keys.Classpath]
exportedProductJarsNoTracking sbt.TaskKey[Keys.Classpath]
internalDependencyAsJars sbt.TaskKey[Keys.Classpath]
dependencyClasspathAsJars sbt.TaskKey[Keys.Classpath]
fullClasspathAsJars sbt.TaskKey[Keys.Classpath]
classpathConfiguration sbt.TaskKey[sbt.librarymanagement.Configuration]
ivyConfiguration sbt.TaskKey[sbt.librarymanagement.ivy.IvyConfiguration]
bootIvyConfiguration sbt.TaskKey[sbt.librarymanagement.ivy.IvyConfiguration]
moduleSettings sbt.TaskKey[sbt.librarymanagement.ModuleSettings]
unresolvedWarningConfiguration sbt.TaskKey[sbt.librarymanagement.UnresolvedWarningConfiguration]
dependencyPositions sbt.TaskKey[root.scala.Predef.Map[sbt.librarymanagement.ModuleID, sbt.internal.util.SourcePosition]]
dependencyResolution sbt.TaskKey[sbt.librarymanagement.DependencyResolution]
publisher sbt.TaskKey[sbt.librarymanagement.Publisher]
ivySbt sbt.TaskKey[sbt.internal.librarymanagement.IvySbt]
ivyModule sbt.TaskKey[sbt.internal.librarymanagement.IvySbt#Module]
updateCacheName sbt.TaskKey[root.scala.Predef.String]
update sbt.TaskKey[sbt.librarymanagement.UpdateReport]
evicted sbt.TaskKey[sbt.librarymanagement.EvictionWarning]
transitiveUpdate sbt.TaskKey[scala.Seq[sbt.librarymanagement.UpdateReport]]
updateClassifiers sbt.TaskKey[sbt.librarymanagement.UpdateReport]
updateSbtClassifiers sbt.TaskKey[sbt.librarymanagement.UpdateReport]
publishConfiguration sbt.TaskKey[sbt.librarymanagement.PublishConfiguration]
publishLocalConfiguration sbt.TaskKey[sbt.librarymanagement.PublishConfiguration]
publishM2Configuration sbt.TaskKey[sbt.librarymanagement.PublishConfiguration]
makeIvyXmlConfiguration sbt.TaskKey[sbt.librarymanagement.PublishConfiguration]
makeIvyXmlLocalConfiguration sbt.TaskKey[sbt.librarymanagement.PublishConfiguration]
packagedArtifacts sbt.TaskKey[root.scala.Predef.Map[sbt.librarymanagement.Artifact, java.io.File]]
credentials sbt.TaskKey[scala.Seq[sbt.librarymanagement.ivy.Credentials]]
makePom sbt.TaskKey[java.io.File]
deliver sbt.TaskKey[java.io.File]
deliverLocal sbt.TaskKey[java.io.File]
makeIvyXml sbt.TaskKey[java.io.File]
publish sbt.TaskKey[scala.Unit]
publishLocal sbt.TaskKey[scala.Unit]
publishM2 sbt.TaskKey[scala.Unit]
bootResolvers sbt.TaskKey[scala.Option[scala.Seq[sbt.librarymanagement.Resolver]]]
externalResolvers sbt.TaskKey[scala.Seq[sbt.librarymanagement.Resolver]]
projectResolver sbt.TaskKey[sbt.librarymanagement.Resolver]
fullResolvers sbt.TaskKey[scala.Seq[sbt.librarymanagement.Resolver]]
otherResolvers sbt.TaskKey[scala.Seq[sbt.librarymanagement.Resolver]]
dependencyCacheDirectory sbt.TaskKey[java.io.File]
allDependencies sbt.TaskKey[scala.Seq[sbt.librarymanagement.ModuleID]]
projectDependencies sbt.TaskKey[scala.Seq[sbt.librarymanagement.ModuleID]]
publishTo sbt.TaskKey[scala.Option[sbt.librarymanagement.Resolver]]
projectDescriptors sbt.TaskKey[root.scala.Predef.Map[org.apache.ivy.core.module.id.ModuleRevisionId, org.apache.ivy.core.module.descriptor.ModuleDescriptor]]
packagedArtifact sbt.TaskKey[scala.Tuple2[sbt.librarymanagement.Artifact, java.io.File]]
classifiersModule sbt.TaskKey[sbt.librarymanagement.GetClassifiersModule]
skip sbt.TaskKey[scala.Boolean]
interactionService sbt.TaskKey[sbt.InteractionService]
collectAnalyses sbt.TaskKey[scala.Unit]
settingsData sbt.TaskKey[sbt.std.FullInstance.SS]
streams sbt.TaskKey[Keys.TaskStreams]
executionRoots sbt.TaskKey[scala.collection.Seq[sbt.Def.ScopedKey[_]]]
dummyRoots sbt.Task[scala.collection.Seq[sbt.Def.ScopedKey[_]]]
state sbt.TaskKey[sbt.State]
streamsManager sbt.TaskKey[sbt.std.Streams[sbt.Def.ScopedKey[_]]]
pluginData sbt.TaskKey[sbt.PluginData]
globalPluginUpdate sbt.TaskKey[sbt.librarymanagement.UpdateReport]

とりあえずメモ(Debianの日本語化とか)

Debian

sudo

# apt update
# apt install sudo

日本語化関連

# apt install locales-all
# dpkg-reconfigure locales
# apt install task-japanese-desktop
# apt install ibus-anthy

Settings の国際化のところで、Japanese(anthy) を足したり、インプットメソッドの設定をしたり

日本語化とは関係のないツール類のインストールとか設定とか

$ sudo apt install xsel
$ sudo apt install peco
$ sudo apt install jq
$ cat >> ./bashrc

alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'