Skip to content

Commit

Permalink
Updated release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ymkjp committed Feb 15, 2019
1 parent 8da9872 commit 2ac3e17
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
32 changes: 16 additions & 16 deletions al2/helper/project_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package helper_test

import (
"flag"
"github.com/ToQoz/gopwt"
"os"
"testing"
)

func TestMain(m *testing.M) {
flag.Parse()
gopwt.Empower()
os.Exit(m.Run())
}

func TestMustProjectPath(t *testing.T) {
t.SkipNow()
}
//import (
// "flag"
// "github.com/ToQoz/gopwt"
// "os"
// "testing"
//)
//
//func TestMain(m *testing.M) {
// flag.Parse()
// gopwt.Empower()
// os.Exit(m.Run())
//}
//
//func TestMustProjectPath(t *testing.T) {
// t.SkipNow()
//}
6 changes: 5 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ variables:
steps:
-
script: bash script/ci.sh build-container
displayName: 'docker build'
displayName: 'Docker build'
-
script: bash script/ci.sh ci
displayName: 'CI'
-
script: bash script/ci.sh release
displayName: 'Release'
-
task: PublishBuildArtifacts@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
5 changes: 3 additions & 2 deletions script/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ _ci () {
}

_ () {
echo "ASSET_DIR:${ASSET_DIR}"
echo "ASSET_DIR:${ASSET_DIR:=$PWD/pkg}"
docker run --rm --interactive \
--env ASSET_DIR="${ASSET_DIR:=pkg}" \
--env ASSET_DIR="${ASSET_DIR}" \
--volume "${ASSET_DIR}:${ASSET_DIR}" \
--volume "${PWD}:/go/src/${PKG_PATH}" \
"${TAG_NAME}:${TAG_VERSION}" "$@"
}
Expand Down
7 changes: 5 additions & 2 deletions script/release.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/usr/bin/env bash

XC_ARCH=${XC_ARCH:-amd64}
XC_OS=${XC_OS:-linux darwin windows}
XC_OS=${XC_OS:-linux darwin}
VERSION=${VERSION:-v0.0.0}
BUILD_FLAGS="-X \"main.Version=${VERSION}\""
ASSET_DIR="${ASSET_DIR:=pkg}"
echo "ASSET_DIR:${ASSET_DIR}"

rm -rf pkg/*
#rm -rf pkg/*
gox \
-ldflags="${BUILD_FLAGS}" \
-os="${XC_OS}" \
-arch="${XC_ARCH}" \
-output "${ASSET_DIR}/{{.OS}}-{{.Arch}}/{{.Dir}}"

ls -la "${ASSET_DIR}/"*

0 comments on commit 2ac3e17

Please sign in to comment.