Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
packagecloud: packagecloud/packagecloud@0.1.0
Use packagecloud
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
build-steps | Steps to generate artifacts. Alternately provide `workspace-path` | No | [] | steps |
executor-version | - | No | 2.3-jessie | string |
os-version | Version string associated with a package for pushing/yanking -- e.g., 'ubuntu/bionic' `https://packagecloud.io/docs#os_distro_version`
| Yes | - | string |
package-path | Path to package(s) to upload into a packagecloud repository
When pushing packages, provide a path to the package -- e.g., 'path/to/package/coolpackage_2.1.1_amd64.deb' or 'path/to/*.rpm'
| Yes | - | string |
repo-fqname | Fully-qualified path to a packagecloud repository -- e.g., example_user/example_repo
| Yes | - | string |
workspace-path | The key of a workflow workspace. Alternately provide `build-steps` | No | '' | string |
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
os-version | Version string associated with a package for yanking -- e.g., 'ubuntu/bionic' `https://packagecloud.io/docs#os_distro_version`
| Yes | - | string |
package-name | Package name to yank from repository.
When yanking a package, pass the full name of the package -- e.g., 'coolpackage_2.1.1_amd64.deb'
| Yes | - | string |
repo-fqname | Fully-qualified path to a packagecloud repository -- e.g., 'example_user/example_repo'
| Yes | - | string |
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
executor-version | - | No | 2.3-jessie | string |
os-version | - | Yes | - | string |
package-path | - | Yes | - | string |
repo-fqname | - | Yes | - | string |
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
os-version | - | Yes | - | string |
package-name | - | Yes | - | string |
repo-fqname | - | Yes | - | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
commands:
check-api-token:
steps:
- run:
command: |
: "${PACKAGECLOUD_TOKEN?The PACKAGECLOUD_TOKEN must be set as an environment variable}"
echo "Checking for the packagecloud API token"
name: Check for packagecloud environment variable
install:
steps:
- run:
command: |
if [[ $(command -v package_cloud) == "" ]]; then
gem install package_cloud
else
echo "packagecloud CLI is already installed."
fi
name: Install packagecloud CLI
push:
parameters:
executor-version:
default: 2.3-jessie
type: string
os-version:
type: string
package-path:
type: string
repo-fqname:
type: string
steps:
- run:
command: package_cloud push <<parameters.repo-fqname>>/<<parameters.os-version>>
<<parameters.package-path>>
name: Push packages
yank:
parameters:
os-version:
type: string
package-name:
type: string
repo-fqname:
type: string
steps:
- run:
command: package_cloud yank <<parameters.repo-fqname>>/<<parameters.os-version>>
<<parameters.package-name>>
name: Yank packages
description: |
The packagecloud orb handles common tasks for interacting with repositories on packagecloud.
To use this orb and interact with the packagecloud CLI, an environment variable *must* be
created in the CircleCI project settings with the name `PACKAGECLOUD_TOKEN` containing the
value of a packagecloud API token. The CLI will read the PACKAGECLOUD_TOKEN by default.
executors:
ruby:
docker:
- image: circleci/ruby:<<parameters.version>>
parameters:
version:
default: 2.3-jessie
type: string
jobs:
push:
executor:
name: ruby
version: <<parameters.executor-version>>
parameters:
build-steps:
default: []
description: Steps to generate artifacts. Alternately provide `workspace-path`
type: steps
executor-version:
default: 2.3-jessie
type: string
os-version:
description: |
Version string associated with a package for pushing/yanking -- e.g., 'ubuntu/bionic' `https://packagecloud.io/docs#os_distro_version`
type: string
package-path:
description: |
Path to package(s) to upload into a packagecloud repository
When pushing packages, provide a path to the package -- e.g., 'path/to/package/coolpackage_2.1.1_amd64.deb' or 'path/to/*.rpm'
type: string
repo-fqname:
description: |
Fully-qualified path to a packagecloud repository -- e.g., example_user/example_repo
type: string
workspace-path:
default: ""
description: The key of a workflow workspace. Alternately provide `build-steps`
type: string
steps:
- check-api-token
- checkout
- when:
condition: <<parameters.build-steps>>
steps: <<parameters.build-steps>>
- when:
condition: <<parameters.workspace-path>>
steps:
- attach_workspace:
at: <<parameters.workspace-path>>
- install
- push:
os-version: <<parameters.os-version>>
package-path: <<parameters.package-path>>
repo-fqname: <<parameters.repo-fqname>>
yank:
executor: ruby
parameters:
os-version:
description: |
Version string associated with a package for yanking -- e.g., 'ubuntu/bionic' `https://packagecloud.io/docs#os_distro_version`
type: string
package-name:
description: |
Package name to yank from repository.
When yanking a package, pass the full name of the package -- e.g., 'coolpackage_2.1.1_amd64.deb'
type: string
repo-fqname:
description: |
Fully-qualified path to a packagecloud repository -- e.g., 'example_user/example_repo'
type: string
steps:
- check-api-token
- checkout
- install
- yank:
os-version: <<parameters.os-version>>
package-name: <<parameters.package-name>>
repo-fqname: <<parameters.repo-fqname>>
version: 2.1