Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linters to Travis CI configuration
Previously, Travis CI installed software (some of which was not needed), and then ran `/bin/true`. Now, the Travis CI configuration has been cleaned up, and runs shellcheck and yamllint. In the process, several .sh and .yml files had to be updated so that they would pass linting. Related-Issue: #26 Signed-off-by: Matt Langbehn <matthew.langbehn@gmail.com>
- Loading branch information
Showing
11 changed files
with
203 additions
and
138 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,59 +1,59 @@ | ||
--- | ||
stages: | ||
- name: BUILD | ||
inputs: | ||
- type: git | ||
branch: master | ||
service: ${SAMPLE_REPO} | ||
triggers: | ||
- type: commit | ||
jobs: | ||
- name: Build | ||
type: builder | ||
artifact_dir: '' | ||
build_type: shell | ||
script: |- | ||
#!/bin/bash | ||
bash -n *.sh | ||
- name: DEPLOY | ||
inputs: | ||
- type: job | ||
stage: BUILD | ||
job: Build | ||
dir_name: null | ||
triggers: | ||
- type: stage | ||
properties: | ||
- name: BLUEMIX_USER | ||
type: text | ||
value: ${BLUEMIX_USER} | ||
- name: BLUEMIX_PASSWORD | ||
type: secure | ||
value: ${BLUEMIX_PASSWORD} | ||
- name: BLUEMIX_ACCOUNT | ||
type: secure | ||
value: ${BLUEMIX_ACCOUNT} | ||
- name: CLUSTER_NAME | ||
type: text | ||
value: ${CLUSTER_NAME} | ||
- name: API_KEY | ||
type: secure | ||
value: ${API_KEY} | ||
jobs: | ||
- name: Deploy | ||
type: deployer | ||
target: | ||
region_id: ${PROD_REGION_ID} | ||
organization: ${PROD_ORG_NAME} | ||
space: ${PROD_SPACE_NAME} | ||
application: Pipeline | ||
script: | | ||
#!/bin/bash | ||
. ./scripts/install_bx.sh | ||
./scripts/bx_login.sh | ||
./scripts/deploy.sh | ||
- name: BUILD | ||
inputs: | ||
- type: git | ||
branch: master | ||
service: ${SAMPLE_REPO} | ||
triggers: | ||
- type: commit | ||
jobs: | ||
- name: Build | ||
type: builder | ||
artifact_dir: '' | ||
build_type: shell | ||
script: |- | ||
#!/bin/bash | ||
bash -n *.sh | ||
- name: DEPLOY | ||
inputs: | ||
- type: job | ||
stage: BUILD | ||
job: Build | ||
dir_name: null | ||
triggers: | ||
- type: stage | ||
properties: | ||
- name: BLUEMIX_USER | ||
type: text | ||
value: ${BLUEMIX_USER} | ||
- name: BLUEMIX_PASSWORD | ||
type: secure | ||
value: ${BLUEMIX_PASSWORD} | ||
- name: BLUEMIX_ACCOUNT | ||
type: secure | ||
value: ${BLUEMIX_ACCOUNT} | ||
- name: CLUSTER_NAME | ||
type: text | ||
value: ${CLUSTER_NAME} | ||
- name: API_KEY | ||
type: secure | ||
value: ${API_KEY} | ||
jobs: | ||
- name: Deploy | ||
type: deployer | ||
target: | ||
region_id: ${PROD_REGION_ID} | ||
organization: ${PROD_ORG_NAME} | ||
space: ${PROD_SPACE_NAME} | ||
application: Pipeline | ||
script: | | ||
#!/bin/bash | ||
. ./scripts/install_bx.sh | ||
./scripts/bx_login.sh | ||
./scripts/deploy.sh | ||
hooks: | ||
- enabled: true | ||
label: null | ||
ssl_enabled: false | ||
url: https://devops-api-integration.stage1.ng.bluemix.net/v1/messaging/webhook/publish | ||
- enabled: true | ||
label: null | ||
ssl_enabled: false | ||
url: https://devops-api-integration.stage1.ng.bluemix.net/v1/messaging/webhook/publish |
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,20 +1,28 @@ | ||
--- | ||
language: python | ||
python: 2.7 | ||
sudo: required | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- debian-sid | ||
packages: | ||
- shellcheck | ||
|
||
install: | ||
- pip install -U pip | ||
- pip install yamllint | ||
- wget http://public.dhe.ibm.com/cloud/bluemix/cli/bluemix-cli/Bluemix_CLI_0.5.1_amd64.tar.gz | ||
-O /tmp/bx.tar.gz | ||
- tar xf /tmp/bx.tar.gz -C /tmp | ||
- sudo /tmp/Bluemix_CLI/install_bluemix_cli | ||
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
- chmod +x kubectl | ||
- sudo mv kubectl /usr/local/bin | ||
|
||
before_script: | ||
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | | ||
sudo apt-key add - | ||
- echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||
- sudo apt-get update | ||
- sudo apt-get install cf-cli -y | ||
- wget http://public.dhe.ibm.com/cloud/bluemix/cli/bluemix-cli/Bluemix_CLI_0.5.1_amd64.tar.gz | ||
-O /tmp/bx.tar.gz | ||
- tar xf /tmp/bx.tar.gz -C /tmp | ||
- sudo /tmp/Bluemix_CLI/install_bluemix_cli | ||
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
- chmod +x kubectl | ||
- sudo mv kubectl /usr/local/bin | ||
- "./tests/test-shellcheck.sh" | ||
- "./tests/test-yamllint.sh" | ||
|
||
script: true | ||
env: | ||
global: | ||
- secure: JWfW2aekuP73UUyVrUpvltnN5SPaIrDKYzcH7V54TzjDkZ/98a9nu15te5e1WRUb1W0gZtYnQexfLjdJjtweGMSFvfR0J44MYQt2a2qOExHPU6zYvrIpt91mHKvX3ymjCVVkhxfv85IXKTAsXy2DDFw7WvDBdauwdEIqDauU8EnnRzdSP21UVOA2aMn+RZp2aUziUXDOqZIIzDvzLs3V0VrAuHEyLsttPkijV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m/0i5/jrzAFV6ON3ZrUqrOOYSQbZ3h/4jQf0UP63oPbBr17xgbtsAmXB4RipQ0ktc= | ||
- secure: GPG087lVaNdjHOpv2obmGY+DhxCwz700E8Mo7Yer9ZrXHcnYN9V0dh/fRMU8C04aNW2ZvNa6RNZl/BNMKgQfPx+eEjpX0k8kqJ5fEFgFv7GMWacX89fzAf9mRoqoFV5YnIn/7QMOcN6Mgh5hNPEFRX30VkOrTAm7v/ykRLeoXUVpyhhy1d2Ig/Cv+e67Gz4vQmSoTvKAULBhge5hbMfkK2yutOuSu5hGUj+oCmQDzFHjb4+L4TwQoz58iN0SYc3QHQPTdUJEg+bQvIz7nMNX9koH3EtXo3WCxyqgCTYrfp9pVZaCiWC7EyuA3I15fzBr5aLI0y4bpMBQMLbviskkI5CqyJMavEDPyb285UshoxoLQ9FuPEIepBKpHMZxJQKZ90434cmav9DrlQnU0aApVJMFlHnS6Qg0+UAwyCQsooSe5GzWsJP5UXLrETaHwg1Y+migc73xkE/PkiO0FQxll7z2L3imnMLO3vymW6p2FkpnynrkQelsiSuVx7J5aU88L2gyBwyopwHppgbK/sWlXmB6S2of9T5YB2lZwycxqi6P0WF9jyxazJOLfU2McJ/6BeU8KYXnzTKdpqT4XKuvAa8L7Mlk4Utd1f/Ng0wuh4L8ZU7gU6j/KC1KoQwOCvbl3YjKf5Vc8EYvnUkEfI8OLm0EWLfZdmo3+1oKmDjI9Po= |
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,47 @@ | ||
--- | ||
rules: | ||
braces: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 0 | ||
min-spaces-inside-empty: 0 | ||
max-spaces-inside-empty: 0 | ||
brackets: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 0 | ||
min-spaces-inside-empty: 0 | ||
max-spaces-inside-empty: 0 | ||
colons: | ||
max-spaces-before: 0 | ||
max-spaces-after: 1 | ||
commas: | ||
max-spaces-before: 0 | ||
min-spaces-after: 1 | ||
max-spaces-after: 1 | ||
comments: | ||
require-starting-space: true | ||
min-spaces-from-content: 2 | ||
comments-indentation: enable | ||
document-end: disable | ||
document-start: | ||
present: true | ||
empty-lines: | ||
max: 2 | ||
max-start: 0 | ||
max-end: 0 | ||
hyphens: | ||
max-spaces-after: 1 | ||
indentation: | ||
spaces: consistent | ||
indent-sequences: true | ||
check-multi-line-strings: false | ||
key-duplicates: enable | ||
line-length: | ||
max: 80 | ||
allow-non-breakable-words: true | ||
allow-non-breakable-inline-mappings: true | ||
level: warning | ||
new-line-at-end-of-file: enable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: enable | ||
truthy: enable |
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,35 +1,31 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
if [ -z $CF_ORG ]; then | ||
if [[ -z "$CF_ORG" ]]; then | ||
CF_ORG="$BLUEMIX_ORG" | ||
fi | ||
if [ -z $CF_SPACE ]; then | ||
if [[ -z "$CF_SPACE" ]]; then | ||
CF_SPACE="$BLUEMIX_SPACE" | ||
fi | ||
|
||
|
||
if ([ -z "$BLUEMIX_USER" ] || [ -z "$BLUEMIX_PASSWORD" ] || [ -z "$BLUEMIX_ACCOUNT" ]) && ([ -z "$API_KEY"]); then | ||
if ([ -z "$BLUEMIX_USER" ] || [ -z "$BLUEMIX_PASSWORD" ] || [ -z "$BLUEMIX_ACCOUNT" ]) && ([ -z "$API_KEY" ]); then | ||
echo "Define all required environment variables and re-run the stage." | ||
exit 1 | ||
fi | ||
|
||
echo "bx login -a $CF_TARGET_URL" | ||
|
||
if [ -z "$API_KEY"]; then | ||
bx login -a "$CF_TARGET_URL" -u "$BLUEMIX_USER" -p "$BLUEMIX_PASSWORD" -c "$BLUEMIX_ACCOUNT" -o "$CF_ORG" -s "$CF_SPACE" | ||
if [[ -z "$API_KEY" ]]; then | ||
bx login -a "$CF_TARGET_URL" -u "$BLUEMIX_USER" -p "$BLUEMIX_PASSWORD" -c "$BLUEMIX_ACCOUNT" -o "$CF_ORG" -s "$CF_SPACE" \ | ||
|| echo "Failed to authenticate to Bluemix" | ||
else | ||
bx login -a "$CF_TARGET_URL" --apikey "$API_KEY" -o "$CF_ORG" -s "$CF_SPACE" | ||
bx login -a "$CF_TARGET_URL" --apikey "$API_KEY" -o "$CF_ORG" -s "$CF_SPACE" \ | ||
|| echo "Failed to authenticate to Bluemix" | ||
fi | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to authenticate to Bluemix" | ||
exit 1 | ||
fi | ||
|
||
# Init container clusters | ||
echo "bx cs init" | ||
bx cs init | ||
if [ $? -ne 0 ]; then | ||
|
||
if ! bx cs init ; then | ||
echo "Failed to initialize to Bluemix Container Service" | ||
exit 1 | ||
fi |
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.