dashpay / dash-network-deploy

Tools for Dash networks deployment and testing
MIT License
20 stars 19 forks source link

`deploy` fails with `ref HEAD is not a symbolic ref` #619

Closed coolaj86 closed 6 months ago

coolaj86 commented 6 months ago

I've set up a new AWS account with Access Keys (because I don't understand the new profile / role model yet), a delegated domain, bucket, dynamo table, and everything else that I thought I'd need to deploy this from a new container, but it failed right away with a git error.

Expected

I don't know. Definitely not a git-related error.

Perhaps an error message directing me towards some bad config or account not set up correctly.

Actual Result

Deploying devnet-ajnet network... stage (1)
fatal: ref HEAD is not a symbolic ref

How to Reproduce

ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/aws_id_rsa" -q -N ""

mkdir -p ./devnet-ajnet/
pushd ./devnet-ajnet/
git init

dash-network generate devnet-ajnet 3 0 3 0

vi .env
. ./.env

TERRAFORM_S3_BUCKET="${TERRAFORM_S3_BUCKET:-dashincubator-devnet}"
aws s3 mb "s3://${TERRAFORM_S3_BUCKET}"

TERRAFORM_DYNAMODB_TABLE="${TERRAFORM_DYNAMODB_TABLE:-di-devnet-ajnet-tf-lock}"
    aws dynamodb create-table \
        --attribute-definitions AttributeName=LockID,AttributeType=S \
        --table-name "${TERRAFORM_DYNAMODB_TABLE}" \
        --key-schema AttributeName=LockID,KeyType=HASH \
        --billing-mode PROVISIONED \
        --provisioned-throughput ReadCapacityUnits=2,WriteCapacityUnits=2 \
        --table-class STANDARD

my_zone="aws.dashincubator.dev"
my_idempotency_key="${my_zone}"
aws route53 create-hosted-zone --name "${b_zone}" --caller-reference "${b_idempotency_key}"

# added NS delegation regards on registrar to point to AWS R53 NS

vi ./devnet-ajnet.tfvars
# main_domain = "aws.dashincubator.dev"

git add .gitignore *.yml *.tfvars
git commit -m "initial commit"

dash-network deploy devnet-ajnet
ktechmidas commented 6 months ago

Fixed: https://github.com/dashpay/dash-network-deploy/pull/622

ktechmidas commented 6 months ago

It actually is git related, we use git to check the branch name to ensure we're either on the correct named branch or a different one. If it can't find a named branch it will fail (-f should now resolve it)

This is to ensure we don't deploy a testnet branch of deploy tool to a devnet and vice versa

coolaj86 commented 6 months ago

What are the valid branch name options?

I thought I had tried creating a devnet-ajnet branch. Maybe not. I didn't connect it to a repo though, it's just local.

Must it have a remote to be valid?

ktechmidas commented 6 months ago

Seems it must! I just tested and replicated that as well, at least you can bypass this with a -f once my PR goes in (or fork the repo to create new branches)

ktechmidas commented 6 months ago

Closing as we fixed in latest