-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the workshop examples: (#495)
* Add a bundle output to porter-tf and porter-tf-aci * Update the update/uninstall steps to not print anything * Updated porter-tf-aci to deploy a trivial webapp to ACI
- Loading branch information
1 parent
533ed71
commit ad49f02
Showing
4 changed files
with
72 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM golang:latest | ||
RUN mkdir /app | ||
ADD . /app/ | ||
WORKDIR /app | ||
RUN go build -o main . | ||
CMD ["/app/main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"os" | ||
) | ||
|
||
func handle(w http.ResponseWriter, r *http.Request) { | ||
sqlFQDN := os.Getenv("MYSQL_FQDN") | ||
if sqlFQDN == "" { | ||
http.Error(w, "couldn't find MYSQL FQDN", http.StatusInternalServerError) | ||
} | ||
|
||
w.Write([]byte(fmt.Sprintf("Hello, I'm a webserver that wants to connect to a MYSQL at %s", sqlFQDN))) | ||
} | ||
|
||
func main() { | ||
|
||
http.HandleFunc("/", handle) | ||
|
||
fmt.Printf("Server starting on port 8080\n") | ||
if err := http.ListenAndServe(":8080", nil); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters