Skip to content

Commit

Permalink
fight with glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrose14 committed Nov 11, 2023
1 parent 9b302a3 commit d030a5d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build-and-push:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand All @@ -20,6 +20,9 @@ jobs:
- name: Build
run: make build

- name: what gblic?
run: ldd --version ldd

- name: Test
run: go test ./...

Expand Down
20 changes: 13 additions & 7 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ set -e
# Getting permissions errors on local when trying to push? Run this:
# gcloud auth configure-docker us-central1-docker.pkg.dev


# Run on initial instance creation:
# > sudo apt-get update
# > sudo apt-get install podman

make webapp-linux

docker buildx build --platform linux/amd64 --build-arg BIN=bin/linux_amd64/webapp -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
HOST_IP=$(gcloud compute --project ian-rose instances describe instance-1 --zone us-central1-a --format "get(networkInterfaces[0].accessConfigs.natIP)")

#docker buildx build --platform linux/amd64 --build-arg BIN=bin/linux_amd64/webapp -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
#docker build -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
docker push us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest
#docker push us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest

ssh ianrose14@34.66.56.67 mkdir -p config/
scp config/* ianrose14@34.66.56.67:config/
scp scripts/startup.sh ianrose14@34.66.56.67:
gcloud compute --project ian-rose ssh ianrose14@instance-1 --zone us-central1-a -- mkdir -p config/
gcloud compute --project ian-rose scp --zone us-central1-a config/* ianrose14@instance-1:config/
gcloud compute --project ian-rose scp --zone us-central1-a scripts/startup.sh ianrose14@instance-1:

#scp bin/linux_amd64/webapp [email protected]:
ssh [email protected] bash ./startup.sh
ssh ianrose14@"${HOST_IP}" bash ./startup.sh
6 changes: 5 additions & 1 deletion scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ set -e
(podman stop webapp) || true
(podman rm webapp) || true

gcloud auth --quiet print-access-token | podman login -u oauth2accesstoken --password-stdin https://us-central1-docker.pkg.dev
mkdir -p data

# ref 1: https://stackoverflow.com/questions/63790529/authenticate-to-google-container-registry-with-podman
# ref 2: https://github.com/containers/podman/issues/13691#issuecomment-1081913637
gcloud auth --quiet print-access-token | podman login -u oauth2accesstoken --password-stdin us-central1-docker.pkg.dev
podman pull us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest
podman run -d -p 8080:80 -p 8443:443 --restart=no \
-v "$(pwd)/config":/root/config/ -v "$(pwd)/data":/root/data/ --name webapp \
Expand Down

0 comments on commit d030a5d

Please sign in to comment.