Skip to content

Commit

Permalink
feat: adapt pull-request workflow and create.sh script for alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
freemvmt committed May 7, 2024
1 parent 387c2a7 commit b25f2b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
action: create
api_key: ${{ secrets.VULTR_API_KEY }}
domain: ${{ env.DOMAIN }}
os_id: 1743
os_id: 2076
plan: vc2-1c-1gb
pull_request_id: ${{ env.PULLREQUEST_ID }}
region: lhr
Expand All @@ -324,13 +324,19 @@ jobs:
password: ${{ steps.create.outputs.default_password }}
command_timeout: 20m
script: |
apt-get update -y
apk update
apk add docker
addgroup root docker
rc-update add docker default
service docker start
apk add docker-cli-compose
apk add git
git clone "${{ secrets.AUTHENTICATED_REPO_URL }}"
cd planx-new
git fetch origin "pull/${{ env.PULLREQUEST_ID }}/head" && git checkout FETCH_HEAD
apt-get install awscli -y
apk add aws-cli
export AWS_ACCESS_KEY_ID=${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }}
export AWS_REGION=eu-west-2
Expand All @@ -353,14 +359,19 @@ jobs:
password: ${{ secrets.SSH_PASSWORD }}
command_timeout: 10m
script: |
apt-get update -y
apk update
apk add docker
addgroup root docker
rc-update add docker default
service docker start
apk add docker-cli-compose
git clone "${{ secrets.AUTHENTICATED_REPO_URL }}"
cd planx-new
git add . && git stash
git fetch origin "pull/${{ env.PULLREQUEST_ID }}/head" && git checkout FETCH_HEAD
apt-get install awscli -y
apk add aws-cli
export AWS_ACCESS_KEY_ID=${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }}
export AWS_REGION=eu-west-2
Expand Down
11 changes: 1 addition & 10 deletions scripts/pullrequest/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ echo "root:$SSH_PASSWORD" | chpasswd
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04
swapon --show

# install docker
apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --batch --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y

# set env for this shell
set -o allexport
source .env.pizza
DOCKER_BUILDKIT=1
set +o allexport

# start services
docker compose \
time docker compose \
-f docker-compose.yml \
-f docker-compose.pizza.yml \
-f docker-compose.seed.yml \
Expand Down

0 comments on commit b25f2b4

Please sign in to comment.