Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Trying to make the version a variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm committed Mar 2, 2024
1 parent 28c17df commit 9d4333a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

name: Go

env:
go_version: '1.20'

on:
push:
branches: [ "main" ]
Expand All @@ -19,7 +22,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: ${{ env.go_version }}

- name: Install dependencies
run: |
go get .
Expand All @@ -35,8 +39,10 @@ jobs:
- name: Test
run: go test -v ./...

- name: Test with Go
run: go test -json > test_results-${{ env.go-version }}.json
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: go-results-${{ matrix.go-version }}
path: test-results-${{ matrix.go-version }}.json
name: go_results-${{ env.go-version }}
path: test_results-${{ env.go-version }}.json
8 changes: 0 additions & 8 deletions internal/pipes/mc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ import (
"gov.gsa.fac.backups/internal/vcap"
)

// export AWS_PRIVATE_ACCESS_KEY_ID=longtest
// export AWS_PRIVATE_SECRET_ACCESS_KEY=longtest
// export AWS_S3_PRIVATE_ENDPOINT="http://minio:9000"
// mc alias set myminio "${AWS_S3_PRIVATE_ENDPOINT}" minioadmin minioadmin
// # Do nothing if the bucket already exists.
// # https: //min.io/docs/minio/linux/reference/minio-mc/mc-mb.html
// mc mb --ignore-existing myminio/gsa-fac-private-s3

// https://bitfieldconsulting.com/golang/scripting
func Mc(in_pipe *script.Pipe, upc vcap.UserProvidedCredentials, prefix string, source_db string) *script.Pipe {
// // mc pipe myminio/gsa-fac-private-s3/backups/${PREFIX}-${FROM_DATABASE}.dump
Expand Down
10 changes: 1 addition & 9 deletions internal/pipes/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ import (
"gov.gsa.fac.backups/internal/vcap"
)

// export AWS_PRIVATE_ACCESS_KEY_ID=longtest
// export AWS_PRIVATE_SECRET_ACCESS_KEY=longtest
// export AWS_S3_PRIVATE_ENDPOINT="http://minio:9000"
// mc alias set myminio "${AWS_S3_PRIVATE_ENDPOINT}" minioadmin minioadmin
// # Do nothing if the bucket already exists.
// # https: //min.io/docs/minio/linux/reference/minio-mc/mc-mb.html
// mc mb --ignore-existing myminio/gsa-fac-private-s3

// https://bitfieldconsulting.com/golang/scripting
func S3(in_pipe *script.Pipe, up *vcap.CredentialsS3, prefix string, source_db string) *script.Pipe {
os.Setenv("ACCESS_KEY_ID", up.AccessKeyId)
os.Setenv("SECRET_ACCESS_KEY", up.SecretAccessKey)

// https://serverfault.com/questions/886562/streaming-postgresql-pg-dump-to-s3
cmd := []string{
"s3",
"cp",
Expand Down

0 comments on commit 9d4333a

Please sign in to comment.