Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Run builds using CircleCI 2.0 in an Alpine 3.5 container (#21)
Browse files Browse the repository at this point in the history
* Support non-coreutils /bin/mktemp

The template parameter is a coreutils extension and e.g. not available in busybox
Test if we need it and use it only, if necessary

* Run builds using CircleCI 2.0 in an Alpine 3.5 container

Requires aaa7985 and
 ed9b4fd to pass tests
  • Loading branch information
devurandom authored and michaelcontento committed Apr 3, 2017
1 parent 2ca71d9 commit 18f8766
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
jobs:
build:
working_directory: /circleci-matrix
docker:
- image: docker.io/library/alpine:3.5
steps:
- checkout
- run:
name: Install dependencies
command: |
apk add --no-cache bash ca-certificates ncurses wget
wget -O bats-0.4.0.tar.gz https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz
tar -xzf bats-0.4.0.tar.gz
cd bats-0.4.0
./install.sh /usr/local
- run:
name: Run tests
command: bats tests/run.bats

13 changes: 0 additions & 13 deletions circle.yml

This file was deleted.

8 changes: 6 additions & 2 deletions src/circleci-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ TERMINAL_COLUMNS=$(tput cols || true)
export CIRCLE_NODE_TOTAL=${CIRCLE_NODE_TOTAL:-1}
export CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX:-0}

if ! rm $(mktemp -t) ; then
MKTEMP_T_ARG=circleci_matrix.XXX
fi

error() {
local message=$1
echo >&2 "ERROR: $message"
Expand Down Expand Up @@ -182,7 +186,7 @@ read_file() {
process_commands() {
local line=""
local envfile=$1
local tempfile=$(mktemp -t circleci_matrix.XXX)
local tempfile=$(mktemp -t ${MKTEMP_T_ARG})

while read -r line; do
cp -f "$envfile" "$tempfile"
Expand All @@ -207,7 +211,7 @@ process_commands() {
process_envs() {
local line=""
local i=0
local tempfile=$(mktemp -t circleci_matrix.XXX)
local tempfile=$(mktemp -t ${MKTEMP_T_ARG})
local sources_prefix="$(sources)"

while read -r line; do
Expand Down

0 comments on commit 18f8766

Please sign in to comment.