From 42ab2e5330b6f21b22667188713cdbe92408eec5 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 30 Oct 2018 23:28:48 +0600 Subject: [PATCH] CircleCI --- .circleci/Dockerfile | 41 +++++++++++++ .circleci/config.yml | 134 +++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 48 ---------------- README.md | 2 +- 4 files changed, 176 insertions(+), 49 deletions(-) create mode 100644 .circleci/Dockerfile create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile new file mode 100644 index 00000000..46fb0d29 --- /dev/null +++ b/.circleci/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:stretch + +RUN apt-get -qq update \ + && apt-get install -y --no-install-recommends bash unzip ca-certificates build-essential \ + curl git mercurial make binutils bison gcc autoconf libtool automake swig \ + gobject-introspection libglib2.0-dev libexpat1-dev libxml2-dev libfftw3-dev \ + libjpeg-dev libpng-dev libwebp-dev libgif-dev libexif-dev liblcms2-dev gtk-doc-tools + +RUN curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | bash - + +RUN \ + for VIPS_VERSION in "8.3" "8.4" "8.5" "8.6" "8.7"; do \ + mkdir -p /root/vips \ + && cd /root/vips \ + && mkdir /root/vips/$VIPS_VERSION \ + && curl -s -S -L -o $VIPS_VERSION.zip https://github.com/libvips/libvips/archive/$VIPS_VERSION.zip \ + && unzip $VIPS_VERSION.zip \ + && cd libvips-$VIPS_VERSION \ + && test -f autogen.sh && ./autogen.sh || ./bootstrap.sh \ + && ./configure \ + --prefix=/root/vips/$VIPS_VERSION \ + --without-python \ + --without-gsf \ + --without-orc \ + --disable-debug \ + --disable-dependency-tracking \ + --disable-static \ + --enable-silent-rules \ + --enable-gtk-doc-html=no \ + --enable-gtk-doc=no \ + --enable-pyvips8=no \ + && make \ + && make install \ + && cd .. \ + && rm -rf $VIPS_VERSION.zip libvips-$VIPS_VERSION; \ + done + +WORKDIR /go/src +ENV GOPATH=/go + +ENTRYPOINT [ "/bin/bash" ] diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..194504d3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,134 @@ +version: 2.1 + +workflows: + version: 2 + build: + jobs: + - checkout_code + - build: + name: go1.11_vips8.7 + requires: + - checkout_code + go_version: "1.11" + vips_version: "8.7" + - build: + name: go1.11_vips8.6 + requires: + - checkout_code + go_version: "1.11" + vips_version: "8.6" + - build: + name: go1.11_vips8.5 + requires: + - checkout_code + go_version: "1.11" + vips_version: "8.5" + - build: + name: go1.11_vips8.4 + requires: + - checkout_code + go_version: "1.11" + vips_version: "8.4" + - build: + name: go1.11_vips8.3 + requires: + - checkout_code + go_version: "1.11" + vips_version: "8.3" + - build: + name: go1.10_vips8.7 + requires: + - checkout_code + go_version: "1.10" + vips_version: "8.7" + - build: + name: go1.10_vips8.6 + requires: + - checkout_code + go_version: "1.10" + vips_version: "8.6" + - build: + name: go1.10_vips8.5 + requires: + - checkout_code + go_version: "1.10" + vips_version: "8.5" + - build: + name: go1.10_vips8.4 + requires: + - checkout_code + go_version: "1.10" + vips_version: "8.4" + - build: + name: go1.10_vips8.3 + requires: + - checkout_code + go_version: "1.10" + vips_version: "8.3" + - build: + name: go1.10_vips8.7 + requires: + - checkout_code + go_version: "1.9" + vips_version: "8.7" + - build: + name: go1.9_vips8.6 + requires: + - checkout_code + go_version: "1.9" + vips_version: "8.6" + - build: + name: go1.9_vips8.5 + requires: + - checkout_code + go_version: "1.9" + vips_version: "8.5" + - build: + name: go1.9_vips8.4 + requires: + - checkout_code + go_version: "1.9" + vips_version: "8.4" + - build: + name: go1.9_vips8.3 + requires: + - checkout_code + go_version: "1.9" + vips_version: "8.3" + +jobs: + checkout_code: + docker: + - image: circleci/slim-base:latest + working_directory: /go/src/imgproxy + steps: + - checkout: + path: /go/src/imgproxy + - persist_to_workspace: + root: . + paths: [.] + + build: + docker: + - image: "darthsim/imgproxy-circleci:latest" + working_directory: /go/src/imgproxy + environment: + BASH_ENV: "/root/.bashrc" + parameters: + go_version: + type: string + vips_version: + type: string + steps: + - attach_workspace: + at: . + - run: + name: Build imgproxy + command: | + gvm install go<< parameters.go_version >> -B + gvm use go<< parameters.go_version >> + export GOPATH=/go + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/vips/<< parameters.vips_version >>/lib + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/root/vips/<< parameters.vips_version >>/lib/pkgconfig + export CGO_LDFLAGS_ALLOW="-s|-w" + go build -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ac70c05..00000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: go - -go: - - '1.9' - - '1.10' - - '1.11' - - tip - -env: - - VIPS_VERSION=8.3 - - VIPS_VERSION=8.4 - - VIPS_VERSION=8.5 - - VIPS_VERSION=8.6 - - VIPS_VERSION=8.7 - - VIPS_VERSION=master - -matrix: - allow_failures: - - env: VIPS_VERSION=master - -cache: apt - -install: - - sudo apt-get -qq update - - sudo apt-get install -y build-essential libxml2-dev libfftw3-dev gobject-introspection libglib2.0-dev libwebp-dev libgif-dev gtk-doc-tools - - wget https://github.com/libvips/libvips/archive/$VIPS_VERSION.zip - - unzip $VIPS_VERSION.zip - - pushd libvips-$VIPS_VERSION - - test -f autogen.sh && ./autogen.sh || ./bootstrap.sh - - > - ./configure - --prefix=/usr - --without-python - --without-gsf - --without-orc - --disable-debug - --disable-dependency-tracking - --disable-static - --enable-silent-rules - --enable-gtk-doc-html=no - --enable-gtk-doc=no - --enable-pyvips8=no - - make - - sudo make install - - popd - -script: - - CGO_LDFLAGS_ALLOW="-s|-w" go build diff --git a/README.md b/README.md index 1a7b6a52..bfd687a5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ -[![Build Status](https://api.travis-ci.org/DarthSim/imgproxy.svg?branch=master)](https://travis-ci.org/DarthSim/imgproxy) [![Docker](https://img.shields.io/badge/docker-darthsim%2Fimgproxy-blue.svg)](https://hub.docker.com/r/darthsim/imgproxy/) [![MicroBadger Size](https://img.shields.io/microbadger/image-size/darthsim/imgproxy.svg)](https://hub.docker.com/r/darthsim/imgproxy/) [![Docker Pulls](https://img.shields.io/docker/pulls/darthsim/imgproxy.svg)](https://hub.docker.com/r/darthsim/imgproxy/) +[![CircleCI](https://circleci.com/gh/DarthSim/imgproxy.svg?style=svg)](https://circleci.com/gh/DarthSim/imgproxy) [![Docker](https://img.shields.io/badge/docker-darthsim%2Fimgproxy-blue.svg)](https://hub.docker.com/r/darthsim/imgproxy/) [![MicroBadger Size](https://img.shields.io/microbadger/image-size/darthsim/imgproxy.svg)](https://hub.docker.com/r/darthsim/imgproxy/) [![Docker Pulls](https://img.shields.io/docker/pulls/darthsim/imgproxy.svg)](https://hub.docker.com/r/darthsim/imgproxy/) imgproxy is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security.