Skip to content

Commit d9d452f

Browse files
committed
old
1 parent 235b3b2 commit d9d452f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+812
-582
lines changed

copilot-darwin-v1.5.0

-45.1 MB
Binary file not shown.

copilot/api/manifest.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The manifest for the "api" service.
2+
# Read the full specification for the "Backend Service" type at:
3+
# https://aws.github.io/copilot-cli/docs/manifest/backend-service/
4+
5+
# Your service name will be used in naming your resources like log groups, ECS services, etc.
6+
name: api
7+
type: Backend Service
8+
9+
# Your service does not allow any traffic.
10+
11+
# Configuration for your containers and service.
12+
image:
13+
location: public.ecr.aws/nginx/nginx:stable
14+
port: 80
15+
16+
cpu: 256 # Number of CPU units for the task.
17+
memory: 512 # Amount of memory in MiB used by the task.
18+
count: 1 # Number of tasks that should be running in your service.
19+
exec: true # Enable running commands in your container.
20+
21+
http:
22+
path: "/"
23+
healthcheck:
24+
grace_period: 0s

copilot/deleteme/manifest.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The manifest for the "deleteme" service.
2+
# Read the full specification for the "Load Balanced Web Service" type at:
3+
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
4+
5+
# Your service name will be used in naming your resources like log groups, ECS services, etc.
6+
name: deleteme
7+
type: Load Balanced Web Service
8+
9+
# Distribute traffic to your service.
10+
http:
11+
# Requests to this path will be forwarded to your service.
12+
# To match all requests you can use the "/" path.
13+
path: '/'
14+
# You can specify a custom health check path. The default is "/".
15+
# healthcheck: '/'
16+
17+
# Configuration for your containers and service.
18+
image:
19+
# Docker build arguments. For additional overrides: https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#image-build
20+
build: e2eencrypt/Dockerfile-app
21+
# Port exposed through your container to route traffic to it.
22+
port: 8080
23+
24+
cpu: 256 # Number of CPU units for the task.
25+
memory: 512 # Amount of memory in MiB used by the task.
26+
count: 1 # Number of tasks that should be running in your service.
27+
exec: true # Enable running commands in your container.
28+
29+
# Optional fields for more advanced use-cases.
30+
#
31+
#variables: # Pass environment variables as key value pairs.
32+
# LOG_LEVEL: info
33+
34+
#secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
35+
# GITHUB_TOKEN: GITHUB_TOKEN # The key is the name of the environment variable, the value is the name of the SSM parameter.
36+
37+
# You can override any of the values defined above by environment.
38+
#environments:
39+
# test:
40+
# count: 2 # Number of tasks to run for the "test" environment.
41+
# deployment: # The deployment strategy for the "test" environment.
42+
# rolling: 'recreate' # Stops existing tasks before new ones are started for faster deployments.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The manifest for the "prod" environment.
2+
# Read the full specification for the "Environment" type at:
3+
# https://aws.github.io/copilot-cli/docs/manifest/environment/
4+
5+
# Your environment name will be used in naming your resources like VPC, cluster, etc.
6+
name: prod
7+
type: Environment
8+
9+
# Import your own VPC and subnets or configure how they should be created.
10+
# network:
11+
# vpc:
12+
# id:
13+
14+
# Configure the load balancers in your environment, once created.
15+
# http:
16+
# public:
17+
# private:
18+
19+
# Configure observability for your environment resources.
20+
observability:
21+
container_insights: false
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# The manifest for the "test" environment.
2+
# Read the full specification for the "Environment" type at:
3+
# https://aws.github.io/copilot-cli/docs/manifest/environment/
4+
5+
# Your environment name will be used in naming your resources like VPC, cluster, etc.
6+
name: test
7+
type: Environment
8+
9+
# Import your own VPC and subnets or configure how they should be created.
10+
# network:
11+
# vpc:
12+
# id:
13+
14+
# Configure the load balancers in your environment, once created.
15+
http:
16+
public:
17+
certificates:
18+
- arn:aws:acm:us-west-2:615288112214:certificate/81b37947-5325-4b19-9a8f-f42022699862
19+
20+
# Configure observability for your environment resources.
21+
observability:
22+
container_insights: false

