diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index fc513d5a6..295563120 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -146,5 +146,5 @@ Try to keep history as linear as possible using a `rebase` merge strategy. #. Delete merged Branch -.. _Issue: https://github.com/gogoit/foremast/issues -.. _Pull Request: https://github.com/gogoit/foremast/pulls +.. _Issue: https://github.com/foremast/foremast/issues +.. _Pull Request: https://github.com/foremast/foremast/pulls diff --git a/README.rst b/README.rst index f5dc3b530..d26c74ae9 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ Foremast is a Spinnaker pipeline and infrastructure configuration and templating tool. Just create a couple JSON configuration files and then manually creating Spinnaker pipelines becomes a thing of the past. -.. image:: https://s3.amazonaws.com/gogo-oss-logos/Foremast/Foremast+Logo-text-300.png +.. image:: _docs/_static/Foremast+Logo-text-300.png :align: center diff --git a/_docs/_static/Foremast+Logo-text-300.png b/_docs/_static/Foremast+Logo-text-300.png new file mode 100644 index 000000000..cea433d34 Binary files /dev/null and b/_docs/_static/Foremast+Logo-text-300.png differ diff --git a/_docs/_static/gogo-pipeline.png b/_docs/_static/foremast-pipeline.png similarity index 100% rename from _docs/_static/gogo-pipeline.png rename to _docs/_static/foremast-pipeline.png diff --git a/_docs/advance_usages.rst b/_docs/advance_usages.rst index 056d2ce0f..e74a785d1 100644 --- a/_docs/advance_usages.rst +++ b/_docs/advance_usages.rst @@ -51,7 +51,7 @@ Both methods will generate the same outcome. An application created in Spinnaker Method 1 ******** -This is our recommended method and how we internally at Gogo run Foremast. You need to first set the environment variables from above. +This is the recommended method on how to run Foremast. You need to first set the environment variables from above. With the environment variables defined, you can simply run the command ``foremast-pipeline`` from the command line. This will create the Application in Spinnaker as well as generate a base pipeline. @@ -70,4 +70,4 @@ Next Steps ---------- Take a look at the :doc:`infra_assumptions` docs for details on the necessary Jenkins jobs. -This is only the tip of what Foremast can do. It also has functionality for creating scaling policies, setting up AWS infrastructure (elbs, security groups, iam policies, s3 buckets), sending slack notifications, and destroying old infrastructure. Take a look at our internal workflow docs for more detail on how Foremast is used at Gogo. +Since Foremast is based on Jinja templates, it can be extended to do anything you need. For example, you can add functionality for creating scaling policies, setting up AWS infrastructure (elbs, security groups, iam policies, s3 buckets), sending slack notifications, and destroying old infrastructure. Take a look at our internal workflow docs for more detail on how Foremast is used at various organizations! diff --git a/_docs/configuration_files/foremast_config.rst b/_docs/configuration_files/foremast_config.rst index ce37382ba..02a6faad3 100644 --- a/_docs/configuration_files/foremast_config.rst +++ b/_docs/configuration_files/foremast_config.rst @@ -389,7 +389,7 @@ Section handling the naming convention of applications, elb, iam, s3 buckets and other services. The most common sections are shown. The complete list of sections and defaults -are defined by the underlying library gogo-utils_. +are defined by the underlying library foremast-utils_. Any of the possible variables below can be used as the value. @@ -463,7 +463,7 @@ keyed by task name. This section only applies to AWS environments. | *Default*: 120 | *Required*: No -.. _gogo-utils: https://github.com/gogoair/gogo-utils#formats +.. _foremast-utils: https://github.com/foremast/foremast-utils#formats .. _gcp-section: diff --git a/_docs/getting_started.rst b/_docs/getting_started.rst index 03df3ff34..3ff48cd22 100644 --- a/_docs/getting_started.rst +++ b/_docs/getting_started.rst @@ -45,9 +45,9 @@ Method 2 - Using git .. code-block:: sh - $ git clone https://github.com/gogoit/foremast.git + $ git clone https://github.com/foremast/foremast.git $ cd foremast - $ pip3 install -U . + $ pip install -U . Configuration Files ******************* diff --git a/_docs/pipeline_examples.rst b/_docs/pipeline_examples.rst index a34e2b3d8..ff02a264f 100644 --- a/_docs/pipeline_examples.rst +++ b/_docs/pipeline_examples.rst @@ -14,9 +14,9 @@ transition. Default Pipeline Flow --------------------- -The below flow can repeat for as many environments as defined in the configs. At -Gogo, most applications go through these stages 3 times as we deploy to dev, -stage, and production. +The below flow can repeat for as many environments as defined in the configs. +In general, most applications repeat a common set of stages 2-3 times. Typically, +the same way to deploy to dev (if used), stage, and production. 1. Configuration @@ -77,11 +77,11 @@ templates. Example Workflow ----------------- -At Gogo we have a detailed workflow for using Foremast internally. Feel free to -copy our workflow or use it as inspiration for your own. You can view all of our +Most Foremast users have a detailed workflow for using Foremast internally. Feel free to +copy this example workflow or use it as inspiration for your own. You can view all of our internal templates on the `foremast-templates repo`_. -.. image:: _static/gogo-pipeline.png +.. image:: _static/foremast-pipeline.png #. The :ref:`application_json` and :ref:`pipeline_json` are bundled directly with the application code diff --git a/_docs/requirements.txt b/_docs/requirements.txt index cedb57d26..198aa6390 100644 --- a/_docs/requirements.txt +++ b/_docs/requirements.txt @@ -1,7 +1,7 @@ awscli boto3 deepmerge -gogo-utils +foremast-utils jinja2 pluginbase python-gitlab diff --git a/requirements.txt b/requirements.txt index cedb57d26..198aa6390 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ awscli boto3 deepmerge -gogo-utils +foremast-utils jinja2 pluginbase python-gitlab diff --git a/src/foremast/app/__main__.py b/src/foremast/app/__main__.py index 77d400351..9910d7652 100644 --- a/src/foremast/app/__main__.py +++ b/src/foremast/app/__main__.py @@ -20,7 +20,7 @@ import argparse import logging -import gogoutils +import foremastutils from ..args import add_app, add_debug, add_properties, add_provider from ..consts import APP_FORMATS, LOGGING_FORMAT @@ -48,8 +48,8 @@ def main(): logging.getLogger(__package__.split('.')[0]).setLevel(args.debug) if args.git and args.git != 'None': - parsed = gogoutils.Parser(args.git).parse_url() - generated = gogoutils.Generator(*parsed, formats=APP_FORMATS) + parsed = foremastutils.Parser(args.git).parse_url() + generated = foremastutils.Generator(*parsed, formats=APP_FORMATS) project = generated.project repo = generated.repo else: diff --git a/src/foremast/configs/__main__.py b/src/foremast/configs/__main__.py index 07e712eef..7addabb69 100644 --- a/src/foremast/configs/__main__.py +++ b/src/foremast/configs/__main__.py @@ -20,7 +20,7 @@ import argparse import logging -import gogoutils +import foremastutils from ..args import add_debug from ..consts import APP_FORMATS, LOGGING_FORMAT @@ -45,7 +45,7 @@ def main(): LOG.setLevel(args.debug) logging.getLogger(__package__.split('.')[0]).setLevel(args.debug) - generated = gogoutils.Generator(*gogoutils.Parser(args.git_short).parse_url(), formats=APP_FORMATS) + generated = foremastutils.Generator(*foremastutils.Parser(args.git_short).parse_url(), formats=APP_FORMATS) git_short = generated.gitlab()['main'] if args.runway_dir: diff --git a/src/foremast/configs/outputs.py b/src/foremast/configs/outputs.py index 519cf117d..faef5bd35 100644 --- a/src/foremast/configs/outputs.py +++ b/src/foremast/configs/outputs.py @@ -18,7 +18,7 @@ import logging from pprint import pformat -import gogoutils +import foremastutils from ..consts import APP_FORMATS from ..utils import DeepChainMap, get_template @@ -79,7 +79,7 @@ def write_variables(app_configs=None, out_file='', git_short=''): Returns: dict: Configuration equivalent to the JSON output. """ - generated = gogoutils.Generator(*gogoutils.Parser(git_short).parse_url(), formats=APP_FORMATS) + generated = foremastutils.Generator(*foremastutils.Parser(git_short).parse_url(), formats=APP_FORMATS) json_configs = {} for env, configs in app_configs.items(): diff --git a/src/foremast/consts.py b/src/foremast/consts.py index 03c50c27d..f272a0bd4 100644 --- a/src/foremast/consts.py +++ b/src/foremast/consts.py @@ -78,7 +78,7 @@ def validate_key_values(config_handle, section, key, default=None): def extract_formats(config_handle): """Get application formats. - See :class:`gogoutils.Formats` for available options. + See :class:`foremastutils.Formats` for available options. Args: config_handle (configparser.ConfigParser): Instance of configurations. diff --git a/src/foremast/pipeline/construct_pipeline_block.py b/src/foremast/pipeline/construct_pipeline_block.py index 2374108b2..c13303d83 100644 --- a/src/foremast/pipeline/construct_pipeline_block.py +++ b/src/foremast/pipeline/construct_pipeline_block.py @@ -115,7 +115,7 @@ def construct_pipeline_block(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Gogo Application name generator. + generated (foremastutils.Generator): Foremast Application name generator. kwargs (dict): Extra variables to pass to Pipeline Templates. previous_env (str): The previous deploy environment to use as Trigger. @@ -181,7 +181,7 @@ def ec2_pipeline_setup( """Handles ec2 pipeline data setup Args: - generated (gogoutils.Generator): Generated naming formats. + generated (foremastutils.Generator): Generated naming formats. project (str): Group name of application settings (dict): Environment settings from configurations. env (str): Deploy environment name, e.g. dev, stage, prod. @@ -239,7 +239,7 @@ def ec2_pipeline_setup( grace_period = hc_grace_period + app_grace_period # TODO: Migrate the naming logic to an external library to make it easier - # to update in the future. Gogo-Utils looks like a good candidate + # to update in the future. foremast-utils looks like a good candidate ssh_keypair = data['asg'].get('ssh_keypair', None) if not ssh_keypair: ssh_keypair = '{0}_{1}_default'.format(env, region) diff --git a/src/foremast/pipeline/construct_pipeline_block_cloudfunction.py b/src/foremast/pipeline/construct_pipeline_block_cloudfunction.py index 0ae37f8ff..18eb4fdb2 100644 --- a/src/foremast/pipeline/construct_pipeline_block_cloudfunction.py +++ b/src/foremast/pipeline/construct_pipeline_block_cloudfunction.py @@ -37,7 +37,7 @@ def construct_pipeline_block_cloudfunction(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Gogo Application name generator. + generated (foremastutils.Generator): Foremast Application name generator. previous_env (str): The previous deploy environment to use as Trigger. region (str): GCP Region to deploy to. diff --git a/src/foremast/pipeline/construct_pipeline_block_datapipeline.py b/src/foremast/pipeline/construct_pipeline_block_datapipeline.py index 14a67e74c..bf2a15773 100644 --- a/src/foremast/pipeline/construct_pipeline_block_datapipeline.py +++ b/src/foremast/pipeline/construct_pipeline_block_datapipeline.py @@ -37,7 +37,7 @@ def construct_datapipeline(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Gogo Application name generator. + generated (foremastutils.Generator): Foremast Application name generator. previous_env (str): The previous deploy environment to use as Trigger. region (str): AWS Region to deploy to. diff --git a/src/foremast/pipeline/construct_pipeline_block_lambda.py b/src/foremast/pipeline/construct_pipeline_block_lambda.py index b19c11f6d..27538c032 100644 --- a/src/foremast/pipeline/construct_pipeline_block_lambda.py +++ b/src/foremast/pipeline/construct_pipeline_block_lambda.py @@ -39,7 +39,7 @@ def construct_pipeline_block_lambda(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Gogo Application name generator. + generated (foremastutils.Generator): Foremast Application name generator. previous_env (str): The previous deploy environment to use as Trigger. region (str): AWS Region to deploy to. diff --git a/src/foremast/pipeline/construct_pipeline_block_s3.py b/src/foremast/pipeline/construct_pipeline_block_s3.py index 0eb237ada..e06a09579 100644 --- a/src/foremast/pipeline/construct_pipeline_block_s3.py +++ b/src/foremast/pipeline/construct_pipeline_block_s3.py @@ -37,7 +37,7 @@ def construct_pipeline_block_s3(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Gogo Application name generator. + generated (foremastutils.Generator): Foremast Application name generator. previous_env (str): The previous deploy environment to use as Trigger. region (str): AWS Region to deploy to. diff --git a/src/foremast/pipeline/construct_pipeline_block_stepfunction.py b/src/foremast/pipeline/construct_pipeline_block_stepfunction.py index c74e09580..b6f9727ed 100644 --- a/src/foremast/pipeline/construct_pipeline_block_stepfunction.py +++ b/src/foremast/pipeline/construct_pipeline_block_stepfunction.py @@ -37,7 +37,7 @@ def construct_stepfunction(env='', Args: env (str): Deploy environment name, e.g. dev, stage, prod. - generated (gogoutils.Generator): Application name generator. + generated (foremastutils.Generator): Application name generator. previous_env (str): The previous deploy environment to use as Trigger. region (str): AWS Region to deploy to. diff --git a/src/foremast/runner.py b/src/foremast/runner.py index d426c1d73..af5cc87b3 100644 --- a/src/foremast/runner.py +++ b/src/foremast/runner.py @@ -30,7 +30,7 @@ import logging import os -import gogoutils +import foremastutils from . import (autoscaling_policy, awslambda, configs, consts, datapipeline, dns, elb, iam, pipeline, s3, scheduled_actions, securitygroup, slacknotify, stepfunction, utils) @@ -65,8 +65,8 @@ def __init__(self): self.provider = os.getenv("PROVIDER", "aws") self.git_project = "{}/{}".format(self.group, self.repo) - parsed = gogoutils.Parser(self.git_project) - generated = gogoutils.Generator(*parsed.parse_url(), formats=consts.APP_FORMATS) + parsed = foremastutils.Parser(self.git_project) + generated = foremastutils.Generator(*parsed.parse_url(), formats=consts.APP_FORMATS) self.app = generated.app_name() self.trigger_job = generated.jenkins()['name'] diff --git a/src/foremast/templates/pipeline/stage-judgement-promote-s3-prod.json.j2 b/src/foremast/templates/pipeline/stage-judgement-promote-s3-prod.json.j2 index 2f53844f6..8044108c4 100644 --- a/src/foremast/templates/pipeline/stage-judgement-promote-s3-prod.json.j2 +++ b/src/foremast/templates/pipeline/stage-judgement-promote-s3-prod.json.j2 @@ -10,6 +10,6 @@ {% if data.app.approval_timeout %} "stageTimeoutMs": {{ data.app.approval_timeout }}, {% endif %} - "instructions": "By approving this S3 content promotion to {{ data.app.environment }} LATEST, I certify that:\n", + "instructions": "By approving this S3 content promotion to {{ data.app.environment }} LATEST, I certify that:\n", "comments": "application: ${ trigger.properties.APP_NAME }" } diff --git a/src/foremast/utils/apps.py b/src/foremast/utils/apps.py index 0c1771a3f..e22555832 100644 --- a/src/foremast/utils/apps.py +++ b/src/foremast/utils/apps.py @@ -16,7 +16,7 @@ """Application related utilities.""" import logging -import gogoutils +import foremastutils from ..consts import APP_FORMATS from ..exceptions import SpinnakerAppNotFound @@ -67,7 +67,7 @@ def get_details(app='groupproject', env='dev', region='us-east-1'): LOG.debug('App details: %s', app_details) group = app_details['attributes'].get('repoProjectKey') project = app_details['attributes'].get('repoSlug') - generated = gogoutils.Generator(group, project, env=env, region=region, formats=APP_FORMATS) + generated = foremastutils.Generator(group, project, env=env, region=region, formats=APP_FORMATS) LOG.debug('Application details: %s', generated) return generated diff --git a/src/foremast/utils/encoding.py b/src/foremast/utils/encoding.py index 84e088d10..6f52ce22b 100644 --- a/src/foremast/utils/encoding.py +++ b/src/foremast/utils/encoding.py @@ -32,7 +32,7 @@ def generate_encoded_user_data( Args: env (str): Deployment environment, e.g. dev, stage. region (str): AWS Region, e.g. us-east-1. - generated (gogoutils.Generator): Generated naming formats. + generated (foremastutils.Generator): Generated naming formats. group_name (str): Application group nane, e.g. core. pipeline_type (str): Type of Foremast Pipeline to configure. @@ -49,7 +49,7 @@ def generate_encoded_user_data( export CLOUD_STACK=forrest export EC2_REGION=us-east-1 export CLOUD_DOMAIN=dev.example.com - printenv | grep 'CLOUD\|EC2' | awk '$0="export "$0'>> /etc/gogo/cloud_env + printenv | grep 'CLOUD\|EC2' | awk '$0="export "$0'>> /etc/foremast/cloud_env """ # We need to handle the case of prodp and prods for different URL generation