Skip to content

Commit

Permalink
working: reduce package
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 committed Sep 21, 2023
1 parent 5b0fea1 commit 43171d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 71 deletions.
18 changes: 9 additions & 9 deletions dockerfile-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
echo "✅ Start apt get install base packages"

apt-get update \
&& apt-get -y install curl git vim \
&& apt-get -y install zip unzip \
&& apt-get -y install ca-certificates curl wget apt-transport-https lsb-release gnupg \
&& apt-get -y install jq \
&& apt-get -y install libicu~=63 \
&& apt-get -y install icu-libs~=73 \
&& apt-get -y install icu-data-full~=73 \
&& apt-get satisfy "python3-pip (<= 22.1)" -y
# install jq from https://stedolan.github.io/jq/download/
&& apt-get -y install curl git vim \
&& apt-get -y install zip unzip \
&& apt-get -y install ca-certificates curl wget apt-transport-https lsb-release gnupg \
&& apt-get -y install jq \
# && apt-get -y install libicu~=63 \
# && apt-get -y install icu-libs~=73 \
# && apt-get -y install icu-data-full~=73 \
&& apt-get satisfy "python3-pip (<= 22.1)" -y
# install jq from https://stedolan.github.io/jq/download/

# 1) 554mb

Expand Down
68 changes: 6 additions & 62 deletions github-runner-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,60 +1,3 @@
#!/usr/bin/env bash

# INTERACTIVE="FALSE"
# if [ "$(echo "$INTERACTIVE_MODE" | tr '[:upper:]' '[:lower:]')" == "true" ]; then
# INTERACTIVE="TRUE"
# fi

# # Verify some Repo URL and token have been given, otherwise we must be interactive mode.
# if [ -z "$GITHUB_REPOSITORY" ] || [ -z "$GITHUB_TOKEN" ]; then
# if [ "$INTERACTIVE" == "FALSE" ]; then
# echo "GITHUB_REPOSITORY and GITHUB_TOKEN cannot be empty"
# exit 1
# fi
# fi

# # Calculate default configuration values.
# GITHUB_REPOSITORY_BANNER="$GITHUB_REPOSITORY"
# if [ -z "$GITHUB_REPOSITORY_BANNER" ]; then
# export GITHUB_REPOSITORY_BANNER="<empty repository url>"
# fi

# if [ -z "$RUNNER_NAME" ]; then
# RUNNER_NAME="$(hostname)"
# export RUNNER_NAME
# fi

# if [ -z "$WORK_DIR" ]; then
# export WORK_DIR=".workdir"
# fi

# # Calculate runner replacement policy.
# REPLACEMENT_POLICY="\n\n\n"
# REPLACEMENT_POLICY_LABEL="FALSE"
# if [ "$(echo "$REPLACE_EXISTING_RUNNER" | tr '[:upper:]' '[:lower:]')" == "true" ]; then
# REPLACEMENT_POLICY="Y\n\n"
# REPLACEMENT_POLICY_LABEL="TRUE"
# fi

# # Configure runner interactively, or with the given replacement policy.
# printf "Configuring GitHub Runner for %s\n\t" "$GITHUB_REPOSITORY_BANNER"
# printf "Runner Name: %s\n\t" "$RUNNER_NAME"
# printf "Working Directory: %s\n\t" "$WORK_DIR"
# printf "Replace Existing Runners: %s\n" "$REPLACEMENT_POLICY_LABEL"

# # actions-runner is a folder inside the github runner zip
# if [ "$INTERACTIVE" == "FALSE" ]; then
# echo -ne "$REPLACEMENT_POLICY" | ./actions-runner/config.sh --url "$GITHUB_REPOSITORY" --token "$GITHUB_TOKEN" --name "$RUNNER_NAME" --work "$WORK_DIR" --labels "$LABELS" --disableupdate
# else
# ./actions-runner/config.sh --url "$GITHUB_REPOSITORY" --token "$GITHUB_TOKEN" --name "$RUNNER_NAME" --work "$WORK_DIR" --labels "$LABELS" --disableupdate
# fi

# # Start the runner.
# printf "Executing GitHub Runner for %s\n" "$GITHUB_REPOSITORY"
# ./actions-runner/run.sh

printf "Before token: $REPO_URL; $GITHUB_PAT; $REGISTRATION_TOKEN_API_URL;\n"

# Retrieve a short lived runner registration token using the PAT
REGISTRATION_TOKEN="$(curl -X POST -fsSL \
-H 'Accept: application/vnd.github.v3+json' \
Expand All @@ -63,10 +6,11 @@ REGISTRATION_TOKEN="$(curl -X POST -fsSL \
"$REGISTRATION_TOKEN_API_URL" \
| jq -r '.token')"

printf "After token: $REGISTRATION_TOKEN;\n"

./actions-runner/config.sh --url $REPO_URL --token $REGISTRATION_TOKEN --unattended --ephemeral --disableupdate

printf "config run successfully\n"
./actions-runner/config.sh \
--url $REPO_URL \
--token $REGISTRATION_TOKEN \
--unattended \
--ephemeral \
--disableupdate

./actions-runner/run.sh

0 comments on commit 43171d0

Please sign in to comment.