Skip to content

Commit a66905b

Browse files
committed
push builds to artifactory
Signed-off-by: Andrew Twydell <[email protected]>
1 parent c51bf99 commit a66905b

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ skip_list:
33
- "name[template]"
44
- "args[module]"
55
- "yaml[line-length]"
6+
- "yaml[truthy]"
67
- "galaxy[no-changelog]"
78
- "meta-unsupported-ansible"
89
- "meta-runtime[unsupported-version]"

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ matrix:
3131
env: ANSIBLE_VERSION="stable-2.11"
3232
services:
3333
- docker
34-
before_script: source .travis/get_artifactory_creds.sh
34+
before_script: source .travis/get_vault_data.sh
3535
script: |
3636
echo ""
3737
echo "#############################################"
@@ -54,3 +54,12 @@ script: |
5454
-e TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION \
5555
$DOCKER_REGISTRY/$IMAGE_NAME:latest \
5656
bash -c "cd /root/ansible_collections/ibm/ibm_zos_cics && bash .travis/build_and_test.sh"
57+
58+
jobs:
59+
include:
60+
- stage: deploy
61+
script: bash .travis/push_artifactory.sh
62+
python: "3.10"
63+
env: ANSIBLE_VERSION="stable-2.14"
64+
on:
65+
branch: main

.travis/push_artifactory.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
pip install https://github.com/ansible/ansible/archive/stable-2.14.tar.gz
6+
7+
ansible-galaxy collection build "$TRAVIS_BUILD_DIR" --force
8+
9+
file_with_prefix="$(find . -type f -iname "ibm-ibm_zos_cics-*")"
10+
file="${file_with_prefix//.\//}"
11+
no_extension="${file//.tar.gz/}"
12+
no_starting="${no_extension//.\//}"
13+
version_number="${no_starting//ibm-ibm_zos_cics-/}"
14+
TRAVIS_NO_DOT="${TRAVIS_JOB_NUMBER//./D}"
15+
16+
echo ""
17+
echo "##########################################################"
18+
echo "############# Uploading build to Artifactory #############"
19+
echo "##########################################################"
20+
echo "#"
21+
echo "# File: $file"
22+
echo "# Version: $version_number"
23+
echo "#"
24+
echo "##########################################################"
25+
26+
curl -ksSf \
27+
-H "Authorization: Bearer $ARTIFACTORY_TOKEN" -X PUT \
28+
-T "$TRAVIS_BUILD_DIR"/"$file" \
29+
"$ARTIFACTORY_URL"/"$version_number"/"$TRAVIS_NO_DOT"/"$file"

0 commit comments

Comments
 (0)