This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.sh
executable file
·113 lines (97 loc) · 3.09 KB
/
update.sh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
cat <<'EOS' > README.md
# codebuild-php-node
AWS CodeBuild Images for building PHP and Node applications
## Purpose
It is a CodeBuild custom image including PHP and Node.js runtime, based on [AWS CodeBuild curated Docker images](https://github.com/aws/aws-codebuild-docker-images).
The image is optimized for PHP and JavaScript Project, such as [roots/sage](https://github.com/roots/sage).
## Usage
Pre-build images are available on DockerHub.
- [shogo82148/codebuild-php-node](https://hub.docker.com/r/shogo82148/codebuild-php-node)
Docker Pull Command:
```bash
EOS
for STANDARD in 5.0 4.0 3.0
do
echo \# standard $STANDARD based >> README.md
for PHP in 8.0 7.4 7.3
do
for NODE in 16 14 12
do
(
echo docker pull shogo82148/codebuild-php-node:php$PHP-node$NODE-standard-$STANDARD >> README.md
cd "ubuntu/$STANDARD" && \
echo updating "php$PHP" "node$NODE" "standard-$STANDARD" >&2 && \
./update.pl "$PHP" "$NODE"
) || exit 1
done
done
echo >> README.md
done
for AL2 in 3.0 2.0
do
echo \# amazonlinux2-x86_64-amazonlinux2 $AL2 based >> README.md
for PHP in 8.0 7.4 7.3
do
for NODE in 16 14 12
do
(
echo docker pull shogo82148/codebuild-php-node:php$PHP-node$NODE-amazonlinux2-$AL2 >> README.md
cd "al2/$AL2" && \
echo updating "php$PHP" "node$NODE" "amazonlinux2-$AL2" >&2 && \
./update.pl "$PHP" "$NODE"
) || exit 1
done
done
echo >> README.md
done
cat <<'EOS' >> README.md
```
PHP 7.2 and older images are no longer maintained.
They remain in this repository as a reference for the contents of these images.
### An Example of CloudFormation Template for Creating CodeBuild Project
```yaml
CodeBuildProject:
Type: AWS::CodeBuild::Project
Properties:
Artifacts:
Type: NO_ARTIFACTS
Environment:
ComputeType: BUILD_GENERAL1_SMALL
Image: shogo82148/codebuild-php-node:php8.0-node16-standard-5.0
Type: LINUX_CONTAINER
ServiceRole: !GetAtt CodeBuildRole.Arn
Source:
Type: GITHUB
ReportBuildStatus: true
Location: https://github.com/shogo82148/codebuild-php-node
TimeoutInMinutes: 10
CodeBuildRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: codebuild.amazonaws.com
Action: "sts:AssumeRole"
Path: "/"
Policies:
- PolicyDocument:
Statement:
- Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- logs:DescribeLogStreams
Effect: Allow
Resource: arn:aws:logs:*:*:*
Version: 2012-10-17
PolicyName: cloudWatchLogsPolicy
```
## RELATED WORK
- https://github.com/aws/aws-codebuild-docker-images
- https://github.com/docker-library/php
- https://github.com/nodejs/docker-node
EOS