Skip to content

Commit 2d91d9f

Browse files
committed
🔬 Add continuous integration
1 parent 364be9f commit 2d91d9f

2 files changed

Lines changed: 104 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: docker:git
6+
steps:
7+
- checkout
8+
- setup_remote_docker
9+
- run:
10+
name: Create Docker volumes
11+
command: |
12+
docker create --name input --volume /home/builder/package alpine:3.7 /bin/true
13+
docker create --name output --volume /packages alpine:3.7 /bin/true
14+
- run:
15+
name: Copy build files into Docker volume
16+
command: |
17+
docker cp ./ input:/home/builder/package/
18+
- run:
19+
name: Build packages
20+
command: |
21+
docker run --env RSA_PRIVATE_KEY="$RSA_PRIVATE_KEY" --env RSA_PRIVATE_KEY_NAME="sgerrand.rsa" \
22+
--volumes-from input --volumes-from output sgerrand/alpine-abuild:v6
23+
- run:
24+
name: Extract packages
25+
command: |
26+
mkdir -p packages
27+
docker cp output:/packages/builder packages/
28+
- run:
29+
name: Test installing packages
30+
command: |
31+
wget -P /etc/apk/keys/ https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
32+
apk add --no-progress --update-cache --upgrade ./packages/builder/x86_64/php5-*.apk
33+
- run:
34+
name: Test executable
35+
command: |
36+
php5 --info
37+
- run:
38+
name: Remove Docker volumes
39+
command: |
40+
docker rm input
41+
docker rm output
42+
when: always
43+
- store_artifacts:
44+
destination: pkgs
45+
path: packages
46+
- persist_to_workspace:
47+
root: .
48+
paths:
49+
- packages
50+
working_directory: ~/alpine-pkg-php5
51+
release-master:
52+
docker:
53+
- image: golang:alpine
54+
steps:
55+
- attach_workspace:
56+
at: .
57+
- run: apk add --no-cache --no-progress git
58+
- run: go get github.com/tcnksm/ghr
59+
- run:
60+
name: Release packages
61+
command: |
62+
ghr -u sgerrand -r $CIRCLE_PROJECT_REPONAME -prerelease -delete unreleased packages
63+
ghr -u sgerrand -r $CIRCLE_PROJECT_REPONAME -prerelease unreleased packages/builder/x86_64
64+
working_directory: ~/alpine-pkg-php5
65+
release-tag:
66+
docker:
67+
- image: golang:alpine
68+
steps:
69+
- attach_workspace:
70+
at: .
71+
- run: apk add --no-cache --no-progress git
72+
- run: go get github.com/tcnksm/ghr
73+
- run:
74+
name: Release packages
75+
command: |
76+
ghr -u sgerrand -r $CIRCLE_PROJECT_REPONAME $CIRCLE_TAG packages
77+
ghr -u sgerrand -r $CIRCLE_PROJECT_REPONAME $CIRCLE_TAG packages/builder/x86_64
78+
working_directory: ~/alpine-pkg-php5
79+
workflows:
80+
version: 2
81+
build-test-release:
82+
jobs:
83+
- build:
84+
filters:
85+
tags:
86+
only: /.*/
87+
- release-master:
88+
requires:
89+
- build
90+
filters:
91+
branches:
92+
only: master
93+
tags:
94+
ignore: /.*/
95+
- release-tag:
96+
requires:
97+
- build
98+
filters:
99+
branches:
100+
ignore: /.*/
101+
tags:
102+
only: /[0-9]+(\.[0-9]+){1,2}(\-r\d+)?$/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# alpine-pkg-php5
22

3+
[![CircleCI](https://img.shields.io/circleci/project/sgerrand/alpine-pkg-php5/master.svg)](https://circleci.com/gh/sgerrand/alpine-pkg-php5)
4+
35
This is the [PHP 5][php] language runtime engine as an Alpine Linux package. It includes a patch for a [NaN bug][php-nan-bug] with [musl libc][musl].
46

57
[musl]: http://www.musl-libc.org/

0 commit comments

Comments
 (0)