Skip to content

Commit

Permalink
Merge pull request #42 from 3scale-labs/migrate-circleci
Browse files Browse the repository at this point in the history
migrate circleci
  • Loading branch information
eguzki authored Aug 25, 2021
2 parents 344c1df + 05cb351 commit 6863bc5
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 49 deletions.
85 changes: 85 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
version: 2.1

##################################### YAML ANCHORS ############################################

tag-trigger: &tag-trigger
tags:
only: /^v.*/

jobs:
ubuntu-build:
docker:
- image: ubuntu:20.04
steps:
- checkout
- run:
name: Install Ubuntu 20.04 deps
command: |
apt update && apt install -y git ruby ruby-dev libffi-dev build-essential
- run:
name: Ubuntu 20.04 package
command: |
./build.sh
- persist_to_workspace:
root: ./pkg
paths:
- "*.deb"

centos-build:
docker:
- image: centos/ruby-27-centos7
user: root
steps:
- run:
name: Install Centos7 deps
command: |
yum -y install rpm-build yajl yajl-devel
- run:
# builtin checkout does not work with root user,
# ssh fingerprint prompt screws up the job
name: Manual checkout
command: |
git clone https://github.com/3scale-labs/3scale_toolbox_packaging.git .
if [ -n "$CIRCLE_TAG" ]; then
git checkout --force "$CIRCLE_TAG"
else
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
fi
- run:
name: Centos7 package
command: |
./build.sh
- persist_to_workspace:
root: ./pkg
paths:
- "*.rpm"

publish-github-release:
docker:
- image: cibuilds/github:0.10
steps:
- attach_workspace:
at: ./artifacts
- run:
name: "Publish Release on GitHub"
command: |
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./artifacts/
workflows:
version: 2
build:
jobs:
- ubuntu-build:
filters:
<<: *tag-trigger
- centos-build:
filters:
<<: *tag-trigger
- publish-github-release:
requires:
- ubuntu-build
- centos-build
filters:
<<: *tag-trigger
branches:
ignore: /.*/
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

11 changes: 0 additions & 11 deletions native.sh → build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ set -o errexit
set -o nounset
set -o xtrace

DOCKER_IMAGE="${DOCKER_IMAGE:-}"

if [ "${DOCKER_IMAGE}" = "centos/ruby-27-centos7" ]
then
yum -y install rpm-build yajl yajl-devel
elif [ "${DOCKER_IMAGE}" = "ubuntu:20.04" ]
then
apt update
apt install -y git ruby ruby-dev libffi-dev build-essential
fi

# Since secure_path is set on our CentOS build images, we also need to ensure
# we only use absolute paths when referencing the binaries we want to run.
GEM="$(command -v gem)"
Expand Down
8 changes: 0 additions & 8 deletions docker.sh

This file was deleted.

0 comments on commit 6863bc5

Please sign in to comment.