Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
envsubst: sawadashota/envsubst@1.4.3
Use envsubst
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Install envsubst command
1
2
3
4
version: '2.1'
orbs:
envsubst: sawadashota/envsubst@volatile
workflows: null
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
install-dir | Directory in which to install the envsubst command | No | /usr/local/bin | string |
version | Installing version of envsubst. https://github.com/a8m/envsubst/releases
| No | v1.4.2 | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
CircleCI orb to use envsubst command
https://github.com/sawadashota/envsubst-orb
commands:
install:
parameters:
install-dir:
default: /usr/local/bin
description: Directory in which to install the envsubst command
type: string
version:
default: v1.4.2
description: |
Installing version of envsubst. https://github.com/a8m/envsubst/releases
type: string
steps:
- run:
command: |
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
ARCH=$(uname -m)
if [[ "$ARCH" == "aarch64" ]]; then
ARCH="arm64"
elif [[ "$ARCH" == "amd64" ]]; then
ARCH="x86_64"
fi
RES_CODE=$(curl -L https://github.com/a8m/envsubst/releases/download/<< parameters.version >>/envsubst-`uname -s`-$ARCH -o envsubst)
if [[ $RES_CODE -ge 400 ]]; then
echo "Error: Failed to download envsubst binary from https://github.com/a8m/envsubst/releases/download/<< parameters.version >>/envsubst-`uname -s`-$ARCH. Response code: $RES_CODE"
exit 1
fi
chmod +x envsubst
$SUDO mv envsubst << parameters.install-dir >>
name: Install envsubst
examples:
install-envsubst:
description: |
Install envsubst command
usage:
version: "2.1"
orbs:
envsubst: sawadashota/envsubst@volatile
workflows: null