Skip to content

Commit bf8db02

Browse files
author
Tim Etchells
committed
Trying out travis changes
1 parent 3d646f6 commit bf8db02

File tree

2 files changed

+46
-32
lines changed

2 files changed

+46
-32
lines changed

.travis.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@ node_js:
1818

1919
before_install:
2020
# Copy the LICENSE into the extension directory, so it is included in the build
21-
- cp LICENSE.* dev
21+
- cp -v LICENSE.* dev
2222

2323
- cd dev
2424
- npm i -g vsce
2525
- npm i
2626

27-
- echo "Working directory $(pwd)"
28-
- echo "TSC $(./node_modules/typescript/bin/tsc --version)"
29-
# List all our source files, this way we can see if there are
30-
# any more issues due to git not handling case-sensitive fileames very well
31-
- ls -AR src/
3227
# Make sure compilation will succeed ( vsce package won't show the compilation failures >:( )
3328
# Fail the build if compile fails
3429
- npm run compile
@@ -39,30 +34,5 @@ script:
3934
- vsce package
4035

4136
after_success:
42-
# Go back to top level, then copy the vsix we just built to .
4337
- cd ..
44-
- ls -a
45-
# Checkout the 'build' branch, which will have nothing in it except the newest build.
46-
# We're going to replace that with the build we just created.
47-
#- git config user.email "[email protected]"
48-
#- git config user.name "Travis-CI"
49-
#- git fetch origin build:build
50-
#- git reset --hard build
51-
#- git checkout build
52-
# Copy in the build artifact AFTER we do the hard reset
53-
- cp dev/*.vsix .
54-
- export artifact_name="$(basename *.vsix)"
55-
- echo "The new artifact is $artifact_name"
56-
#- git add -f *.vsix
57-
- git status
58-
# This will make a commit with a name like "New build @ 6f1ea87 by Tim Etchells - further travis improvements"
59-
- export build_date="$(date +'%F %H:%M %Z')"
60-
- export commit_info="$(git log master -1 --pretty='%h by %an - %s')"
61-
- echo "$commit_info"
62-
#- 'git commit -m "New build @ $build_date" -m "$commit_info"'
63-
#- git push origin build
64-
# Artifactory push
65-
# Make sure that PRs cannot echo the artifactory credentials!
66-
- export build_info_file="build_info.txt"
67-
- printf "$build_date\n$commit_info" > "$build_info_file"
68-
- curl -u "$artifactory_username:$artifactory_apikey" "$artifactory_url/$artifact_name" -T "$artifact_name" -X PUT && curl -u "$artifactory_username:$artifactory_apikey" "$artifactory_url/$build_info_file" -T "$build_info_file" -X PUT
38+
- ./publish.sh

publish.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
# To be run from the repository root directory
4+
5+
set -ex
6+
7+
if [[ "$TRAVIS_EVENT_TYPE" != "cron" ]]; then
8+
echo "Not a cron build; not publishing"
9+
exit 1
10+
fi
11+
12+
cp "dev/*.vsix" .
13+
14+
git_repo_url="https://github.ibm.com/dev-ex/microclimate-vscode"
15+
build_info_file="build_info.txt"
16+
17+
18+
artifact_name="$(basename *.vsix)"
19+
echo "The build artifact is $artifact_name"
20+
21+
build_date="$(date +'%F %H:%M %Z')"
22+
commit_info="$(git log master -3 --pretty='%h by %an - %s')"
23+
echo "$commit_info"
24+
25+
# Artifactory upload - Remove this at OSS time
26+
printf "$build_date\n$commit_info" > "$build_info_file"
27+
curl -u "$artifactory_username:$artifactory_apikey" "$artifactory_url/$artifact_name" -T "$artifact_name" -X PUT
28+
curl -u "$artifactory_username:$artifactory_apikey" "$artifactory_url/$build_info_file" -T "$build_info_file" -X PUT
29+
30+
echo "dumb stuff";
31+
ls -l /usr/bin/python*
32+
ls -l /bin/python*
33+
echo "done dumb stuff";
34+
35+
# https://developer.github.com/v3/repos/releases/#create-a-release
36+
gh_payload_builder="import json; payload={};
37+
payload['tag_name'] = 'nightly-$build_date';
38+
payload['target_commitish'] = $TRAVIS_COMMIT;
39+
payload['prerelease'] = true;
40+
print json.dumps(payload);
41+
"
42+
gh_tag_payload="$(python2 -c $gh_payload_builder)"
43+
echo "$gh_tag_payload"
44+

0 commit comments

Comments
 (0)