Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make targets for common tasks on dev env and support for env snapshots #667

Merged
merged 3 commits into from
Mar 12, 2021

Conversation

rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Mar 5, 2021

This PR is addresses AAH-387 adding more targets to Makefile

❯ make         
Usage: make <target>

Targets:
help:             ## Show the help.
requirements:     ## Update python dependencies lock files (i.e. requirements.txt).
changelog:        ## Build the changelog
docker/build:     ## Build all development images.
docker/test:      ## Run unit tests.
docker/loaddata:  ## Load initial data from fixtures
docker/migrate:   ## Run django migrations
docker/resetdb:   ## Cleans database
api/get:          ## Make an api get request using 'httpie'
api/shell:        ## Opens django management shell in api container
api/bash:         ## Opens bash session in the api container
api/runserver:    ## Runs api using django webserver for debugging

Also some tweaks to Docker files and setup.py to enable running specific

deps branches.

  • if LOCK_REQUIREMENTS is disabled, all deps listed on DEV_SOURCE_PATH is unppined on setup.py

Adds ability to set a global suffix so it is possible to have multiple

environments already built and saved (snapshots)

Build and run environment to work on specific issue

./compose build
./compose up

OMG in the middle of my task I have to work on another issue/hotfix, do I need to rebuild my environment? lost my current state? .. No.

Build and run environment to work on specific issue

./compose stop
export DEV_IMAGE_SUFFIX=fixing_an_urgent_issue 
./compose build
./compose up

Now you can switch the state of DEV_IMAGE_SUFFIX to use whichever environment state you want, (a.k.a snapshot)

Issue: AAH-387

snapshots

This PR is addresses AAH-387 adding more targets to Makefile

Also some tweaks to Docker files and setup.py to enable running specific
deps branches.

Adds ability to set a global `suffix` so it is possible to have multiple
environments already built and saved (snapshots)

Adds utilities to run 2 instances of AAH in the same host.

Issue: AAH-387
@app-sre-bot
Copy link
Collaborator

Can one of the admins verify this patch?

setup.py Show resolved Hide resolved
compose Show resolved Hide resolved
@newswangerd
Copy link
Member

make changelog would be really nice. This is how the changelog is built: https://github.com/ansible/galaxy_ng/wiki/Updating-the-Change-Log

I think it just has to run the towncrier command.

@rochacbruno rochacbruno marked this pull request as ready for review March 10, 2021 03:47
Copy link
Contributor

@cutwater cutwater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, nice job

compose Outdated Show resolved Hide resolved
@rochacbruno rochacbruno force-pushed the AAH-387 branch 4 times, most recently from 6fcf317 to 03af3fe Compare March 11, 2021 10:56
compose Outdated Show resolved Hide resolved
Copy link
Contributor

@alikins alikins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Assuming it works for an existing checking without any manual intervention. If it does need some manual intervention, need some docs about it (I may have missed them).

@rochacbruno rochacbruno merged commit 1a541c6 into ansible:master Mar 12, 2021
@ZitaNemeckova
Copy link
Member

@rochacbruno I got this when running anything ./compose

ERROR: The $COMPOSE_PROFILE environment variable MUST be set.
       The the easiest way to to this is to create a .compose.env file by running:

           $ cp .compose.env.example .compose.env

I tried $ cp .compose.env.example .compose.env but it didn't help. So I guess it needs more fool-proof instructions for people like me :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants