Skip to content

Commit

Permalink
fix: konfiguroi lisää muistia buildeihin, jotta ne menevät läpi
Browse files Browse the repository at this point in the history
  • Loading branch information
haapamakim committed Jan 30, 2023
1 parent af78a4b commit 0329221
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 7 deletions.
51 changes: 51 additions & 0 deletions deployment/lib/buildspec/buildspec-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 0.2

env:
parameter-store:
SKIP_VELHO_TESTS: /SkipVelhoTests
ROCKET_CHAT_TOKEN: /RocketChatToken
ROCKET_CHAT_USER_ID: /RocketChatUserId
SONARQUBE_HOST_URL: /SonarQubeHostURL
SONARQUBE_ACCESS_TOKEN: /SonarQubeAccessToken
secrets-manager:
GITHUB_TOKEN: github-token

phases:
install:
commands:
- aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 283563576583.dkr.ecr.eu-west-1.amazonaws.com
- nohup /usr/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 &
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
- nohup docker pull 283563576583.dkr.ecr.eu-west-1.amazonaws.com/localstack:1.3 &

- mv /packages/tools/velho/.gradle /tools/velho/
- mv /packages/tools/velho/buildSrc/.gradle /tools/velho/buildSrc/

- touch .env.test
- npm ci
- npm run buildimage:generate
build:
commands:
- npm run lint
- npm run localstack
- npm run setupenvironment
- npm run test
- npm run localstack:stop &
- npm run sonar
- npm run deploy:database
- npm run deploy:backend
- npm run deploy:frontend
- npm run deploy:monitoring
- npm run deploy:stackpolicies
- npm run opensearch:delete-index
- npm run opensearch:index
- aws codebuild start-build --project-name Hassu-build-e2e-$ENVIRONMENT --source-version $CODEBUILD_SOURCE_VERSION
post_build:
on-failure: ABORT
commands:
- ./deployment/bin/reportBuildStatus.sh -t "$ROCKET_CHAT_TOKEN" -u "$ROCKET_CHAT_USER_ID" -r "$CODEBUILD_BUILD_SUCCEEDING" -m "$ENVIRONMENT build" -d "CodeBuild $CODEBUILD_BUILD_URL"
cache:
paths:
- "/root/.cache/**/*"
- "/root/.npm/**/*"
- "/root/.sonar"
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ phases:
- ./deployment/bin/checkoutBranch.sh
- touch .env.test
- npm ci
- fg || true
- npm run buildimage:generate
build:
commands:
Expand All @@ -34,7 +33,6 @@ phases:
- npm run setupenvironment
- npm run test
- npm run localstack:stop &
- npm run sonar
- npm run deploy:database
- npm run deploy:backend
- npm run deploy:frontend
Expand Down
1 change: 0 additions & 1 deletion deployment/lib/buildspec/buildspec-training.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ phases:
- npm run setupenvironment
- npm run test
- npm run localstack:stop &
- npm run sonar
- npm run maintenancemode set
- npm run deploy:database
- npm run deploy:backend
Expand Down
18 changes: 14 additions & 4 deletions deployment/lib/hassu-pipelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ export type PipelineStackOutputs = {

const pipelines: Record<
string,
{ name: string; buildspec: string; env: string; webhookBranches?: string[]; branch?: string; concurrentBuildLimit?: number }[]
{
name: string;
buildspec: string;
env: string;
webhookBranches?: string[];
branch?: string;
concurrentBuildLimit?: number;
computeType?: ComputeType;
}[]
> = {
dev: [
{
Expand All @@ -45,16 +53,17 @@ const pipelines: Record<
env: "dev",
branch: "main",
webhookBranches: ["main"],
buildspec: "./deployment/lib/buildspec/buildspec.yml",
buildspec: "./deployment/lib/buildspec/buildspec-dev.yml",
concurrentBuildLimit: 1,
},
{
name: "test",
env: "test",
branch: "test",
webhookBranches: ["test"],
buildspec: "./deployment/lib/buildspec/buildspec.yml",
buildspec: "./deployment/lib/buildspec/buildspec-test.yml",
concurrentBuildLimit: 1,
computeType: ComputeType.LARGE,
},
{
name: "training",
Expand All @@ -63,6 +72,7 @@ const pipelines: Record<
webhookBranches: ["training"],
buildspec: "./deployment/lib/buildspec/buildspec-training.yml",
concurrentBuildLimit: 1,
computeType: ComputeType.LARGE,
},
{
name: "e2e-dev",
Expand Down Expand Up @@ -258,7 +268,7 @@ export class HassuPipelineStack extends Stack {
environment: {
buildImage,
privileged: true,
computeType: ComputeType.MEDIUM,
computeType: pipelineConfig.computeType || ComputeType.MEDIUM,
environmentVariables,
},
grantReportGroupPermissions: true,
Expand Down

0 comments on commit 0329221

Please sign in to comment.