Compare commits

..
11 Commits
Author SHA1 Message Date
Dustin Pianalto 57072010dc Test adding migration files to container
CI / build (push) Has been cancelled
2021-01-20 22:44:17 -09:00
Dustin Pianalto ab8db644cb Test adding migration files to container
CI / build (push) Has been cancelled
2021-01-20 22:40:15 -09:00
Dustin Pianalto 1d3a218e2d Check error when running migrations
CI / build (push) Has been cancelled
2021-01-20 22:37:04 -09:00
Dustin Pianalto 080a417eff Check error when running migrations
CI / build (push) Has been cancelled
2021-01-20 22:21:01 -09:00
Dustin Pianalto 4e1fa43e8e Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 22:13:59 -09:00
Dustin Pianalto eed0ca1865 Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 22:11:22 -09:00
Dustin Pianalto 2e7b1d2531 Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 22:10:39 -09:00
Dustin Pianalto cd0fb03605 Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 22:08:22 -09:00
Dustin Pianalto cc8fff4e3d Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 21:59:24 -09:00
Dustin Pianalto 3e98bd145a Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 21:53:56 -09:00
Dustin Pianalto 36a3cd26ba Fix typo in workflow
CI / build (push) Has been cancelled
2021-01-20 21:50:13 -09:00
3 changed files with 15 additions and 7 deletions
+6 -3
View File
@@ -21,15 +21,18 @@ jobs:
id: get_version
uses: battila7/get-version-action@v2.0.0
- name: Setup Golang 1.13
- name: Setup Golang 1.15
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.15
- name: Install go-bindata and build migrations
env:
GOPATH: /home/runner/work/Geeksbot/
run: |
go get -u github.com/go-bindata/go-bindata/...
go-bindata -pkg migrations -o $GITHUB_WORKSPACE/internal/database/migrations/bindata.go $GITHUB_WORKSPACE/internal/database/migrations/
/home/runner/work/Geeksbot/bin/go-bindata -pkg migrations -o $GITHUB_WORKSPACE/internal/database/migrations/bindata.go $GITHUB_WORKSPACE/internal/database/migrations/
head $GITHUB_WORKSPACE/internal/database/migrations/bindata.go
- name: Build container image
env:
+1
View File
@@ -16,5 +16,6 @@ from alpine
WORKDIR /bin
COPY --from=dev /go/bin/geeksbot ./geeksbot
COPY --from=dev /go/src/Geeksbot/internal/database/migrations/* ./internal/database/migrations/
CMD [ "geeksbot" ]
+8 -4
View File
@@ -30,15 +30,19 @@ func ConnectDatabase(dbConnString string) {
db.SetConnMaxLifetime(300)
d, err := bindata.WithInstance(s)
if err != nil {
log.Fatal(fmt.Errorf("Cannot load migrations: %w", err))
log.Fatal(fmt.Errorf("cannot load migrations: %w", err))
}
instance, err := postgres.WithInstance(db, &postgres.Config{})
if err != nil {
log.Fatal(fmt.Errorf("Cannot create db driver: %w", err))
log.Fatal(fmt.Errorf("cannot create db driver: %w", err))
}
m, err := migrate.NewWithInstance("go-bindata", d, "postgres", instance)
if err != nil {
log.Fatal(fmt.Errorf("Cannot create migration instance: %w", err))
log.Fatal(fmt.Errorf("cannot create migration instance: %w", err))
}
m.Up()
err = m.Up()
if err != nil {
log.Fatal(fmt.Errorf("error running migrations: %w", err))
}
log.Println("Migrations Run")
}