-
Notifications
You must be signed in to change notification settings - Fork 2
/
ops.yml
83 lines (83 loc) · 3.24 KB
/
ops.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: "1"
pipelines:
- name: sample-expressjs-pipeline-aws-eks-ec2-asg-cdk:0.1.3
description: build a release for deployment
env:
static:
- DEBIAN_FRONTEND=noninteractive
- ORG=workflows-sh
- REPO=sample-expressjs-aws-eks-ec2-asg-cdk
- ECR_REPO=sample-expressjs-app
- AWS_REGION=us-west-1
- STACK_TYPE=aws-eks-ec2-asg-cdk
secrets:
- GITHUB_TOKEN
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ACCOUNT_NUMBER
events:
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.merged"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.opened"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.synchronize"
jobs:
- name: sample-expressjs-build-job-aws-eks-ec2-asg-cdk
description: sample-expressjs build step
packages:
- git
- unzip
- python
steps:
- curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.18.200.zip -o awscli-bundle.zip
- unzip awscli-bundle.zip && ./awscli-bundle/install -b ~/bin/aws
- export PATH=~/bin:$PATH
- aws --version
- git clone https://oauth2:$GITHUB_TOKEN@github.com/$ORG/$REPO
- cd $REPO && ls -asl
- git fetch && git checkout $REF
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_NUMBER.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPO
- docker build -f Dockerfile -t $AWS_ACCOUNT_NUMBER.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPO-$STACK_TYPE:$REF .
- docker push $AWS_ACCOUNT_NUMBER.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPO-$STACK_TYPE:$REF
- name: sample-expressjs-test-aws-eks-ec2-asg-cdk:0.1.4
description: run tests
env:
static:
- DEBIAN_FRONTEND=noninteractive
- ORG=workflows-sh
- REPO=sample-expressjs-aws-eks-ec2-asg-cdk
- ECR_REPO=sample-expressjs-app
secrets:
- GITHUB_TOKEN
events:
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.merged"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.opened"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.synchronize"
jobs:
- name: sample-expressjs-test-job-aws-eks-ec2-asg-cdk
description: sample-expressjs test step
packages:
- git
- npm
steps:
- git clone https://oauth2:$GITHUB_TOKEN@github.com/$ORG/$REPO
- cd $REPO && ls -asl
- git fetch && git checkout $REF
- npm i
- npm run test
services:
- name: sample-expressjs-service-aws-eks-ec2-asg-cdk:0.1.5
description: A sample expressjs service
run: node /ops/index.js
port: [ '8080:8080' ]
sdk: off
domain: ""
env:
static:
- PORT=8080
events:
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.merged"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.opened"
- "github:workflows-sh/sample-expressjs-aws-eks-ec2-asg-cdk:pull_request.synchronize"
trigger:
- build
- publish
- start