-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitpod.yml
43 lines (40 loc) · 2.12 KB
/
.gitpod.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
# Commands to start on workspace startup
tasks:
- name: ECR aws upload
before: pip install awscli
init: |
echo "this is command history help push to ECR"
echo "you need to run aws configure first"
export awsRegion="ap-east-1"
export awsID="421484303838"
export ecrID="w3s2d0z8"
export awsName=`basename $(pwd)`
aws ecr create-repository --repository-name ${awsName} --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE
aws ecr get-login-password --region ${awsRegion} | docker login --username AWS --password-stdin ${awsID}.dkr.ecr.${awsRegion}.amazonaws.com
docker tag local_docker:latest ${awsID}.dkr.ecr.${awsRegion}.amazonaws.com/${awsName}:latest && docker push ${awsID}.dkr.ecr.${awsRegion}.amazonaws.com/${awsName}:latest
- name: Local Build Docker
before: sudo apt-get install -y httpie
init: |
sudo docker build -t local_docker:latest .
sudo docker run -d --name local_docker -p 8080:8080 local_docker:latest
command: |
sudo docker restart local_docker &> /dev/null
http POST "http://127.0.0.1:8080/2015-03-31/functions/function/invocations" browser="webkit" device="random" run="await page.goto('http://whatsmyuseragent.org/',wait_until='commit');result=await page.content()"
docker logs --since=2m local_docker
- name: Remote Pull Docker
init: |
sudo docker pull public.ecr.aws/w3s2d0z8/`basename $(pwd)`:main
docker tag public.ecr.aws/w3s2d0z8/`basename $(pwd)`:main remote_docker:latest
sudo docker run -d --name remote_docker -p 9000:8080 remote_docker:latest
command: |
sudo docker restart remote_docker &> /dev/null
http POST "http://127.0.0.1:9000/2015-03-31/functions/function/invocations" browser="webkit" device="random" run="await page.goto('http://whatsmyuseragent.org/',wait_until='commit');result=await page.content()"
docker logs --since=2m remote_docker
# Ports to expose on workspace startup
ports:
- port: 8080
onOpen: notify
name: docker local
- port: 9000
onOpen: notify
name: docker remote