Skip to content

Commit 6863bc5

Browse files
authored
Merge pull request #42 from 3scale-labs/migrate-circleci
migrate circleci
2 parents 344c1df + 05cb351 commit 6863bc5

4 files changed

Lines changed: 85 additions & 49 deletions

File tree

.circleci/config.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
version: 2.1
2+
3+
##################################### YAML ANCHORS ############################################
4+
5+
tag-trigger: &tag-trigger
6+
tags:
7+
only: /^v.*/
8+
9+
jobs:
10+
ubuntu-build:
11+
docker:
12+
- image: ubuntu:20.04
13+
steps:
14+
- checkout
15+
- run:
16+
name: Install Ubuntu 20.04 deps
17+
command: |
18+
apt update && apt install -y git ruby ruby-dev libffi-dev build-essential
19+
- run:
20+
name: Ubuntu 20.04 package
21+
command: |
22+
./build.sh
23+
- persist_to_workspace:
24+
root: ./pkg
25+
paths:
26+
- "*.deb"
27+
28+
centos-build:
29+
docker:
30+
- image: centos/ruby-27-centos7
31+
user: root
32+
steps:
33+
- run:
34+
name: Install Centos7 deps
35+
command: |
36+
yum -y install rpm-build yajl yajl-devel
37+
- run:
38+
# builtin checkout does not work with root user,
39+
# ssh fingerprint prompt screws up the job
40+
name: Manual checkout
41+
command: |
42+
git clone https://github.com/3scale-labs/3scale_toolbox_packaging.git .
43+
if [ -n "$CIRCLE_TAG" ]; then
44+
git checkout --force "$CIRCLE_TAG"
45+
else
46+
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
47+
fi
48+
- run:
49+
name: Centos7 package
50+
command: |
51+
./build.sh
52+
- persist_to_workspace:
53+
root: ./pkg
54+
paths:
55+
- "*.rpm"
56+
57+
publish-github-release:
58+
docker:
59+
- image: cibuilds/github:0.10
60+
steps:
61+
- attach_workspace:
62+
at: ./artifacts
63+
- run:
64+
name: "Publish Release on GitHub"
65+
command: |
66+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./artifacts/
67+
68+
workflows:
69+
version: 2
70+
build:
71+
jobs:
72+
- ubuntu-build:
73+
filters:
74+
<<: *tag-trigger
75+
- centos-build:
76+
filters:
77+
<<: *tag-trigger
78+
- publish-github-release:
79+
requires:
80+
- ubuntu-build
81+
- centos-build
82+
filters:
83+
<<: *tag-trigger
84+
branches:
85+
ignore: /.*/

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

native.sh renamed to build.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ set -o errexit
33
set -o nounset
44
set -o xtrace
55

6-
DOCKER_IMAGE="${DOCKER_IMAGE:-}"
7-
8-
if [ "${DOCKER_IMAGE}" = "centos/ruby-27-centos7" ]
9-
then
10-
yum -y install rpm-build yajl yajl-devel
11-
elif [ "${DOCKER_IMAGE}" = "ubuntu:20.04" ]
12-
then
13-
apt update
14-
apt install -y git ruby ruby-dev libffi-dev build-essential
15-
fi
16-
176
# Since secure_path is set on our CentOS build images, we also need to ensure
187
# we only use absolute paths when referencing the binaries we want to run.
198
GEM="$(command -v gem)"

docker.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)