copilot/frontend/manifest.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# The manifest for the "frontend" service.
2+
# Read the full specification for the "Load Balanced Web Service" type at:
3+
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
4+
5+
# Your service name will be used in naming your resources like log groups, ECS services, etc.
6+
name: frontend
7+
type: Load Balanced Web Service
8+
9+
# Distribute traffic to your service.
10+
http:
11+
alias: "coolblackbird.de"
12+
path: "/"
13+
healthcheck:
14+
path: "/service"
15+
target_container: "envoy"
16+
17+
# Configuration for your containers and service.
18+
image:
19+
build: "./e2eencrypt/Dockerfile-app"
20+
port: 8080
21+
22+
sidecars:
23+
envoy:
24+
port: 443
25+
image: "615288112214.dkr.ecr.us-west-2.amazonaws.com/demo/envoy-proxy:v2"
26+
27+
cpu: 256 # Number of CPU units for the task.
28+
memory: 512 # Amount of memory in MiB used by the task.
29+
count: 1 # Number of tasks that should be running in your service.
30+
exec: true # Enable running commands in your container.
31+
32+
# Optional fields for more advanced use-cases.
33+
#
34+
variables: # Pass environment variables as key value pairs.
35+
LOG_LEVEL: info
36+
#secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
37+
# GITHUB_TOKEN: GITHUB_TOKEN # The key is the name of the environment variable, the value is the name of the SSM parameter.
38+
39+
# You can override any of the values defined above by environment.
40+
#environments:
41+
# test:
42+
# count: 2 # Number of tasks to run for the "test" environment.
43+
# deployment: # The deployment strategy for the "test" environment.
44+
# rolling: 'recreate' # Stops existing tasks before new ones are started for faster deployments.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Buildspec runs in the build stage of your pipeline.
2+
version: 0.2
3+
phases:
4+
install:
5+
runtime-versions:
6+
docker: 19
7+
ruby: 2.6
8+
commands:
9+
- echo "cd into $CODEBUILD_SRC_DIR"
10+
- cd $CODEBUILD_SRC_DIR
11+
# Download the copilot linux binary.
12+
- wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.21.0-8-gf3c4e78f
13+
- mv ./copilot-linux-v1.21.0-8-gf3c4e78f ./copilot-linux
14+
- chmod +x ./copilot-linux
15+
build:
16+
commands:
17+
- echo "Run your tests"
18+
# - make test
19+
post_build:
20+
commands:
21+
- ls -l
22+
- export COLOR="false"
23+
- pipeline=$(cat $CODEBUILD_SRC_DIR/copilot/pipelines/copilot-pipeline-test-main/manifest.yml | ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))')
24+
- pl_envs=$(echo $pipeline | jq -r '.stages[].name')
25+
# Find all the local services in the workspace.
26+
- svc_ls_result=$(./copilot-linux svc ls --local --json)
27+
- svc_list=$(echo $svc_ls_result | jq '.services')
28+
- >
29+
if [ ! "$svc_list" = null ]; then
30+
svcs=$(echo $svc_ls_result | jq -r '.services[].name');
31+
fi
32+
# Find all the local jobs in the workspace.
33+
- job_ls_result=$(./copilot-linux job ls --local --json)
34+
- job_list=$(echo $job_ls_result | jq '.jobs')
35+
- >
36+
if [ ! "$job_list" = null ]; then
37+
jobs=$(echo $job_ls_result | jq -r '.jobs[].name');
38+
fi
39+
# Raise error if no services or jobs are found.
40+
- >
41+
if [ "$svc_list" = null ] && [ "$job_list" = null ]; then
42+
echo "No services or jobs found for the pipeline to deploy. Please create at least one service or job and push the manifest to the remote." 1>&2;
43+
exit 1;
44+
fi
45+
# Generate the cloudformation templates.
46+
# The tag is the build ID but we replaced the colon ':' with a dash '-'.
47+
# We truncate the tag (from the front) to 128 characters, the limit for Docker tags
48+
# (https://docs.docker.com/engine/reference/commandline/tag/)
49+
# Check if the `svc package` commanded exited with a non-zero status. If so, echo error msg and exit.
50+
- >
51+
for env in $pl_envs; do
52+
tag=$(sed 's/:/-/g' <<<"${CODEBUILD_BUILD_ID##*:}-${env}" | rev | cut -c 1-128 | rev)
53+
for svc in $svcs; do
54+
./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag --upload-assets;
55+
if [ $? -ne 0 ]; then
56+
echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
57+
exit 1;
58+
fi
59+
done;
60+
for job in $jobs; do
61+
./copilot-linux job package -n $job -e $env --output-dir './infrastructure' --tag $tag --upload-assets;
62+
if [ $? -ne 0 ]; then
63+
echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
64+
exit 1;
65+
fi
66+
done;
67+
done;
68+
- ls -lah ./infrastructure
69+
artifacts:
70+
files:
71+
- "infrastructure/*"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# The manifest for the "copilot-pipeline-test-main" pipeline.
2+
# This YAML file defines your pipeline: the source repository it tracks and the order of the environments to deploy to.
3+
# For more info: https://aws.github.io/copilot-cli/docs/manifest/pipeline/
4+
5+
# The name of the pipeline.
6+
name: copilot-pipeline-test-main
7+
8+
# The version of the schema used in this template.
9+
version: 1
10+
11+
# This section defines your source, changes to which trigger your pipeline.
12+
source:
13+
# The name of the provider that is used to store the source artifacts.
14+
# (i.e. GitHub, Bitbucket, CodeCommit)
15+
provider: GitHub
16+
# Additional properties that further specify the location of the artifacts.
17+
properties:
18+
branch: main
19+
repository: https://github.com/efekarakus/copilot-pipeline-test
20+
# Optional: specify the name of an existing CodeStar Connections connection.
21+
# connection_name: a-connection
22+
23+
# This section defines the order of the environments your pipeline will deploy to.
24+
stages:
25+
- # The name of the environment.
26+
name: test
27+
# Optional: flag for manual approval action before deployment.
28+
# requires_approval: true
29+
# Optional: use test commands to validate this stage of your build.
30+
# test_commands: [echo 'running tests', make test]
31+
32+
- # The name of the environment.
33+
name: prod
34+
# Optional: flag for manual approval action before deployment.
35+
# requires_approval: true
36+
# Optional: use test commands to validate this stage of your build.
37+
# test_commands: [echo 'running tests', make test]
38+

e2eencrypt/Dockerfile-app

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM envoyproxy/envoy-alpine-dev:latest
2+
3+
RUN apk update && apk add python3 bash curl;
4+
RUN python3 -m ensurepip
5+
RUN pip3 install --no-cache --upgrade pip setuptools
6+
RUN pip install -U Flask
7+
RUN mkdir /code
8+
9+
ADD ./service.py /code
10+
11+
EXPOSE 8080
12+
13+
CMD ["python3", "/code/service.py"]

e2eencrypt/Dockerfile-proxy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM envoyproxy/envoy-dev:0422f644228968a2af2383fd0b917b146976759c
2+
3+
RUN mkdir -p /etc/ssl
4+
ADD start_envoy.sh /start_envoy.sh
5+
ADD envoy.yaml /etc/envoy.yaml
6+
ADD certs /etc/ssl/
7+
8+
RUN chmod +x /start_envoy.sh
9+
10+
ENTRYPOINT ["/bin/sh"]
11+
EXPOSE 443
12+
CMD ["start_envoy.sh"]

0 commit comments

Comments
 (0)