Skip to content

Commit

Permalink
v3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
escapace committed Aug 26, 2019
1 parent d285291 commit 704872f
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 61 deletions.
35 changes: 0 additions & 35 deletions .github/main.workflow

This file was deleted.

93 changes: 93 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
on:
push:
branches:
- '*'
- '!master'
tags:
- 'v*'
name: Pipeline
jobs:
test-linux:
name: "Linux Test"
runs-on: ubuntu-latest
strategy:
matrix:
suite: [lint, centos, alpine]
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: manage ci
run: |
./manage trust-escapace
./manage ci
env:
TEST_SUITE: ${{ matrix.suite }}
test-macOS:
name: "macOS Test"
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: manage ci
run: |
brew install bash gnu-sed gnupg
./manage trust-escapace
./manage ci
env:
TEST_SUITE: osx
docker:
name: "Docker build and push"
runs-on: ubuntu-latest
needs: [test-macOS, test-linux]
steps:
- uses: actions/checkout@master
if: contains(github.ref, 'tags/v')
with:
submodules: true
- name: Docker Login
if: contains(github.ref, 'tags/v')
uses: actions/docker/login@fe7ed3ce992160973df86480b83a2f8ed581cd50
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Docker Build
if: contains(github.ref, 'tags/v')
uses: actions/docker/cli@fe7ed3ce992160973df86480b83a2f8ed581cd50
with:
args: build -t escapace/manage:latest -t escapace/manage:${GITHUB_REF:11} .
- name: Docker Push Latest
if: contains(github.ref, 'tags/v')
uses: actions/docker/cli@fe7ed3ce992160973df86480b83a2f8ed581cd50
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
with:
args: push escapace/manage:latest
- name: Docker Push Tag
if: contains(github.ref, 'tags/v')
uses: actions/docker/cli@fe7ed3ce992160973df86480b83a2f8ed581cd50
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
with:
args: push escapace/manage:${GITHUB_REF:11}
release:
name: "Github Release"
runs-on: ubuntu-latest
needs: [test-macOS, test-linux]
steps:
- uses: actions/checkout@master
if: contains(github.ref, 'tags/v')
with:
submodules: true
- name: release
if: contains(github.ref, 'tags/v')
run: |
mkdir ~/bin
wget -qO- https://github.com/github/hub/releases/download/v2.12.3/hub-linux-amd64-2.12.3.tgz | tar xvz -C ~/bin --strip=2 --wildcards --no-anchored 'hub*/bin/hub'
~/bin/hub release create -a manage -m "manage ${GITHUB_REF:11}" v${GITHUB_REF:11}
env:
GITHUB_USER: escapace
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ Checks whether executable with given name exists in **PATH**
#### @import

```bash
# @import github.com/escapace/stack-tools//hashicorp/downloadPacker
# @import github.com/escapace/stack-tools download/downloadPacker
```

Import a module from import path.

- Modules from manage utility library such as `array/join`
- Local modules in `scripts/modules` directory
- Remote modules such as `github.com/escapace/stack-tools//hashicorp/downloadPacker`
- Remote modules such as `github.com/escapace/stack-tools download/downloadPacker`

### Utility Library

Expand Down Expand Up @@ -195,7 +195,7 @@ Now, we can import the script by adding the following line to our `hello` file
in `scripts`

```bash
# @import github.com/escapace/stack-tools//hashicorp/downloadTerraform
# @import github.com/escapace/stack-tools download/downloadTerraform
```

Then run
Expand Down
22 changes: 22 additions & 0 deletions images/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM alpine:latest

RUN apk add --no-cache \
coreutils bash sed bc gnupg git tini curl

ENV DOCKER=true
RUN mkdir -p /workdir
WORKDIR /workdir

COPY .manage.yml .manage.yml
COPY LICENSE LICENSE
COPY manage manage
COPY modules modules
COPY scripts scripts
COPY tests tests
COPY vendor vendor
COPY .manage_modules .manage_modules

RUN ./manage trust-escapace

ENTRYPOINT ["/sbin/tini", "--", "/workdir/manage"]
CMD ["help"]
24 changes: 24 additions & 0 deletions images/centos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM centos:latest
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install coreutils findutils bc gnupg git

ENV DOCKER=true
RUN mkdir -p /workdir
WORKDIR /workdir

COPY .manage.yml .manage.yml
COPY LICENSE LICENSE
COPY manage manage
COPY modules modules
COPY scripts scripts
COPY tests tests
COPY vendor vendor
COPY .manage_modules .manage_modules

RUN ./manage trust-escapace
RUN mv /workdir/vendor/tini/tini /sbin/tini
RUN chown root:root /sbin/tini
RUN chmod 755 /sbin/tini

ENTRYPOINT ["/sbin/tini", "--", "/workdir/manage"]
CMD ["help"]
24 changes: 24 additions & 0 deletions images/shellcheck/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM centos:latest
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install coreutils findutils bc gnupg git ShellCheck

ENV DOCKER=true
RUN mkdir -p /workdir
WORKDIR /workdir

COPY .manage.yml .manage.yml
COPY LICENSE LICENSE
COPY manage manage
COPY modules modules
COPY scripts scripts
COPY tests tests
COPY vendor vendor
COPY .manage_modules .manage_modules

RUN ./manage trust-escapace
RUN mv /workdir/vendor/tini/tini /sbin/tini
RUN chown root:root /sbin/tini
RUN chmod 755 /sbin/tini

ENTRYPOINT ["/sbin/tini", "--", "/workdir/manage"]
CMD ["help"]
2 changes: 1 addition & 1 deletion manage
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else
exit 1
fi

MANAGE_VERSION="v3.3.33"
MANAGE_VERSION="v3.4.0"

MANAGE_IS_CI () {
# Returns 0 if the current environment
Expand Down
11 changes: 6 additions & 5 deletions modules/manage/manageGPGKey
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ manageGPGKey ()
local mode="${1:-"--recv-keys"}"
local key="$2"
local keyservers=(
"hkps://keys.openpgp.org"
"hkp://keyserver.ubuntu.com:80"
"hkp://ipv4.pool.sks-keyservers.net"
"hkp://p80.pool.sks-keyservers.net:80"
Expand All @@ -29,10 +30,10 @@ manageGPGKey ()
executable="gpg"
fi

if exists gpg2
then
executable="gpg2"
fi
# if exists gpg2
# then
# executable="gpg2"
# fi

required "${executable}" || return 1

Expand All @@ -50,7 +51,7 @@ manageGPGKey ()
then
if (( code == 0 ))
then
echo "${key}:5:" | gpg --import-ownertrust &> /dev/null
echo "${key}:5:" | "${executable}" --import-ownertrust &> /dev/null

exitCode=0

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# @import github.com/escapace/stack-tools docker/downloadTini
# @import github.com/escapace/stack-tools download/downloadTini
# @import github.com/escapace/stack-tools docker/dockerBuild
# @import manage/manage
# @import lang/required
Expand Down

0 comments on commit 704872f

Please sign in to comment.