Skip to content

su-ntu-ctp/se-cohort4-module4-group3a

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

List your tools here:
AWS RDS, ECR, ECS, CircleCi, Postgresql, Docker 
# your final config.yml file content here at the end of the project
version: 2.1

orbs:
  aws-cli: circleci/[email protected]
  aws-ecr: circleci/[email protected]
  aws-ecs: circleci/[email protected]
  docker: circleci/[email protected]
  snyk: snyk/[email protected]

jobs:
  build:
    description: "build docker"
    docker:
      - image: cimg/openjdk:19.0.1
    steps:
      - checkout
      - run:
          name: Build
          command: mvn -B -DskipTests clean package
      - persist_to_workspace:
          root: .
          paths:
            - .
  test:
    description: "test springboot"
    docker:
      - image: cimg/openjdk:19.0.1
    steps:
      - checkout
      - run:
          name: Build
          command: mvn test

  scan:
    docker:
      - image: cimg/openjdk:19.0.1
    environment:
      IMAGE_NAME: devops
    steps:
      - checkout
      - setup_remote_docker
      - docker/check
      - run: docker build -t $IMAGE_NAME .
      - snyk/scan:
          docker-image-name: $IMAGE_NAME

workflows:
  simple_workflow:
    jobs:
      - build
      - test:
          requires:
            - build
      - scan:
          requires:
            - test 
      - aws-ecr/build_and_push_image:
          account_id: ${AWS_ACCOUNT_ID}
          auth:
            - aws-cli/setup:
                role_arn: arn:aws:iam::${AWS_ACCOUNT_ID}:role/oidc-ecr
                role_session_name: mysession@${ORGANIZATION_ID}
          dockerfile: Dockerfile
          repo: devops
          tag: latest
          filters:
            branches:
              only:
                - release
          requires:
            - test
      - aws-ecs/deploy-service-update:
          cluster-name: test
          family: test   ### name of the task definition (image URL)
          service-name: test
          requires:
            - aws-ecr/build_and_push_image

END

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published