Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions scripts/release/rpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
On a machine with Docker, execute the following command from the root directory of this repository:

_Enterprise Linux:_
``` bash
docker build --target build-env -f ./scripts/release/rpm/Dockerfile.centos -t azure/azure-cli:centos7-builder .
```bash
docker build --target build-env -f ./scripts/release/rpm/centos7.dockerfile -t azure/azure-cli:centos7-builder .
```
_Fedora:_

```bash
docker build --target build-env -f ./scripts/release/rpm/Dockerfile.fedora -t azure/azure-cli:fedora29-builder .
docker build --target build-env -f ./scripts/release/rpm/fedora.dockerfile -t azure/azure-cli:fedora29-builder .
```

_Mariner:_

```bash
docker build --target build-env -f ./scripts/release/rpm/Dockerfile.mariner -t azure/azure-cli:mariner-builder .
docker build --target build-env -f ./scripts/release/rpm/mariner.dockerfile -t azure/azure-cli:mariner-builder .
```

After several minutes, this will have created a Docker image named `azure/azure-cli:centos7-builder` containing an
unsigned `.rpm` built from the current contents of your azure-cli directory. To extract the build product from the image
you can run the following command:

_Enterprise Linux:_
``` bash
```bash
docker run azure/azure-cli:centos7-builder cat /root/rpmbuild/RPMS/x86_64/azure-cli-dev-1.el7.x86_64.rpm > ./bin/azure-cli-dev-1.el7.x86_64.rpm
```

_Fedora:_
``` bash
```bash
docker run azure/azure-cli:fedora29-builder cat /root/rpmbuild/RPMS/x86_64/azure-cli-dev-1.fc29.x86_64.rpm > ./bin/azure-cli-dev-1.fc29.x86_64.rpm
```

_Mariner:_
``` bash
```bash
docker run azure/azure-cli:mariner-builder cat /usr/src/mariner/RPMS/x86_64/azure-cli-dev-1.cm1.x86_64.rpm > ./bin/azure-cli-dev-1.cm1.x86_64.rpm
```

Expand All @@ -60,8 +60,8 @@ Run the RPM package

On a machine with Docker, execute the following command from the root directory of this repository:

``` bash
docker build -f ./scripts/release/rpm/Dockerfile.centos -t azure/azure-cli:centos7 .
```bash
docker build -f ./scripts/release/rpm/centos7.dockerfile -t azure/azure-cli:centos7 .
```

If you had previously followed this instructions above for building an RPM package, this should finish very quickly.
Expand All @@ -72,23 +72,23 @@ Verification
------------

Install the RPM:
```
```bash
sudo rpm -i RPMS/*/azure-cli-2.0.16-1.noarch.rpm
az --version
```

Check the file permissions of the package:
```
```bash
rpmlint RPMS/*/azure-cli-2.0.16-1.x86_64.rpm
```

Check the file permissions of the package:
```
```bash
rpm -qlvp RPMS/*/azure-cli-2.0.16-1.x86_64.rpm
```

To remove:
```
```bash
sudo rpm -e azure-cli
```

Expand All @@ -97,4 +97,3 @@ Links

- [Fedora Project: How to Create an RPM Package](https://fedoraproject.org/wiki/How_to_create_an_RPM_package)
- [Fedora Project: Packaging RPM Macros](https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros)

4 changes: 2 additions & 2 deletions scripts/release/rpm/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ CLI_VERSION=`cat src/azure-cli/azure/cli/__main__.py | grep __version__ | sed s/
docker build \
--target build-env \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/Dockerfile.${IMAGE} \
-f ./scripts/release/rpm/${IMAGE}.dockerfile \
-t azure/azure-cli:${IMAGE}-builder \
.

# Continue the previous build, and create a container that has the current azure-cli build but not the source code.
docker build \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/Dockerfile.${IMAGE} \
-f ./scripts/release/rpm/${IMAGE}.dockerfile \
-t azure/azure-cli:${IMAGE} \
.

Expand Down
4 changes: 2 additions & 2 deletions scripts/release/rpm/pipeline_mariner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ CLI_VERSION=`cat src/azure-cli/azure/cli/__main__.py | grep __version__ | sed s/
docker build \
--target build-env \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/Dockerfile.mariner \
-f ./scripts/release/rpm/mariner.dockerfile \
-t azure/azure-cli:mariner-builder \
.

# Continue the previous build, and create a container that has the current azure-cli build but not the source code.
docker build \
--build-arg cli_version=${CLI_VERSION} \
-f ./scripts/release/rpm/Dockerfile.mariner \
-f ./scripts/release/rpm/mariner.dockerfile \
-t azure/azure-cli:mariner \
.

Expand Down