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

feat(cli): updated launcher and docker build release #290

Merged
merged 15 commits into from
Oct 1, 2024
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: karnot-arc-runner-set

steps:
- name: Checkout repository
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ on:
jobs:
create_release:
runs-on: ubuntu-latest

permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.RELEASE_ACTION }}
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
commit: ${{ github.sha }}
draft: false
prerelease: false
generateReleaseNotes: true
generateReleaseNotes: true
18 changes: 14 additions & 4 deletions scripts/launcher
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ if [ "$RPC_ACCESS" == "yes" ]; then
continue
fi

# If everything is okay, break the loop
break
done

Expand Down Expand Up @@ -508,12 +507,23 @@ done
tput rc
tput ed


# Check if the image is available locally
IMAGE_NAME="ghcr.io/madara-alliance/madara/madara:latest"
if docker images --format "{{.Repository}}:{{.Tag}}" | grep -q "$IMAGE_NAME"; then
echo -e "\n📦 ${GREEN}Docker image '$IMAGE_NAME' is already available locally.${NC}"
else
echo -e "\n🚢 ${YELLOW}${BOLD}Docker image not found locally. Pulling from GitHub Packages...${NC}"
docker login ghcr.io -u GITHUB_USERNAME -p GITHUB_TOKEN
docker pull $IMAGE_NAME
fi

# Build the final Docker run command
DOCKER_COMMAND="docker run -d --name madara-node \
-v ${BASE_PATH}:/data \
${PORT_MAPPING} \
madara \
run --${MODE} --name \"${NODE_NAME}\" ${CHAIN_CONFIG_OPT} --base-path=\"/data\" ${RPC_OPTS} --l1-endpoint \"${L1_ENDPOINT}\""
$IMAGE_NAME \
--${MODE} --name \"${NODE_NAME}\" ${CHAIN_CONFIG_OPT} --base-path=\"/data\" ${RPC_OPTS} --l1-endpoint \"${L1_ENDPOINT}\""

echo -e "\n🔄 ${YELLOW}${BOLD}The following Docker command will be executed:${NC}\n"
echo -e "${CYAN}$DOCKER_COMMAND${NC}"
Expand All @@ -533,4 +543,4 @@ if [ "$CONFIRM" == "yes" ]; then
echo -e "\n${GREEN}Madara node is now running in Docker container 'madara-node'.${NC}"
else
echo -e "${RED}Command execution aborted.${NC}"
fi
fi
Loading