-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from PremiereGlobal/deploy-shell
Deploy shell
- Loading branch information
Showing
544 changed files
with
245,248 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
bin | ||
.kube |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Cache | ||
Certain stim commands use caching to speed up operations. The structure of the cache is as follows. | ||
``` | ||
├── ${STIM_CACHE_PATH}/ # Set via environment variable | ||
│ ├── bin/ # Storage for binary executables | ||
│ │ ├── darwin/ # Versioned MacOS binaries | ||
│ │ ├── linux/ # Versioned Linux binaries | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Configuration | ||
Stim can be configured in several ways. Many options can be configured via environment variables, config files or command-line parameters. | ||
|
||
## Order of Presedence | ||
For all stim options: | ||
|
||
`CLI Options` *overrides* `Environment Variables` *overrides* `Config File` | ||
|
||
## Global | ||
These options configure where stim looks for and stores its core configuration data. | ||
|Env Var| Global CLI Option | Description | Default | | ||
|---|---|---|---| | ||
| `STIM_PATH` | `--path` | Path to the stim directory. This is the default location for configuration files. | `${HOME}/.stim`| | ||
| `STIM_CACHE_PATH` | `--cache-path` | Path for caching data. See [CACHE.md](CACHE.md) for more details. | `${STIM_PATH}/cache` | | ||
| `STIM_CONFIG_FILE` | `--config` | Path for the global stim configuration file | `${STIM_PATH}/config.yaml`| | ||
|
||
### Stim Config File | ||
Additional configuration can be set in the `STIM_CONFIG_FILE`. | ||
|
||
| Option | Description | Type | Default | | ||
|---|---|---|---| | ||
| `path` | | `string` | `token` | | ||
| `cache-path` | | `string` | `token` | | ||
| `auth.method` | Method to use for authentication. Currently this would be the Vault auth-backend to use. | `string` | `token` | | ||
| `aws.default-profile` | When fetching AWS credential, set to default AWS profile (in `~/.aws/credentials`). | `bool` | `false` | | ||
| `aws.ttl` | Default ttl to set when fetching AWS credentials. (ex. `24h`) | `duration` | `Vault Default Setting` | | ||
| `aws.use-profiles` | When fetching AWS credential, store the credentials as AWS profile (in `~/.aws/credentials`). | `bool` | `false` | | ||
| `aws.web-ttl` | TTL for AWS web logins. | `duration` | `AWS default` | | ||
| `logging.file.disable` | Option to disable file logging | `boolean` | `false` | | ||
| `logging.file.level` | File logging verbosity | `string` | `info` | | ||
| `logging.file.path` | File logging path | `string` | `info` | | ||
| `pagerduty.vault-apikey-key` | Vault key for the Pagerduty API key | `string` | ` ` | | ||
| `pagerduty.vault-apikey-path` | Vault path for the Pagerduty API key | `string` | ` ` | | ||
| `vault-address` | Address to be used for connecting with Vault | `string` | ` ` | | ||
| `vault-initial-token-duration` | Default token duration to use when authenticating with Vault | `duration` | `Vault Default Setting` | | ||
| `vault-username` | Default username to use when logging into Vault | `string` | `Vault Default Setting` | | ||
| `vault-username-skip-prompt` | Skip the username prompt if `vault-username` is set | `bool` | `false` | | ||
| `verbose` | Use verbose logging | `bool` | `false` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
|
||
# Exit if not running with `stim deploy` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def label = "buildpod-${env.JOB_NAME}-${env.BUILD_NUMBER}".replace('_', '-').replace('/', '-') | ||
|
||
podTemplate( | ||
label: label, | ||
containers: [ | ||
containerTemplate( | ||
name: 'stim', | ||
image: 'premiereglobal/stim:latest', | ||
command: 'cat', | ||
ttyEnabled: true, | ||
envVars: [ envVar( key: 'VAULT_ADDR', value: '<Vault URL for your company>')] | ||
) | ||
] | ||
) { | ||
node(label) { | ||
checkout scm | ||
stage('Deploy') { | ||
container(name: 'stim') { | ||
withCredentials([string(credentialsId: 'vault-default', variable: 'VAULT_TOKEN')]) { | ||
sh 'stim deploy --environment dev --instance all' | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Jenkins deployment with Stim | ||
|
||
In this example we're deploying a Nginx container with Jenkins. This also uses Helm 3 and the stim version 1.3 that can run without the need of a second container in Jenkins. The goal is to have a simple Jenkinsfile with the logic in the deploy.sh so you can test locally. | ||
To run this example, simply run `stim deploy` from this directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -eu -o pipefail | ||
|
||
# Exit if not running with `stim deploy` | ||
if [ ! ${STIM_DEPLOY+x} ]; then echo "Must be run with 'stim deploy'"; exit 1; fi | ||
|
||
# This script is meant to be run from a docker container | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm upgrade \ | ||
--debug \ | ||
--install \ | ||
--namespace ${NAMESPACE} \ | ||
--set image.tag=${IMAGE_TAG} \ | ||
nginx-test bitnami/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Configuration for kicking off the deployment (files and directories) | ||
global: | ||
spec: | ||
kubernetes: | ||
serviceAccount: sre | ||
tools: | ||
helm: | ||
version: "v3.0.2" | ||
env: | ||
- name: IMAGE_TAG | ||
value: "latest" | ||
environments: | ||
- name: dev | ||
instances: | ||
- name: devcluster | ||
spec: | ||
kubernetes: | ||
cluster: devcluster.my-domain.com | ||
env: | ||
- name: NAMESPACE | ||
value: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
|
||
# Exit if not running with `stim deploy` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.