-
Notifications
You must be signed in to change notification settings - Fork 0
Home
guidelines
project wiki
Devel setup
First set up your github account to
- use ssh keys
- use 2fa
-
use gpg
- ! the gpg email must match
git config --global user.email
- ! the gpg email must match
And remember to sign any commits pushed to the galaxy_ng repo.
Fork backend and the UI, and clone...
GITHUB_USER=himdel # update accordingly
git clone [email protected]:$GITHUB_USER/galaxy_ng.git
git clone [email protected]:$GITHUB_USER/ansible-hub-ui.git
cd galaxy_ng
git remote add upstream https://github.com/ansible/galaxy_ng
cd ../ansible-hub-ui
git remote add upstream https://github.com/ansible/ansible-hub-ui
Set up..
cd ansible-hub-ui
UI_DIR=`pwd`
cd ../galaxy_ng
cp .compose.env.example .compose.env
sed -i 's#^.*ANSIBLE_HUB_UI_PATH.*$#ANSIBLE_HUB_UI_PATH='\'"$UI_DIR"\''#' .compose.env
# build
./compose build
# load initial data
./compose up -d postgres redis
./compose run --rm api manage migrate
./compose run --rm -e PULP_FIXTURE_DIRS='["/src/galaxy_ng/dev/automation-hub"]' api manage loaddata initial_data.json
./compose down
cd galaxy_ng
./compose down # if running
./compose build
cd galaxy_ng
./compose up
Just ^C to stop (foreground), or ./compose down
when running ./compose up -d
(background).
Create ansible-hub-ui/test/cypress.env.json
:
{
"prefix": "/api/automation-hub",
"username": "admin",
"password": "admin"
}
Run
cd ansible-hub-ui/test # test/
npm ci
npm run cypress:chrome # or cypress:chromium or cypress:firefox
cd galaxy_ng
./compose run --rm api manage shell # skip shell to see more tasks
cd galaxy_ng
# compose up must be running already
./compose exec postgres psql -U galaxy_ng galaxy_ng
the credentials come from galaxy_ng/dev/common/postgres.env
.
For pg_dump (FIXME: once https://github.com/ansible/galaxy_ng/pull/691 is merged):
cd galaxy_ng
# compose up must be running already
./compose exec postgres pg_dump -U galaxy_ng galaxy_ng -Fc > pg.dump
Ang pg_restore:
cd galaxy_ng
# compose must be down
./compose up -d postgres redis
./compose exec -T postgres pg_restore -U galaxy_ng -d galaxy_ng -cC /dev/stdin < pg.dump
./compose run --rm api manage migrate
./compose down
FIXME: does this ^ work yet? needs pg superuser?
cd galaxy_ng
./compose down # can't run both at the same time
export DEV_IMAGE_SUFFIX=any_unique_string
./compose build
# see "load initial data"..
./compose up
unset DEV_IMAGE_SUFFIX
cd galaxy_ng
./compose down -v # stop and drop data
# see "load initial data" above
or
docker system prune -v # remove all built containers and data
# see "build" and "load initial data" above
VersionConflict
during ./compose up
:
`pkg_resources.VersionConflict: (pulp-ansible 0.7.0 (/venv/lib/python3.6/site-packages), Requirement.parse('pulp-ansible==0.7.1'))
Solution: rebuild
Hang during ./compose build
(but not the ~10 minutes on chown
):
check the firewall is allowing connections betweeen docker containers, or disable firewall