Skip to content

Instantly share code, notes, and snippets.

View ritmas's full-sized avatar

Rimantas Ragainis ritmas

View GitHub Profile
#!/bin/sh
# shellcheck shell=bash
# shellcheck disable=SC2155
ash()
{
if [ -z "$1" ]; then
_ash_usage
return
fi
[Unit]
Wants=network-online.target
After=network-online.target
Description=GCP CodeDeploy
[Service]
ExecStart=/usr/bin/python /home/centos/gcp-codedeploy.py --gcp-project-id=X --application=app --gcp-pubsub-subscription=app-10.x.x.x
SyslogIdentifier=gcp-codedeploy
Type=simple
ExecStopPost=/usr/bin/python /home/centos/gcp-codedeploy.py --gcp-project-id=X --application=app --gcp-pubsub-subscription=app-10.x.x.x --action=stop
#!/usr/bin/python
"""GCP CodeDeploy agent as custom alternative to AWS CodeDeploy"""
__author__ = 'Rimantas Ragainis'
__email__ = 'rimantas@eskimi.com'
import argparse
import os
import subprocess
version: 0.0
os: linux
files:
- source: /
destination: /var/www/app
permissions:
- object: /var/www/app/scripts
pattern: "**"
mode: 4755
hooks: