Skip to content

Commit 9e9cd89

Browse files
committed
db
1 parent 1d03b9d commit 9e9cd89

File tree

7 files changed

+21
-63
lines changed

7 files changed

+21
-63
lines changed

.github/workflows/docker-s3-deploy.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@ jobs:
2828
exit 1
2929
fi
3030
31-
- name: Import GPG key
32-
uses: crazy-max/ghaction-import-gpg@v6
33-
with:
34-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
35-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
36-
37-
- name: Sign tron-docker.zip with GPG
38-
run: |
39-
gpg --detach-sign --armor tron-docker.zip
40-
# This creates tron-docker.zip.asc (ASCII-armored signature)
41-
42-
- name: Export GPG public key to tron-docker-099228E1.pub
43-
run: |
44-
gpg --armor --export > tron-docker-099228E1.pub
45-
# Optional: Set restrictive permissions
46-
chmod 600 tron-docker-099228E1.pub
47-
4831
- name: Configure AWS Credentials
4932
uses: aws-actions/configure-aws-credentials@v4
5033
with:
@@ -54,8 +37,5 @@ jobs:
5437

5538
- name: Upload tron-docker.zip to S3
5639
run: |
57-
aws s3 cp tron-docker-099228E1.pub s3://${{ github.event.inputs.bucket-name }}/public-keys/tron-docker-099228E1.pub
58-
aws s3 cp tron-docker.zip.asc s3://${{ github.event.inputs.bucket-name }}/signatures/tron-docker-latest.asc
59-
zip -r tron-docker.zip.zip tron-docker.zip
60-
aws s3 cp tron-docker.zip.zip s3://${{ github.event.inputs.bucket-name }}/package/publish-latest.zip.zip
61-
aws s3 cp tron-docker.zip.zip s3://${{ github.event.inputs.bucket-name }}/package/publish-v0.0.1.zip.zip
40+
aws s3 cp tron-docker.zip s3://${{ github.event.inputs.bucket-name }}/package/publish-latest.zip
41+
aws s3 cp tron-docker.zip s3://${{ github.event.inputs.bucket-name }}/package/publish-v0.1.1.zip

tools/docker/codepipeline/appspec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 0.0
22
os: linux
33
files:
4-
- source: docker-compose.fullnode.nile.yml
5-
destination: /home/ubuntu/yk/mydev/tron-docker/
4+
- source: docker-compose.fullnode.main.yml
5+
destination: /data/tron-node/tron-docker/
66
hooks:
77
BeforeInstall:
88
- location: prepare_environment.sh

tools/docker/codepipeline/prepare_environment.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/bin/bash
22

3-
TARGET_DIR="/home/ubuntu/yk/mydev/tron-docker/"
4-
DOCKER_COMPOSE_FILE="docker-compose.fullnode.nile.yml"
3+
TARGET_DIR="/data/tron-node/tron-docker/"
4+
DOCKER_COMPOSE_FILE="docker-compose.fullnode.mail.yml"
55

66
cd ${TARGET_DIR} || exit
7-
./trond node run-single stop -t full-nile -f ${DOCKER_COMPOSE_FILE}
7+
./trond node run-single stop -t full-main -f ${DOCKER_COMPOSE_FILE}
88

99
# Wait and check if container is stopped
1010
max_attempts=30 # 2 minutes total (30 * 10 seconds)
1111
attempt=1
1212

1313
while [ $attempt -le $max_attempts ]; do
14-
if ! docker-compose -f ${DOCKER_COMPOSE_FILE} ps --services --filter "status=running" | grep -q "tron-node-nile"; then
14+
if ! docker-compose -f ${DOCKER_COMPOSE_FILE} ps --services --filter "status=running" | grep -q "tron-node-mainnet"; then
1515
echo "Container successfully stopped"
1616
exit 0
1717
fi

tools/docker/codepipeline/start_service.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/bin/bash
22

3-
TARGET_DIR="/home/ubuntu/yk/mydev/tron-docker/"
4-
DOCKER_COMPOSE_FILE="docker-compose.fullnode.nile.yml"
3+
TARGET_DIR="/data/tron-node/tron-docker/"
4+
DOCKER_COMPOSE_FILE="docker-compose.fullnode.mail.yml"
55

66
cd ${TARGET_DIR} || exit
7-
./trond node run-single -t full-nile -f ${DOCKER_COMPOSE_FILE}
7+
./trond node run-single -t full-main -f ${DOCKER_COMPOSE_FILE}
88

99
# Check if container is running
1010
max_attempts=12 # 2 minutes total (12 * 10 seconds)
1111
attempt=1
1212

