Long time, no commits

This commit is contained in:
Willem van den Ende
2021-03-21 21:03:22 +00:00
parent 3e1e5ec7e1
commit 84baf90147
7 changed files with 245 additions and 4 deletions
@@ -0,0 +1,55 @@
# key: __codebuild.json
# name: AWS CodeBuild json config
# --
{
"name": "$1",
"arn": "arn:aws:codebuild:eu-central-1:123456789012:project/$2"
"description": "$3",
"source": {
"type": "CODEPIPELINE",
"insecureSsl": false
},
"secondarySourceVersions": [],
"artifacts": {
"type": "CODEPIPELINE",
"name": "$4",
"packaging": "NONE",
"encryptionDisabled": false
},
"cache": {
"type": "NO_CACHE"
},
"environment": {
"type": "LINUX_CONTAINER",
"image": "aws/codebuild/standard:5.0",
"computeType": "BUILD_GENERAL1_SMALL",
"environmentVariables": [
{
"name": "AWS_DEFAULT_REGION",
"value": "eu-central-1",
"type": "PLAINTEXT"
}
],
"privilegedMode": true,
"imagePullCredentialsType": "CODEBUILD"
},
"serviceRole": "arn:aws:iam::123456789012:role/ExampleCodeBuildServiceRole",
"timeoutInMinutes": 60,
"queuedTimeoutInMinutes": 480,
"encryptionKey": "arn:aws:kms:eu-central-1:123456789012:alias/aws/s3",
"tags": [$5],
"badge": {
"badgeEnabled": false
},
"logsConfig": {
"cloudWatchLogs": {
"status": "ENABLED"
},
"s3Logs": {
"status": "DISABLED",
"encryptionDisabled": false
}
},
"fileSystemLocations": [],
"concurrentBuildLimit": 1
}
+55
View File
@@ -0,0 +1,55 @@
# key: __codebuild.json
# name: AWS CodeBuild json config
# --
{
"name": "course-vendingmachine-cs",
"arn": "arn:aws:codebuild:eu-central-1:123456789012:project/$1"
"description": "$2",
"source": {
"type": "CODEPIPELINE",
"insecureSsl": false
},
"secondarySourceVersions": [],
"artifacts": {
"type": "CODEPIPELINE",
"name": "$3",
"packaging": "NONE",
"encryptionDisabled": false
},
"cache": {
"type": "NO_CACHE"
},
"environment": {
"type": "LINUX_CONTAINER",
"image": "aws/codebuild/standard:5.0",
"computeType": "BUILD_GENERAL1_SMALL",
"environmentVariables": [
{
"name": "AWS_DEFAULT_REGION",
"value": "eu-central-1",
"type": "PLAINTEXT"
}
],
"privilegedMode": true,
"imagePullCredentialsType": "CODEBUILD"
},
"serviceRole": "arn:aws:iam::123456789012:role/ExampleCodeBuildServiceRole",
"timeoutInMinutes": 60,
"queuedTimeoutInMinutes": 480,
"encryptionKey": "arn:aws:kms:eu-central-1:123456789012:alias/aws/s3",
"tags": [$4],
"badge": {
"badgeEnabled": false
},
"logsConfig": {
"cloudWatchLogs": {
"status": "ENABLED"
},
"s3Logs": {
"status": "DISABLED",
"encryptionDisabled": false
}
},
"fileSystemLocations": [],
"concurrentBuildLimit": 1
}
+12
View File
@@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# name: jekyll blog post
# key: jekyll_post
# --
---
layout: post
title: $0
tags:
- $1
author: Willem van den Ende
image: $2
---
+28
View File
@@ -0,0 +1,28 @@
# -*- mode: yaml -*-
# name: AWS CodeBuild buildspec
# key: buildspec
# --
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.eu-central-1.amazonaws.com
- REPOSITORY_URI=123456789012.dkr.ecr.eu-central-1.amazonaws.com/example/$1
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG