Sha256: c883c3089829df7c55b175a463764ed6593ae556ee62d56c9be950910951da8c

Contents?: true

Size: 782 Bytes

Versions: 94

Compression:

Stored size: 782 Bytes

Contents

#!/bin/bash -eux

out=$(git status docs)
if [[ "$out" = *"nothing to commit"* ]]; then
  exit
fi

COMMIT_MESSAGE="docs updated by codebuild"

# If the last commit already updated the docs, then exit.
# Preventable measure to avoid infinite loop.
if git log -1 --pretty=oneline | grep "$COMMIT_MESSAGE" ; then
  exit
fi

# If reach here, we have some changes on docs that we should commit.
git add docs
git commit -m "$COMMIT_MESSAGE"

# SSH_KEY_S3_PATH set as codebuild environment variable
aws s3 cp $SSH_KEY_S3_PATH ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
sed -i -- 's|https://github.com/|git@github.com:|g' .git/config

# https://makandracards.com/makandra/12107-git-show-current-branch-name-only
current_branch=$(git rev-parse --abbrev-ref HEAD)
git push origin "$current_branch"

Version data entries

94 entries across 94 versions & 2 rubygems

Version Path
jets-4.0.12 .cody/docs/bin/git_commit.sh
jets-4.0.11 .cody/docs/bin/git_commit.sh
jets-5.0.13 .cody/docs/bin/git_commit.sh
jets-5.0.12 .cody/docs/bin/git_commit.sh
jets-5.0.11 .cody/docs/bin/git_commit.sh
jets-5.0.10 .cody/docs/bin/git_commit.sh
jets-5.0.9 .cody/docs/bin/git_commit.sh
jets-5.0.8 .cody/docs/bin/git_commit.sh
jets-5.0.7 .cody/docs/bin/git_commit.sh
jets-5.0.6 .cody/docs/bin/git_commit.sh
jets-5.0.5 .cody/docs/bin/git_commit.sh
jets-5.0.4 .cody/docs/bin/git_commit.sh
jets-5.0.3 .cody/docs/bin/git_commit.sh
jets-5.0.2 .cody/docs/bin/git_commit.sh
jets-5.0.1 .cody/docs/bin/git_commit.sh
jets-5.0.0 .cody/docs/bin/git_commit.sh
jets-4.0.10 .cody/docs/bin/git_commit.sh
jets-5.0.0.beta1 .cody/docs/bin/git_commit.sh
jets-4.0.9 .cody/docs/bin/git_commit.sh
jets-4.0.8 .cody/docs/bin/git_commit.sh