Skip to content

Commit

Permalink
Merge branch 'main' into ARC-110
Browse files Browse the repository at this point in the history
  • Loading branch information
James Crowley authored Apr 17, 2024
2 parents f2a9983 + b354553 commit 3cc2031
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
run: |
export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
export ENVIRONMENT=poc
export DOCKERHUB_USERNAME=${{ secrets.SF_ARCH_DOCKERHUB_USERNAME }}
export DOCKERHUB_PASSWORD=${{ secrets.SF_ARCH_DOCKERHUB_PASSWORD }}
./scripts/docker-build-tag-and-push.sh
Expand Down Expand Up @@ -75,5 +77,8 @@ jobs:
- name: Build, Tag, and Push
run: |
export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
export ENVIRONMENT=prod
export ENVIRONMENT=poc
export DOCKERHUB_USERNAME=${{ secrets.SF_ARCH_DOCKERHUB_USERNAME }}
export DOCKERHUB_PASSWORD=${{ secrets.SF_ARCH_DOCKERHUB_PASSWORD }}
./scripts/docker-build-tag-and-push.sh
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

lerna run test:ci
lerna run lint && lerna run test:ci
15 changes: 0 additions & 15 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ catalog:
rules:
- allow: [ Template ]

- type: url
target: https://github.com/sourcefuse/sf-software-templates/blob/main/scaffolder-templates/react-boilerplate/template.yaml
rules:
- allow: [ Template ]

- type: url
target: https://github.com/sourcefuse/sf-software-templates/blob/main/scaffolder-templates/terraform-aws-ref-arch-bootstrap/template.yaml
rules:
- allow: [ Template ]

- type: url
target: https://github.com/sourcefuse/sf-software-templates/blob/main/scaffolder-templates/microservice-repo-bootstrap/template.yaml
rules:
Expand Down Expand Up @@ -161,11 +151,6 @@ catalog:
- allow: [ Component ]
tags: [ Backend ]

- type: url
target: https://github.com/sourcefuse/terraform-aws-ref-arch-bootstrap/blob/main/catalog-info.yaml
rules:
- allow: [ Component ]

- type: url
target: https://github.com/sourcefuse/terraform-aws-arc-db/blob/main/catalog-info.yaml
rules:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.4'
services:
backstage:
container_name: backstage_container
image: sourcefuse/sourcefuse-backstage
image: sourcefuse/backstage
build: .
environment:
ENVIRONMENT: production
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"packages": ["packages/*", "plugins/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.1.0"
}
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
"create-plugin": "backstage-cli create-plugin --scope internal",
"remove-plugin": "backstage-cli remove-plugin",
"setup-hooks": "husky install",
"new": "backstage-cli new --scope internal"
"new": "backstage-cli new --scope internal",
"infra:init": "cd terraform && terraform init",
"infra:plan": "cd terraform && terraform plan",
"infra:apply": "cd terraform && terraform apply",
"infra:destroy": "cd terraform && terraform destroy",
"prepare": "husky install"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -61,5 +66,12 @@
"path": "cz-format-extension"
}
},
"husky": {
"hooks": {
"pre-commit": "npm run lint:all && npm run test:all",
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"dependencies": {}
}
1 change: 1 addition & 0 deletions packages/backend/src/plugins/scaffolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createExtensionAction } from './sourceloop-extension';
import { createMicroserviceAction } from './sourceloop-ms';
import { createScaffoldAction } from './sourceloop-scaffold';
// import { DockerContainerRunner } from '@backstage/backend-common';
// eslint-disable-next-line @backstage/no-undeclared-imports
import { ScmIntegrations } from '@backstage/integration';
import { createNewFileAction } from './create-new-file.action';

Expand Down
28 changes: 13 additions & 15 deletions scripts/docker-build-tag-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@

set -e

# optional
: "${AWS_REGION:=us-east-1}"
# Optional
: "${DOCKER_COMPOSE_FILE:=./docker-compose.yml}"
: "${ENVIRONMENT:=poc}"

## required
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
# Required
: "${DOCKER_USERNAME:=$DOCKERHUB_USERNAME}"
: "${DOCKER_PASSWORD:=$DOCKERHUB_PASSWORD}"
: "${IMAGE_TAG:-$IMAGE_TAG}"

ECR_REGISTRY_ENDPOINT="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com"
IMAGE_NAME="$ECR_REGISTRY_ENDPOINT/sourcefuse-backstage"
DOCKERHUB_REGISTRY="docker.io"
IMAGE_NAME="$DOCKERHUB_REGISTRY/$DOCKER_USERNAME/backstage"

echo "Account: $AWS_ACCOUNT_ID"
echo "Docker Registry: $DOCKERHUB_REGISTRY ...\n"

printf "\nLogging in to Docker Hub... -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ImangeName $IMAGE_NAME Imagetag $IMAGE_TAG ...\n"
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"

printf "\nECR Login...\n"
aws ecr get-login-password \
--region $AWS_REGION \
| docker login \
--username AWS \
--password-stdin $ECR_REGISTRY_ENDPOINT

printf "\nBuilding docker images...\n"
docker-compose -f $DOCKER_COMPOSE_FILE build

printf "\nTagging image $IMAGE_NAME:$IMAGE_TAG...\n"
docker tag sourcefuse/sourcefuse-backstage:latest $IMAGE_NAME:$IMAGE_TAG
docker images
docker tag sourcefuse/backstage:latest $IMAGE_NAME:$IMAGE_TAG

printf "\nPushing $IMAGE_NAME:$IMAGE_TAG to ECR...\n"
printf "\nPushing $IMAGE_NAME:$IMAGE_TAG to Docker Hub...\n"
docker push $IMAGE_NAME:$IMAGE_TAG

printf "\nAdding $IMAGE_NAME:$IMAGE_TAG to SSM Parameter...\n"
Expand Down

0 comments on commit 3cc2031

Please sign in to comment.