Skip to content

Commit

Permalink
try shell script to confirm docker login
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Sep 20, 2024
1 parent a08875b commit 8de8abb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build_test_docker_x86.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}

- name: Configure AWS
run: |
aws configure set aws_access_key_id ${{ secrets.aws_access_key_id }}
aws configure set aws_secret_access_key ${{ secrets.aws_secret_access_key }}
aws configure set region us-east-1
aws configure set region us-east-1 3
- name: Install packages for datastream
run: |
Expand Down
10 changes: 10 additions & 0 deletions research_datastream/terraform/test/docker_loginNpush.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [ "$(echo $DOCKERHUB_TOKEN | docker login -u $DOCKERHUB_USERNAME --password-stdin)" == "Login Succeeded" ]; then
echo "Docker login successful"
./scripts/docker_builds.sh -p
echo "Push complete"
else
echo "Docker login failed"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"commands" : [
"runuser -l ec2-user -c 'rm -rf /home/ec2-user/ngen-datastream && git clone -b test_terraform https://github.com/CIROH-UA/ngen-datastream.git'",
"runuser -l ec2-user -c 'cd /home/ec2-user/ngen-datastream && ./scripts/docker_builds.sh -b'",
"runuser -l ec2-user -c 'curl -L -O https://ngen-datastream.s3.us-east-2.amazonaws.com/palisade.gpkg'",
"runuser -l ec2-user -c './scripts/stream.sh -s 202006200100 -e 202006200200 -C NWM_RETRO_V3 -d $(pwd)/data/datastream_test -g $(pwd)/palisade.gpkg -R $(pwd)/configs/ngen/realization_sloth_nom_cfe_pet.json -n 4'",
"runuser -l ec2-user -c 'echo $(aws secretsmanager get-secret-value --secret-id docker_awiciroh_creds --region us-east-1 --query SecretString --output text | jq -r .DOCKERHUB_TOKEN) | docker login -u $(aws secretsmanager get-secret-value --secret-id docker_awiciroh_creds --region us-east-1 --query SecretString --output text | jq -r .DOCKERHUB_USERNAME) --password-stdin && ./scripts/docker_builds.sh -p'"
"runuser -l ec2-user -c './research_datastream/terraform/test/docker_loginNpush.sh'"
],
"run_options":{
"ii_detach_volume" : true,
Expand Down

0 comments on commit 8de8abb

Please sign in to comment.