mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-24 03:21:40 +03:00
Remove Travis-CI
This commit is contained in:
parent
81becd7c02
commit
142dc14a21
54
.travis.yml
54
.travis.yml
@ -1,54 +0,0 @@
|
||||
language: rust
|
||||
sudo: true
|
||||
rust:
|
||||
- 1.47.0
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: "Build"
|
||||
os: linux
|
||||
dist: bionic
|
||||
before_script:
|
||||
- ci/setup.sh || travis_terminate 1
|
||||
script:
|
||||
- ci/check.sh
|
||||
- ./build.sh || travis_terminate 1
|
||||
- export PATH="$PWD/target/debug:$PATH"
|
||||
- integration/integration.sh
|
||||
|
||||
- stage: "Release"
|
||||
os: linux
|
||||
dist: bionic
|
||||
before_script:
|
||||
- export VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"')
|
||||
- sudo apt install -y libcurl4-openssl-dev
|
||||
script:
|
||||
- ci/man.sh
|
||||
- ci/release.sh
|
||||
- ci/create_tarball.sh linux
|
||||
- ci/deb.sh
|
||||
deploy:
|
||||
provider: script
|
||||
script: ci/deploy.sh
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branch: true
|
||||
tags: true
|
||||
|
||||
- stage: "Release"
|
||||
os: osx
|
||||
before_script:
|
||||
- brew install jq
|
||||
- export VERSION=$(grep '^version' packages/hurl/Cargo.toml | cut -f2 -d'"')
|
||||
script:
|
||||
- ci/man.sh
|
||||
- ci/release.sh
|
||||
- ci/create_tarball.sh osx
|
||||
deploy:
|
||||
provider: script
|
||||
script: ci/deploy.sh
|
||||
skip_cleanup: true
|
||||
on:
|
||||
all_branch: true
|
||||
tags: true
|
||||
|
14
ci/check.sh
14
ci/check.sh
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
shellcheck ./*.sh ./*/*.sh
|
||||
|
||||
# watch eprintln!/eprintln!
|
||||
find src -name "*.rs" | grep -E -v 'logger|hurlfmt|http/client|hurl_file' | while read -r f; do
|
||||
if grep -q eprintln "$f"; then
|
||||
echo "file '$f' contains a println!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
done
|
26
ci/deploy.sh
26
ci/deploy.sh
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
echo check git tag
|
||||
TAG=$(git tag --points-at HEAD |tr -d '\n')
|
||||
if [ "$TAG" == "" ]; then
|
||||
echo "Tag is not set"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$TAG" != "$VERSION" ]; then
|
||||
echo "Tag '$TAG' does not match version '$VERSION'"
|
||||
exit 1
|
||||
fi
|
||||
echo tag matches version
|
||||
|
||||
|
||||
ci/upload.sh "$VERSION" target/upload/*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
28
ci/setup.sh
28
ci/setup.sh
@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
#ROOT_DIR=$(pwd)
|
||||
|
||||
rustup component add clippy
|
||||
rustup component add rustfmt
|
||||
|
||||
cargo clippy --version
|
||||
cargo fmt --version
|
||||
cargo install cargo-deb
|
||||
|
||||
# Python/Flask
|
||||
sudo apt-get install -y python3-pip
|
||||
python3 -V
|
||||
pip3 install Flask
|
||||
(cd integration && python3 server.py&)
|
||||
|
||||
|
||||
# Mitmproxy
|
||||
wget https://snapshots.mitmproxy.org/5.2/mitmproxy-5.2-linux.tar.gz -O - | tar -xz
|
||||
./mitmdump -p 8888 --modify-header "/From-Proxy/Hello" &
|
||||
|
||||
sleep 2
|
||||
netstat -an | grep LISTEN | grep -E '8000|8888'
|
||||
|
||||
|
45
ci/upload.sh
45
ci/upload.sh
@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
tag=$1
|
||||
shift
|
||||
|
||||
API_URL="https://api.github.com"
|
||||
REPO_NAME=hurl
|
||||
repo_url="$API_URL/repos/Orange-OpenSource/$REPO_NAME"
|
||||
auth_header="Authorization: token $GITHUB_API_TOKEN"
|
||||
|
||||
echo "Uploading to $REPO_NAME for tag $tag"
|
||||
release_id=$(curl -s -H "$auth_header" "$repo_url/releases/tags/$tag" | jq '.id')
|
||||
upload_url=https://uploads.github.com/repos/Orange-OpenSource/$REPO_NAME/releases/$release_id/assets
|
||||
echo "release from tag: $release_id"
|
||||
|
||||
|
||||
asset_files=$*
|
||||
|
||||
for asset_file in $asset_files; do
|
||||
echo "Uploading asset file $asset_file"
|
||||
if [ ! -f "$asset_file" ]; then
|
||||
echo "does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
asset_name=$(basename "$asset_file")
|
||||
asset_url="https://github.com/Orange-OpenSource/$REPO_NAME/releases/download/$VERSION/$asset_name"
|
||||
echo "asset url: $asset_url"
|
||||
|
||||
if curl --output /dev/null --silent --head --fail "$asset_url"; then
|
||||
echo "File already uploaded"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -v -X POST \
|
||||
-H "$auth_header" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@$asset_file" "$upload_url?name=$asset_name"
|
||||
|
||||
done
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user