-
Notifications
You must be signed in to change notification settings - Fork 0
/
ops.yml
56 lines (56 loc) · 2.25 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
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
- 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:[email protected]/$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/$REPO
- docker build -f Dockerfile -t $AWS_ACCOUNT_NUMBER.dkr.ecr.$AWS_REGION.amazonaws.com/$REPO-$STACK_TYPE:$REF .
- docker push $AWS_ACCOUNT_NUMBER.dkr.ecr.$AWS_REGION.amazonaws.com/$REPO-$STACK_TYPE:$REF
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