-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to azure pipelines and build windows image
- Loading branch information
1 parent
d239019
commit 574dae8
Showing
16 changed files
with
147 additions
and
65 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
* | ||
!caddy | ||
!artifacts |
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,3 @@ | ||
caddy | ||
caddy.exe | ||
artifacts | ||
vendor | ||
debug.test |
This file was deleted.
Oops, something went wrong.
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
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
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,8 @@ | ||
FROM microsoft/nanoserver:1803 | ||
LABEL maintainer "Lucas Lorentz <lucaslorentzlara@hotmail.com>" | ||
|
||
EXPOSE 80 443 2015 | ||
|
||
COPY artifacts/binaries/windows/amd64/caddy.exe "C:\\caddy.exe" | ||
|
||
ENTRYPOINT ["C:\\caddy.exe"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
jobs: | ||
- job: Build_Binaries | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
|
||
variables: | ||
GOBIN: '$(GOPATH)/bin' # Go binaries path | ||
GOROOT: '/usr/local/go1.11' # Go installation path | ||
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path | ||
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code | ||
|
||
steps: | ||
- bash: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
mv !(gopath) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
displayName: 'Set up the Go workspace' | ||
- bash: | | ||
curl https://glide.sh/get | sh | ||
displayName: Install Glide | ||
- bash: ./build.sh | ||
workingDirectory: '$(modulePath)' | ||
env: | ||
ARTIFACTS: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Build | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
artifactName: binaries | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)/binaries' | ||
displayName: 'Publish Artifact' | ||
|
||
- job: Build_Images_Linux | ||
dependsOn: Build_Binaries | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download Build Artifacts' | ||
inputs: | ||
downloadPath: artifacts | ||
artifactName: binaries | ||
|
||
- bash: | | ||
./build-images-linux.sh | ||
displayName: 'Build images' | ||
- bash: | | ||
./push-images-linux.sh | ||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) | ||
displayName: 'Push images' | ||
- job: Build_Images_Windows | ||
dependsOn: Build_Binaries | ||
pool: | ||
vmImage: 'win1803' | ||
steps: | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download Build Artifacts' | ||
inputs: | ||
downloadPath: artifacts | ||
artifactName: binaries | ||
|
||
- bash: | | ||
./build-images-windows.sh | ||
displayName: 'Build images' | ||
- bash: | | ||
./push-images-windows.sh | ||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) | ||
displayName: 'Push images' |
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,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker build -t lucaslorentz/caddy-docker-proxy:ci -f Dockerfile . | ||
docker build -t lucaslorentz/caddy-docker-proxy:ci-alpine -f Dockerfile-alpine . | ||
|
||
docker build -t lucaslorentz/caddy-docker-proxy:ci-arm32v6 -f Dockerfile-arm32v6 . | ||
docker build -t lucaslorentz/caddy-docker-proxy:ci-alpine-arm32v6 -f Dockerfile-alpine-arm32v6 . |
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,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker build -t lucaslorentz/caddy-docker-proxy:ci-nanoserver-1803 -f Dockerfile-nanoserver-1803 . |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker login -u lucaslorentz -p "%DOCKER_PASSWORD%" | ||
|
||
docker push lucaslorentz/caddy-docker-proxy:ci-nanoserver-1803 | ||
|
||
if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then | ||
echo "Releasing version ${RELEASE_VERSION}..." | ||
|
||
PATCH_VERSION=$(echo $RELEASE_VERSION | cut -c2-) | ||
MINOR_VERSION=$(echo $PATCH_VERSION | cut -d. -f-2) | ||
|
||
docker login -u lucaslorentz -p "$DOCKER_PASSWORD" | ||
|
||
# nanoserver-1803 | ||
docker tag lucaslorentz/caddy-docker-proxy:ci-nanoserver-1803 lucaslorentz/caddy-docker-proxy:nanoserver-1803 | ||
docker tag lucaslorentz/caddy-docker-proxy:ci-nanoserver-1803 lucaslorentz/caddy-docker-proxy:${PATCH_VERSION}-nanoserver-1803 | ||
docker tag lucaslorentz/caddy-docker-proxy:ci-nanoserver-1803 lucaslorentz/caddy-docker-proxy:${MINOR_VERSION}-nanoserver-1803 | ||
docker push lucaslorentz/caddy-docker-proxy:nanoserver-1803 | ||
docker push lucaslorentz/caddy-docker-proxy:${PATCH_VERSION}-nanoserver-1803 | ||
docker push lucaslorentz/caddy-docker-proxy:${MINOR_VERSION}-nanoserver-1803 | ||
fi |