diff --git a/up/Dockerfile b/up/Dockerfile index 63e834b..75f39f6 100644 --- a/up/Dockerfile +++ b/up/Dockerfile @@ -1,9 +1,22 @@ FROM golang:1.15 +LABEL version="1.0.0" +LABEL maintainer="Apex" +LABEL repository="http://github.com/apex/actions" +LABEL homepage="http://github.com/apex/actions/up" +LABEL "com.github.actions.name"="Up" +LABEL "com.github.actions.description"="Perform Up application operations" +LABEL "com.github.actions.icon"="chevron-up" +LABEL "com.github.actions.color"="white" + +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN apt-get install -y nodejs + ENV CI true -RUN curl -sf https://up.apex.sh/install | sh +RUN curl -sf https://raw.githubusercontent.com/apex/up/master/install.sh | sh RUN chmod +x /usr/local/bin/up RUN go get github.com/apex/actions/up/cmd/up-wrapper -ENTRYPOINT ["up-wrapper", "deploy", "--no-build"] \ No newline at end of file +ENTRYPOINT ["up-wrapper"] +CMD ["deploy", "--no-build"] \ No newline at end of file diff --git a/up/action.yml b/up/action.yml deleted file mode 100644 index 4b98871..0000000 --- a/up/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Apex Up' -description: 'Deploy & manage Up applications' -inputs: - stage: - description: 'Up stage to deploy' - required: true -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.stage }} -branding: - icon: 'chevron-up' - color: 'white' \ No newline at end of file diff --git a/up/cmd/up-wrapper/main.go b/up/cmd/up-wrapper/main.go index c93d50d..f41ff36 100644 --- a/up/cmd/up-wrapper/main.go +++ b/up/cmd/up-wrapper/main.go @@ -45,15 +45,11 @@ func main() { // proxy to up(1) start := time.Now() - // run `up upgrade` if UP_CONFIG is present - if os.Getenv("UP_CONFIG") != "" { - if err := up("upgrade"); err != nil { - log.Fatalf("error upgrading: %s\n", err) - } - } - - // run the user-specified action command - if err := up(args...); err != nil { + cmd := exec.Command("up", args...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err = cmd.Run() + if err != nil { log.Fatalf("error: %s", err) } @@ -74,12 +70,4 @@ func main() { log.Fatalf("error writing slack message: %s", err) } } -} - -// up executes with the given arguments. -func up(args ...string) error { - cmd := exec.Command("up", args...) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - return cmd.Run() -} +} \ No newline at end of file