1313
while [ $attempt -le $max_attempts ]; do
14-
if docker-compose -f ${DOCKER_COMPOSE_FILE} ps --services --filter "status=running" | grep -q "tron-node-nile"; then
14+
if docker-compose -f ${DOCKER_COMPOSE_FILE} ps --services --filter "status=running" | grep -q "tron-node-mainnet"; then
1515
echo "Container is running, proceeding to API check"
1616
break
1717
fi

tools/docker/codepipeline/validate_service.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/bin/bash
22

3+
TARGET_DIR="/data/tron-node/tron-docker/"
4+
DOCKER_COMPOSE_FILE="docker-compose.fullnode.mail.yml"
5+
36
# API health check
47
max_attempts=30 # 5 minutes total (30 * 10 seconds)
58
attempt=1
69

710
while [ $attempt -le $max_attempts ]; do
811
response=$(curl -s -X POST http://127.0.0.1:8090/wallet/getblock \
912
-H 'Content-Type: application/json; charset=utf-8' \
10-
-H 'Host: api.trongrid.io' \
11-
-H 'User-Agent: RapidAPI/4.2.8 (Macintosh; OS X/15.3.1) GCDHTTPRequest' \
1213
-d '{"detail":false}')
1314

1415
if [ -n "$response" ]; then
@@ -23,10 +24,7 @@ done
2324

2425
echo "Node API failed to respond after 5 minutes"
2526

26-
TARGET_DIR="/home/ubuntu/yk/mydev/tron-docker/"
27-
DOCKER_COMPOSE_FILE="docker-compose.fullnode.nile.yml"
28-
2927
cd ${TARGET_DIR} || exit
30-
./trond node run-single stop -t full-nile -f ${DOCKER_COMPOSE_FILE}
28+
./trond node run-single stop -t full-main -f ${DOCKER_COMPOSE_FILE}
3129

3230
exit 1

tools/docker/docker_env/check-install-docker.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ check_docker_running() {
4747
echo "Starting Docker daemon..."
4848
sudo systemctl start docker
4949
sleep 5
50+
sudo usermod -aG docker "$USER"
51+
newgrp docker
5052
if ! docker info &> /dev/null; then
5153
echo "Failed to start Docker daemon"
5254
exit 1

tools/trond/cmd/docker/env.go

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,23 @@ var envCmd = &cobra.Command{
1616
Long: heredoc.Doc(`
1717
Check docker and docker-compose installation on Linux and Mac. If docker and docker-compose are not installed, this command will install them for you.
1818
19-
For Mac: brew install --cask docker
20-
21-
For Linux: sh get-docker.sh
19+
The tools/docker/docker_env/check-install-docker.sh script will be used to check and install docker and docker-compose.
2220
`),
2321
Example: heredoc.Doc(`
2422
# Check and install docker and docker-compose (for Linux and Mac)
2523
$ ./trond docker install-docker
2624
`),
2725
Run: func(cmd *cobra.Command, args []string) {
28-
29-
if yes, err := utils.IsJDK1_8(); err != nil || !yes {
30-
fmt.Println("Error: JDK version should be 1.8")
31-
return
32-
}
33-
34-
// Get the flag value
35-
org, _ := cmd.Flags().GetString("org")
36-
artifact, _ := cmd.Flags().GetString("artifact")
37-
version, _ := cmd.Flags().GetString("version")
38-
39-
fmt.Println("The building progress may take a long time, depending on your network speed.")
40-
fmt.Println("If you don't specify the flags for building, the default values will be used.")
41-
fmt.Println("The default result will be: tronprotocol/java-tron:latest")
42-
fmt.Println("Start building...")
4326
cmds := []string{
44-
fmt.Sprintf("./gradlew --no-daemon sourceDocker -PdockerOrgName=%s -PdockerArtifactName=%s -Prelease.releaseVersion=%s", org, artifact, version),
27+
"./check-install-docker.sh",
4528
}
46-
if err := utils.RunMultipleCommands(strings.Join(cmds, " && "), "./tools/gradlew"); err != nil {
29+
if err := utils.RunMultipleCommands(strings.Join(cmds, " && "), "./tools/docker/docker_env"); err != nil {
4730
fmt.Println("Error: ", err)
4831
return
4932
}
5033
},
5134
}
5235

5336
func init() {
54-
55-
envCmd.Flags().StringP("org", "o", "tronprotocol", "OrgName for the docker image")
56-
envCmd.Flags().StringP("artifact", "a", "java-tron", "ArtifactName for the docker image")
57-
envCmd.Flags().StringP("version", "v", "latest", "Release version for the docker image")
58-
5937
DockerCmd.AddCommand(envCmd)
6038
}

0 commit comments

Comments
 (0)