Skip to content

Commit

Permalink
remove astro-run-dag faster (#918)
Browse files Browse the repository at this point in the history
* remove astro-run-dag faster

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix lint

* fix image build error

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
sunkickr and pre-commit-ci[bot] committed Nov 29, 2022
1 parent 321e2d6 commit 5e8b86b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,14 @@ func (d *DockerCompose) Start(imageName, settingsFile string, noCache, noBrowser
if err != nil {
fmt.Printf("Adding 'astro-run-dag' package to requirements.txt unsuccessful: %s\nManually add package to requirements.txt", err.Error())
}
defer func() {
// remove astro-run-dag from requirments.txt
err = fileutil.RemoveLineFromFile("./requirements.txt", "astro-run-dag", " # This package is needed for the astro run command. It will be removed before a deploy")
if err != nil {
fmt.Printf("Removing line 'astro-run-dag' package from requirements.txt unsuccessful: %s\n", err.Error())
}
}()
err = d.imageHandler.Build(airflowTypes.ImageBuildConfig{Path: d.airflowHome, Output: true, NoCache: noCache})
imageBuildErr := d.imageHandler.Build(airflowTypes.ImageBuildConfig{Path: d.airflowHome, Output: true, NoCache: noCache})
// remove astro-run-dag from requirments.txt
err = fileutil.RemoveLineFromFile("./requirements.txt", "astro-run-dag", " # This package is needed for the astro run command. It will be removed before a deploy")
if err != nil {
return err
fmt.Printf("Removing line 'astro-run-dag' package from requirements.txt unsuccessful: %s\n", err.Error())
}
if imageBuildErr != nil {
return imageBuildErr
}
} else {
// skip build if an imageName is passed
Expand Down

0 comments on commit 5e8b86b

Please sign in to comment.