diff --git a/.github/workflows/deploy-to-ionos.yaml b/.github/workflows/deploy-to-ionos.yaml new file mode 100644 index 000000000..91e5b4cde --- /dev/null +++ b/.github/workflows/deploy-to-ionos.yaml @@ -0,0 +1,121 @@ +# Please do not edit this file. +# More information under https://docs.ionos.space/docs/github-actions-customization/ +# version: 2022-07-21 + +name: "Deploy Now: Deploy to IONOS" + +on: + workflow_dispatch: + inputs: + version: + required: true + type: string + project-id: + required: true + type: string + branch-id: + required: true + type: string + deployment-ids: + require: true + type: string + +concurrency: ${{ github.ref }} + +jobs: + deploy-to-ionos: + runs-on: ubuntu-latest + permissions: + actions: read + strategy: + matrix: + deployment-id: ${{ fromJson(inputs.deployment-ids) }} + steps: + - name: Update deployment status + uses: ionos-deploy-now/project-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + deployment-id: ${{ matrix.deployment-id }} + action: update-status + status: in_progress + + - name: Retrieve stored deployment + uses: ionos-deploy-now/artifact-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + version: ${{ inputs.version }} + action: download + + - name: Fetch deployment info + uses: ionos-deploy-now/project-action@v1 + id: deployment + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + deployment-id: ${{ matrix.deployment-id }} + action: retrieve-info + + - name: Render templates + uses: ionos-deploy-now/template-renderer-action@v2 + id: template + with: + deployment-id: ${{ matrix.deployment-id }} + data: "[${{ steps.deployment.outputs.template-variables }}, ${{ toJson(secrets) }}]" + input-directory: deployment + output-directory: deployment + intermediate-data-file: deployment/.template-renderer-data + + - name: Render real site-url to all files + run: | + for file in `grep -rl 'https://IONOS_DEPLOY_NOW_SITE_URL' .`; do + sed -i $file -e 's|https://IONOS_DEPLOY_NOW_SITE_URL|${{ fromJson(steps.deployment.outputs.info).site-url }}|g' + done + + - name: Render SSH user secret name + run: echo SSH_USERNAME_SECRET=IONOS_DEPLOYMENT_`echo ${{ matrix.deployment-id }} | tr '[:lower:]' '[:upper:]' | tr '-' '_'`_SSH_USERNAME >> $GITHUB_ENV + + - name: Deploy to IONOS + uses: ionos-deploy-now/deploy-to-ionos-action@v2 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + deployment-id: ${{ matrix.deployment-id }} + deployment-info: ${{ steps.deployment.outputs.info }} + ssh-user: ${{ secrets[env.SSH_USERNAME_SECRET] }} + ssh-key: ${{ secrets.IONOS_SSH_KEY }} + + - name: Update deployment status + if: ${{ always() }} + uses: ionos-deploy-now/project-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + deployment-id: ${{ matrix.deployment-id }} + action: update-status + status: ${{ job.status }} + + notify-deployment-finished: + needs: deploy-to-ionos + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Notify all deployments finished + uses: ionos-deploy-now/project-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: ${{ inputs.project-id }} + branch-id: ${{ inputs.branch-id }} + action: set-deployments-finished diff --git a/.github/workflows/project-examples-build.yaml b/.github/workflows/project-examples-build.yaml new file mode 100644 index 000000000..3b0fa1b32 --- /dev/null +++ b/.github/workflows/project-examples-build.yaml @@ -0,0 +1,41 @@ +# To better understand this file read this: +# https://docs.ionos.space/docs/github-actions-customization/ + +name: "Deploy Now: Execute Build" + +on: + workflow_call: + inputs: + site-url: + required: true + type: string + branch-id: + required: true + type: string + +env: + DEPLOYMENT_FOLDER: ./ + +jobs: +# Please do not rename this job + build-project: + name: build project-examples + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: 'recursive' + +# Please do not touch the following action + - name: Store deployment content + uses: ionos-deploy-now/artifact-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: 74c1a5b2-dc4d-4da7-8f37-3454d87ef20d + branch-id: ${{ inputs.branch-id }} + version: ${{ github.sha }} + folder: ${{ env.DEPLOYMENT_FOLDER }} + config-file: .deploy-now/project-examples/config.yaml + action: upload diff --git a/.github/workflows/project-examples-orchestration.yaml b/.github/workflows/project-examples-orchestration.yaml new file mode 100644 index 000000000..53f3fe434 --- /dev/null +++ b/.github/workflows/project-examples-orchestration.yaml @@ -0,0 +1,55 @@ +# Please do not edit this file. +# Build steps can be customized in the project-examples-build.yaml. +# More information under https://docs.ionos.space/docs/github-actions-customization/ +# version: 2022-07-21 + +name: "Deploy Now: Orchestration" +run-name: "Deploy Now: Build project-examples ยท ${{ github.event.head_commit.message || format('Triggered by {0}', github.triggering_actor) }}" + +on: + - push + - workflow_dispatch + +jobs: + retrieve-project: + name: check readiness + runs-on: ubuntu-latest + outputs: + deployment-enabled: ${{ fromJson(steps.project.outputs.info).deployment-enabled }} + branch-id: ${{ fromJson(steps.project.outputs.info).branch-id }} + steps: + - name: Fetch project data + uses: ionos-deploy-now/project-action@v1 + id: project + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: 74c1a5b2-dc4d-4da7-8f37-3454d87ef20d + action: retrieve-info + + + build: + name: build + needs: retrieve-project + if: ${{ needs.retrieve-project.outputs.deployment-enabled == 'true' }} + uses: ./.github/workflows/project-examples-build.yaml + with: + site-url: https://IONOS_DEPLOY_NOW_SITE_URL + branch-id: ${{ needs.retrieve-project.outputs.branch-id }} + secrets: inherit + + deploy: + name: trigger deployment + needs: + - retrieve-project + - build + runs-on: ubuntu-latest + steps: + - name: Dispatch deployment(s) + uses: ionos-deploy-now/project-action@v1 + with: + api-key: ${{ secrets.IONOS_API_KEY }} + service-host: api-us.ionos.space + project-id: 74c1a5b2-dc4d-4da7-8f37-3454d87ef20d + branch-id: ${{ needs.retrieve-project.outputs.branch-id }} + action: dispatch-deployments diff --git a/docker-oci-examples/fat-manifest-example/README.md b/docker-oci-examples/fat-manifest-example/README.md index a698ac63f..176463fcb 100644 --- a/docker-oci-examples/fat-manifest-example/README.md +++ b/docker-oci-examples/fat-manifest-example/README.md @@ -36,7 +36,8 @@ For this demo, we will be using [buildx](https://github.com/docker/buildx) in or Build and push multi platforms image: > docker login DOCKER_REG_URL > docker buildx install - > docker build --platform=linux/amd64,linux/arm64,linux/arm/v7 --tag=DOCKER_REG_URL/TARGET_REPO/multiarch-image:1 -f=Dockerfile.Fatmanifest --metadata-file=build-metadata --push . + > docker buildx create --use --name mybuilder --driver docker-container + > docker buildx build --platform=linux/amd64,linux/arm64,linux/arm/v7 --tag=DOCKER_REG_URL/TARGET_REPO/multiarch-image:1 -f=Dockerfile.Fatmanifest --metadata-file=build-metadata --push . Configure Artifactory: > jf c add MY_SERVER_ID diff --git a/docker-oci-examples/openshift-examples/openshift-build-example/README.md b/docker-oci-examples/openshift-examples/openshift-build-example/README.md index 0272d0e57..0fc35907a 100644 --- a/docker-oci-examples/openshift-examples/openshift-build-example/README.md +++ b/docker-oci-examples/openshift-examples/openshift-build-example/README.md @@ -20,13 +20,13 @@ This is an example showing how to add a BuildConfig in OpenShift and use it to b ``` * Configure JFrog CLI: ``` - jfrog config add + jf config add ``` * Use JFrog CLI to start a new build from the BuildConfig we just created and collect build info. Replace the placeholders and run: ``` - jfrog rt oc start-build jfrog-oc-build-example --server-id= --repo= --build-name=oc-build-example --build-number=1 + jf rt oc start-build jfrog-oc-build-example --server-id= --repo= --build-name=oc-build-example --build-number=1 ``` * Publish build info to Artifactory. Replace the placeholder and run: ``` - jfrog rt build-publish oc-build-example 1 --server-id= + jf rt build-publish oc-build-example 1 --server-id= ``` diff --git a/docker-oci-examples/openshift-examples/openshift-build-example/build-config.yaml b/docker-oci-examples/openshift-examples/openshift-build-example/build-config.yaml index 7186e961c..a010e2c35 100644 --- a/docker-oci-examples/openshift-examples/openshift-build-example/build-config.yaml +++ b/docker-oci-examples/openshift-examples/openshift-build-example/build-config.yaml @@ -7,7 +7,7 @@ spec: type: Git git: uri: 'https://github.com/jfrog/project-examples' - contextDir: /openshift-examples/openshift-build-example + contextDir: /docker-oci-examples/openshift-examples/openshift-build-example strategy: type: Docker output: diff --git a/github-action-examples/repo-management-github-actions-example/.github/workflows/main.yml b/github-action-examples/repo-management-github-actions-example/.github/workflows/main.yml index 87776adf2..000b9775b 100644 --- a/github-action-examples/repo-management-github-actions-example/.github/workflows/main.yml +++ b/github-action-examples/repo-management-github-actions-example/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: name: calculate-ci-job steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup JDK 1.8 uses: actions/setup-java@v1 @@ -28,13 +28,13 @@ jobs: java-version: 1.8 - name: Setup JFrog CLI - uses: jfrog/setup-jfrog-cli@v1 + uses: jfrog/setup-jfrog-cli@v2 env: - JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SECRET_1 }} + JF_ENV_1: ${{ secrets.JF_SECRET_ENV_1 }} M2_HOME: /usr/local/apache-maven/apache-maven-3.6.3 - name: Ping JFrog CLI - run: jfrog rt ping + run: jf rt ping - name: Set Environment Variables run: | @@ -44,9 +44,9 @@ jobs: # if pushed from a feature branch, should create a proper repository in artifactory for that - name: Feature Branch Repository Creation run: | - jfrog rt rc templates/local-repo-template.json --vars key1=$repository - jfrog rt rc templates/remote-repo-template.json --vars key1=$repository - jfrog rt rc templates/virtual-repo-template.json --vars key1=$repository + jf rt rc templates/local-repo-template.json --vars key1=$repository + jf rt rc templates/remote-repo-template.json --vars key1=$repository + jf rt rc templates/virtual-repo-template.json --vars key1=$repository - if: always() name: Feature Branch Repository Update @@ -54,27 +54,27 @@ jobs: SERVER_ID: tal-eplus-saas run: | echo "::set-env name=repository::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" - jfrog rt mvnc --server-id-resolve=$SERVER_ID --server-id-deploy=$SERVER_ID --repo-resolve-releases=auto-cli-virtual-$repository --repo-resolve-snapshots=auto-cli-virtual-$repository --repo-deploy-releases=auto-cli-virtual-$repository --repo-deploy-snapshots=auto-cli-virtual-$repository + jf mvnc --server-id-resolve=$SERVER_ID --server-id-deploy=$SERVER_ID --repo-resolve-releases=auto-cli-virtual-$repository --repo-resolve-snapshots=auto-cli-virtual-$repository --repo-deploy-releases=auto-cli-virtual-$repository --repo-deploy-snapshots=auto-cli-virtual-$repository - if: always() name: Build & Deploy run: | - cd maths && jfrog rt mvn clean install + cd maths && jf mvn clean install - if: always() name: Publish Build Information run: | # Collect environment variables for the build - jfrog rt bce + jf rt bce # Collect VCS details from git and add them to the build - jfrog rt bag + jf rt bag # Publish build info - jfrog rt bp + jf rt bp - if: always() name: Xray Scan run: | - jfrog rt bs + jf bs - if: always() name: Feature Branch Repository Deletion @@ -82,7 +82,7 @@ jobs: NUMBER_OF_DAYS_TO_KEEP: 90 run: | # Extract all the LOCAL repositories created automatically by the CI process - jfrog rt curl -XGET /api/repositories | jq '[.[] | .key | select(test("auto-cli-local"))]' > deletion/auto_created_repositories.json && cat deletion/auto_created_repositories.json + jf rt curl -XGET /api/repositories | jq '[.[] | .key | select(test("auto-cli-local"))]' > deletion/auto_created_repositories.json && cat deletion/auto_created_repositories.json # Calculate for which month are we going back to verify who should be deleted jq -n 'now - 3600 * 24 * '$NUMBER_OF_DAYS_TO_KEEP' | gmtime | todate' > deletion/months_indicator && cat deletion/months_indicator @@ -90,15 +90,15 @@ jobs: # Iterate over all the repositories, delete those by the latest file that was modified jq -c '.[]' deletion/auto_created_repositories.json | while read i; do echo Iterating repository = $i - sh -c "jfrog rt s --spec deletion/repositories-spec.json --spec-vars='key1="$i"' > deletion/search_results && cat deletion/search_results" + sh -c "jf rt s --spec deletion/repositories-spec.json --spec-vars='key1="$i"' > deletion/search_results && cat deletion/search_results" # If the repository is empty / latest modified file is older > NUMBER_OF_DAYS_TO_KEEP days => DELETE the repository if [[ $(cat deletion/search_results) == "[]" ]]; then echo "Deleting repository: $i, repository is empty" - sh -c "jfrog rt rdel $i --quiet && jfrog rt rdel ${i//local/virtual} --quiet && jfrog rt rdel ${i//local/jcenter} --quiet" + sh -c "jf rt rdel $i --quiet && jf rt rdel ${i//local/virtual} --quiet && jf rt rdel ${i//local/jcenter} --quiet" elif [[ $(cat deletion/search_results | jq --arg month_indicator $(cat deletion/months_indicator) '.[] | .modified | . <= $month_indicator') = "true" ]]; then echo "Deleting repository: $i, too old to keep in Artifactory" - sh -c "jfrog rt rdel $i --quiet && jfrog rt rdel ${i//local/virtual} --quiet && jfrog rt rdel ${i//local/jcenter} --quiet" + sh -c "jf rt rdel $i --quiet && jf rt rdel ${i//local/virtual} --quiet && jf rt rdel ${i//local/jcenter} --quiet" else echo "Skipping Repository deletion - repository is still relevant" fi diff --git a/github-action-examples/simple-github-action-example/README.md b/github-action-examples/simple-github-action-example/README.md index 46d227469..332b75c61 100644 --- a/github-action-examples/simple-github-action-example/README.md +++ b/github-action-examples/simple-github-action-example/README.md @@ -7,6 +7,6 @@ This is an example Github workflow, which uses the [Setup JFrog CLI Github Actio 3. Configure the details of your Artifactory server by running ```jfrog c add```. 4. Using the server ID you configured, export the server details by running ```jfrog c export ```. 5. Copy the generated token to the clipboard. -6. In the Github repository you created, create a [secret](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) named JF_ARTIFACTORY_SERVER_1. Set the value of the secret to be the generated token you copied to the clipboard. +6. In the Github repository you created, create a [secret](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) named JF_SECRET_ENV_1. Set the value of the secret to be the generated token you copied to the clipboard. 7. Push the [workflow.yml](workflow.yml) file as part of this example, under `.github/workflows/` in your Github repository. 8. Watch the workflow running following any push to the repository. diff --git a/github-action-examples/simple-github-action-example/workflow.yml b/github-action-examples/simple-github-action-example/workflow.yml index ddda9e6dc..220f781dc 100644 --- a/github-action-examples/simple-github-action-example/workflow.yml +++ b/github-action-examples/simple-github-action-example/workflow.yml @@ -6,16 +6,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup JFrog CLI - uses: jfrog/setup-jfrog-cli@v1 + uses: jfrog/setup-jfrog-cli@v2 env: - JF_ARTIFACTORY_SERVER: ${{ secrets.JF_ARTIFACTORY_SERVER_1 }} + JF_ENV_1: ${{ secrets.JF_SECRET_ENV_1 }} - name: Run JFrog CLI run: | # Collect environment variables for the build - jfrog rt bce + jf rt bce # Collect VCS details from git and add them to the build - jfrog rt bag + jf rt bag # Publish build info - jfrog rt bp + jf rt bp diff --git a/gitlab-examples/gitlab-pipeline/README.md b/gitlab-examples/gitlab-pipeline/README.md new file mode 100644 index 000000000..cba9835ec --- /dev/null +++ b/gitlab-examples/gitlab-pipeline/README.md @@ -0,0 +1,24 @@ +# GitLab pipeline example +This is an example of a GitLab pipeline which uses JFrog CLI to integrate with Artifactory. +This sample uses a Gradle project, builds it, and pushes the artifact to Artifactory, including build info, environment variables. +It than uses JFrog Xray to scan the build for OSS vulnerabilities. + +## Configuring the GitLab project +1. Create a GitLab project +2. Import a Gradle repository into the project (I used https://github.com/spring-projects/spring-petclinic) +3. Configure the following variables in GitLab (Settings->CI/CD->Variables): + 1. JFROG_PLATFORM_SERVER_ID - a unique server ID used to reference the server configuration from within the pipeline code + 2. JFROG_PLATFORM_URL - the JFrog platform server used + 3. JFROG_PLATFORM_USER - the user name used to access JFrog platform + 4. JFROG_PLATFORM_PASS - a password used to validate the user + 5. JFROG_PLATFORM_REPO - a virtual repository used to upload and download artifacts from JFrog platform + +4. Create a new pipeline in GitLab and copy the content of gitlab-ci.yml file to it + +*** Sensitive variables like user or password should be masked in order to make sure their value is not exposed in the pipeline logs. + +## Running the pipeline +By default GitLab pipelines are triggered whenever a change is commited to the project repo. +However, you can manually trigger the pipeline by going to: CI/CD->Pipelines and press the "Run pipeline" button. +To view the pipeline execution logs navigate to: CI/CD->Jobs, and click the required job execution line. + diff --git a/gitlab-examples/gitlab-pipeline/gitlab-ci.yml b/gitlab-examples/gitlab-pipeline/gitlab-ci.yml new file mode 100644 index 000000000..769f3b2b6 --- /dev/null +++ b/gitlab-examples/gitlab-pipeline/gitlab-ci.yml @@ -0,0 +1,30 @@ +image: gradle:latest + +before_script: + # Install JFrog CLI + - curl -fL https://install-cli.jfrog.io | sh + + # Configure Artifactory server + - jf config add $JFROG_PLATFORM_SERVER_ID --url=$JFROG_PLATFORM_URL --user=$JFROG_PLATFORM_USER --password=$JFROG_PLATFORM_PASS + + # Configure Gradle, set upload and download repositories + - jf gradlec --repo-resolve $JFROG_PLATFORM_REPO --repo-deploy $JFROG_PLATFORM_REPO + +# This job name will be used as the build info repository name in artifactory +gitlab-ci-gradle-build: + stage: build + script: + # Build and upload the JAR to Artifactory + - jf gradle clean artifactoryPublish --build-name=$CI_JOB_NAME --build-number=$CI_JOB_ID + + # Collect environment variables for the build + - jf rt bce $CI_JOB_NAME $CI_JOB_ID + + # Collect VCS details from Git and add them to the build + - jf rt bag $CI_JOB_NAME $CI_JOB_ID + + # Publish build info + - jf rt bp $CI_JOB_NAME $CI_JOB_ID + + # Scan with JFrog Xray + - jf bs $CI_JOB_NAME $CI_JOB_ID diff --git a/golang-example/README.md b/golang-example/README.md index 04fa9b886..58f1faaef 100644 --- a/golang-example/README.md +++ b/golang-example/README.md @@ -12,26 +12,26 @@ To work with Go repositories you need to use [JFrog CLI](https://www.jfrog.com/c * Make sure your JFrog CLI version is 1.26.0 or above ## Running the Example -CD to the root project directory +'cd' to the root project directory ```console Configure Artifactory: -> jfrog c add +> jf c add Configure the project's repositories: -> jfrog rt go-config +> jf rt go-config Build the project with go and resolve the project dependencies from Artifactory. -> jfrog rt go build --build-name=my-build --build-number=1 +> jf rt go build --build-name=my-build --build-number=1 Publish version v1.0.0 of the package to the go-local repository in Artifactory. -> jfrog rt gp go-local v1.0.0 --build-name=my-build --build-number=1 +> jf rt gp go-local v1.0.0 --build-name=my-build --build-number=1 Collect environment variables and add them to the build info. -> jfrog rt bce my-build 1 +> jf rt bce my-build 1 Publish the build info to Artifactory. -> jfrog rt bp my-build 1 +> jf rt bp my-build 1 ``` Learn about [building go packages](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildingGoPackages) and about Artifactory and [go registry](https://jfrog.com/integration/go-registry/) integration. diff --git a/gradle-examples/README.md b/gradle-examples/README.md index f5b3f810d..945b9dea2 100644 --- a/gradle-examples/README.md +++ b/gradle-examples/README.md @@ -11,6 +11,7 @@ We have included a few sample projects to help you get started using the plugin. http://localhost:8081/artifactory
This URL is defined inside the *build.gradle* file of each project. Please change it if your Artifactory instance is accessible through a different URL. * Configure your Artifactory username and password in the *gradle.properties* file for each project +* Since all example projects are configured to deploy artifacts to 'libs-snapshot-local' repository, it is recommended to create a local repository named *libs-snapshot-local* or change it inside the build.gradle file of each project. * Since all example projects are configured to resolve dependencies from 'Maven Central', it is recommended to create a remote repository named *mvn-central*, which proxies *https://repo1.maven.org/maven2* as its URL. * CD to one of the project's root directory and run the build using one of the following commands: diff --git a/gradle-examples/gradle-example-ci-server/build.gradle b/gradle-examples/gradle-example-ci-server/build.gradle index daf210c91..1424c5516 100644 --- a/gradle-examples/gradle-example-ci-server/build.gradle +++ b/gradle-examples/gradle-example-ci-server/build.gradle @@ -14,12 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - mavenCentral() - } -} - allprojects { apply plugin: 'java' apply plugin: 'maven-publish' @@ -27,6 +21,10 @@ allprojects { group = 'org.jfrog.example.gradle' version = '1.0' status = 'integration' + + repositories { + mavenCentral() + } } // Setting this property to true will make the artifactoryPublish task diff --git a/jenkins-examples/pipeline-examples/declarative-examples/gradle-example-ci-server/Jenkinsfile b/jenkins-examples/pipeline-examples/declarative-examples/gradle-example-ci-server/Jenkinsfile index a1bee6c99..bd49fe663 100755 --- a/jenkins-examples/pipeline-examples/declarative-examples/gradle-example-ci-server/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/declarative-examples/gradle-example-ci-server/Jenkinsfile @@ -35,7 +35,6 @@ pipeline { rtGradleRun ( tool: GRADLE_TOOL, // Tool name from Jenkins configuration rootDir: "gradle-examples/gradle-example-ci-server/", - buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', deployerId: "GRADLE_DEPLOYER", resolverId: "GRADLE_RESOLVER" diff --git a/jenkins-examples/pipeline-examples/declarative-examples/gradle-example/Jenkinsfile b/jenkins-examples/pipeline-examples/declarative-examples/gradle-example/Jenkinsfile index e2177e26d..1a7cb0960 100644 --- a/jenkins-examples/pipeline-examples/declarative-examples/gradle-example/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/declarative-examples/gradle-example/Jenkinsfile @@ -52,7 +52,6 @@ pipeline { useWrapper: true, tool: GRADLE_TOOL, // Tool name from Jenkins configuration rootDir: "gradle-examples/gradle-example/", - buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', deployerId: "GRADLE_DEPLOYER", resolverId: "GRADLE_RESOLVER" diff --git a/jenkins-examples/pipeline-examples/declarative-examples/jfrog-distribution-example/Jenkinsfile b/jenkins-examples/pipeline-examples/declarative-examples/jfrog-distribution-example/Jenkinsfile index b43217299..6f2aac320 100644 --- a/jenkins-examples/pipeline-examples/declarative-examples/jfrog-distribution-example/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/declarative-examples/jfrog-distribution-example/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage ('Clone') { steps { - git branch: 'master', url: "https://github.com/jfrog/jenkins-artifactory-plugin.git" + git branch: 'master', url: "https://github.com/jfrog/project-examples.git" } } @@ -111,4 +111,4 @@ pipeline { } } } -} \ No newline at end of file +} diff --git a/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/Jenkinsfile b/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/Jenkinsfile index 4e3db4d18..e769a5717 100644 --- a/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/Jenkinsfile @@ -19,7 +19,7 @@ node { stage ('Exec Gradle') { docker.image('gradle').inside { - rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', buildFile: 'build.gradle', tasks: 'aP', buildInfo: buildInfo + rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', tasks: 'aP', buildInfo: buildInfo } } diff --git a/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/README.md b/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/README.md index c22f80ce2..5337c7340 100644 --- a/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/README.md +++ b/jenkins-examples/pipeline-examples/scripted-examples/gradle-container-example/README.md @@ -9,5 +9,5 @@ * rtGradle.tool = GRADLE_TOOL * Option 2: Set `GRADLE_HOME` environment variable as configured in the container. * withEnv(['GRADLE_HOME=/opt/gradle']) { - rtGradle.run rootDir: "gradle-examples/gradle-example/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', buildInfo: buildInfo + rtGradle.run rootDir: "gradle-examples/gradle-example/", tasks: 'clean artifactoryPublish', buildInfo: buildInfo } diff --git a/jenkins-examples/pipeline-examples/scripted-examples/gradle-deploy-example/Jenkinsfile b/jenkins-examples/pipeline-examples/scripted-examples/gradle-deploy-example/Jenkinsfile index db86b81a4..3f0a5b7c2 100644 --- a/jenkins-examples/pipeline-examples/scripted-examples/gradle-deploy-example/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/scripted-examples/gradle-deploy-example/Jenkinsfile @@ -21,11 +21,11 @@ node { } stage ('Test') { - rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', buildFile: 'build.gradle', tasks: 'clean test' + rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', tasks: 'clean test' } stage ('Deploy') { - rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', buildFile: 'build.gradle', tasks: 'artifactoryPublish', buildInfo: buildInfo + rtGradle.run rootDir: 'gradle-examples/gradle-example-ci-server/', tasks: 'artifactoryPublish', buildInfo: buildInfo rtGradle.deployer.deployArtifacts buildInfo } diff --git a/jenkins-examples/pipeline-examples/scripted-examples/gradle-example-ci-server/Jenkinsfile b/jenkins-examples/pipeline-examples/scripted-examples/gradle-example-ci-server/Jenkinsfile index 332610ff8..1b09c9be2 100755 --- a/jenkins-examples/pipeline-examples/scripted-examples/gradle-example-ci-server/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/scripted-examples/gradle-example-ci-server/Jenkinsfile @@ -17,7 +17,7 @@ node { } stage ('Exec Gradle') { - rtGradle.run rootDir: "gradle-examples/gradle-example-ci-server/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', buildInfo: buildInfo + rtGradle.run rootDir: "gradle-examples/gradle-example-ci-server/", tasks: 'clean artifactoryPublish', buildInfo: buildInfo } stage ('Publish build info') { diff --git a/jenkins-examples/pipeline-examples/scripted-examples/gradle-example/Jenkinsfile b/jenkins-examples/pipeline-examples/scripted-examples/gradle-example/Jenkinsfile index 397dc6b88..f41740c3c 100755 --- a/jenkins-examples/pipeline-examples/scripted-examples/gradle-example/Jenkinsfile +++ b/jenkins-examples/pipeline-examples/scripted-examples/gradle-example/Jenkinsfile @@ -30,7 +30,7 @@ node { } stage ('Exec Gradle') { - rtGradle.run rootDir: "gradle-examples/gradle-example/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', buildInfo: buildInfo + rtGradle.run rootDir: "gradle-examples/gradle-example/", tasks: 'clean artifactoryPublish', buildInfo: buildInfo } stage ('Publish build info') { diff --git a/kubernetes-example/gradle-example/Jenkinsfile b/kubernetes-example/gradle-example/Jenkinsfile index 5b40bd281..238f72a00 100644 --- a/kubernetes-example/gradle-example/Jenkinsfile +++ b/kubernetes-example/gradle-example/Jenkinsfile @@ -20,7 +20,7 @@ node { if(CLEAN_REPO == "YES") { sh 'rm -rf ~/.gradle/caches' } - rtGradle.run rootDir: "gradle-example/", buildFile: 'build.gradle', tasks: 'clean artifactoryPublish', buildInfo: buildInfo + rtGradle.run rootDir: "gradle-example/", tasks: 'clean artifactoryPublish', buildInfo: buildInfo //Publish artifacts to Artifactory along with build information and scan build artifacts in Xray stage 'Publish Build Information & Scan Artifacts' diff --git a/maven-example/.mvn/wrapper/MavenWrapperDownloader.java b/maven-examples/maven-example/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from maven-example/.mvn/wrapper/MavenWrapperDownloader.java rename to maven-examples/maven-example/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/maven-example/.mvn/wrapper/maven-wrapper.jar b/maven-examples/maven-example/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from maven-example/.mvn/wrapper/maven-wrapper.jar rename to maven-examples/maven-example/.mvn/wrapper/maven-wrapper.jar diff --git a/maven-example/.mvn/wrapper/maven-wrapper.properties b/maven-examples/maven-example/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from maven-example/.mvn/wrapper/maven-wrapper.properties rename to maven-examples/maven-example/.mvn/wrapper/maven-wrapper.properties diff --git a/maven-example/mvnw b/maven-examples/maven-example/mvnw similarity index 100% rename from maven-example/mvnw rename to maven-examples/maven-example/mvnw diff --git a/maven-example/mvnw.cmd b/maven-examples/maven-example/mvnw.cmd similarity index 100% rename from maven-example/mvnw.cmd rename to maven-examples/maven-example/mvnw.cmd diff --git a/maven-examples/maven-example/rpmscript b/maven-examples/maven-example/rpmscript deleted file mode 100644 index 7b4a03dc8..000000000 --- a/maven-examples/maven-example/rpmscript +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# this script sets up Jenkins job to create rpm per name -# Inputs -# $1 = GitHub user name -# $2 = Build Number that is passed by Jenkins - -STUDENT_DEFINE="_ghubid $1" -BUILD_DEFINE="_build_number $2" -RPMDIR_DEFINE="_topdir $3" - -wardir=org/jfrog/test/multi3/*/multi3-*.war - -# Setup rpmbuild environment -mkdir -p rpmbuild -cd rpmbuild -for dir in BUILD RPMS SOURCES SPECS SRPMS -do - [[ -d $dir ]] && rm -Rf $dir - mkdir $dir -done - -set -x -echo rpmbuild/BUILD/$1.war - -# Put the training spec in the SPEC folder -cd .. -cp $wardir rpmbuild/BUILD/$1.war -cp training.spec rpmbuild/SPECS/. -cd rpmbuild - -rpmbuild --define "$RPMDIR_DEFINE" --define "$STUDENT_DEFINE" --define "$BUILD_DEFINE" -ba SPECS/training.spec diff --git a/maven-examples/maven-example/training.spec b/maven-examples/maven-example/training.spec deleted file mode 100644 index f77e672e9..000000000 --- a/maven-examples/maven-example/training.spec +++ /dev/null @@ -1,61 +0,0 @@ -# -# Example spec file for maven example web app... -# -# Usage - RPMBUILD --define _ghubid --define _build_number -ba SPECS/_ghubid.spec -# -Summary: Simple Maven example web application -Name: stanleyf -Version: 1.0.0 -Release: %{_build_number}%{?dist} -License: commerical -Group: Applications/Web Applications -#Requires: apache-tomcat - -URL: http://www.jfrog.com -Distribution: WSS Linux -Vendor: JFrog, Inc. -Packager: Stanley Fong - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch - -%define tomcat_webapps /usr/local/tomcat7/webapps -%define namespace %{_ghubid} - -%description -It is a web app maven example ... - -# Prep is used to set up the environment for building the rpm package -# Expansion of source tar balls are done in this section -# Check if the WAR file has been created -%prep -%__rm -rf ${_builddir} - -# fetch the war file from artifactory -%build -exit 0 - -# The installation. -# Copy war file to buildroot's tomcat deployment directory -# Copy config file to buildroot's tomcat config directory -%install -%__rm -rf %{buildroot} -%__mkdir -p %{buildroot}/%{tomcat_webapps}/ -%__cp %{_builddir}/%{namespace}.war %{buildroot}/%{tomcat_webapps}/%{namespace}.war - -%clean -exit 0 - -# Contains a list of the files that are part of the package -# See useful directives such as attr here: http://www.rpm.org/max-rpm-snapshot/s1-rpm-specref-files-list-directives.html -# Set file permissions and ownership -%files -%defattr(-,tomcat,tomcat,-) -%{tomcat_webapps}/%{namespace}.war - -# Perform post-installation steps, if needed. -%post -echo "Installation complete." - -# Used to store any changes between versions -%changelog diff --git a/npm-example/README.md b/npm-example/README.md index 6888fdd9b..f0193a7bd 100644 --- a/npm-example/README.md +++ b/npm-example/README.md @@ -1,49 +1,79 @@ # NPM Example + ## Overview + Artifactory provides full support for managing npm packages and ensures optimal and reliable access to npmjs.org. It also allows aggregating multiple npm registries under a virtual repository Artifactory, which provides access to all your npm packages through a single URL for both upload and download. -You may store exhaustive build information in Artifactory by running your npm builds with [JFrog CLI](https://www.jfrog.com/confluence/display/CLI/JFrog+CLI). +You may store exhaustive build information in Artifactory by running your npm builds with [JFrog CLI](https://www.jfrog.com/confluence/display/CLI/JFrog+CLI). JFrog CLI collects build-info from your build agents and then publishes it to Artifactory. Once published, the build info can be viewed in the Build Browser under Builds. -For more details on npm build integration using JFrog CLI, please refer to [Building npm Packages](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildingNpmPackages) in the JFrog CLI User Guide. +For more details on npm build integration using JFrog CLI, please refer to [Building npm Packages](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildingNpmPackagesUsingtheNpmClient) in the JFrog CLI User Guide. ## This Example + This example demonstrates how to build an npm project using JFrog CLI. The build does the following: -1. Downloads its npm depedencies from Artifactory. + +1. Downloads its npm dependencies from Artifactory. 2. Packs and uploads the built package to Artifactory. 3. Records and publishes build-info to Artifactory. # Prerequisite -1. Make sure your local machine has *npm* version 5.4.0 or above installed and that *npm* is included in the PATH. To verify this, run ```npm -v```. -2. Make sure your local machine has [JFrog CLI](https://jfrog.com/getcli/) version 1.13.1 or above installed and that *jfrog* is included in the PATH. To verify this, run ```jfrog -v```. -2. Make sure you're using a non-OSS JFrog Artifactory with version 5.5.2 or above. + +1. Make sure your local machine has _npm_ version 5.4.0 or above installed and that _npm_ is included in the PATH. To verify this, run `npm -v`. +2. Make sure your local machine has the latest version of [JFrog CLI](https://jfrog.com/getcli/). +3. Make sure you're using a non-OSS JFrog Artifactory with version 5.5.2 or above. # Creating Repositories -Create the following repositories on your Artifactory instance. -1. A remote npm repository named *npm-remote*. Make sure the repository has *https://registry.npmjs.org* configured as its URL (this is the default when creating the repository). -2. A local repository named *npm-local*. -3. A virtual repository named *npm*. -4. Include the *npm-remote* and *npm-local* repositories as part of the new *npm* virtual repository. -5. Set *npm-local* as the **Default Deployment Repository** of the new *npm* virtual repository. + +Create the following repositories on your Artifactory instance: + +1. A remote npm repository. Make sure the repository has *https://registry.npmjs.org* configured as its URL (this is the default when creating the repository). +2. A local npm repository. +3. A virtual repository: + - Include the remote and local repositories as part of the new virtual repository. + - Set the new local repository as the **Default Deployment Repository** of the new virtual repository. # Running the Example -CD to the root project directory. -``` + +'cd' to the root project directory. + Configure Artifactory: -> jfrog c add -Build the project and record the depedencies as part of the build-info. -> jfrog rt npmi npm --build-name my-npm-build --build-number 1 +``` +jf c add +``` + +Configure the npm project and select the virtual repository as the resolution and deployment repository: + +``` +jf npm-config +``` + +Build the project and record the dependencies as part of the build-info: + +``` +jf npm install --build-name my-npm-build --build-number 1 +``` Add environment variables to the build-info. -> jfrog rt bce my-npm-build 1 + +``` +jf rt bce my-npm-build 1 +``` Add git information to the build-info. -> jfrog rt bag my-npm-build 1 -Pack and publish the npm package to Artifactory, while recording it as artifact in the build-info. -> jfrog rt npmp npm --build-name my-npm-build --build-number 1 +``` +jf rt bag my-npm-build 1 +``` -Publish the build info to Artifactory. -> jfrog rt bp my-npm-build 1 +Pack and publish the npm package to Artifactory, while recording it as an artifact in the build-info: + +``` +jf npm publish --build-name my-npm-build --build-number 1 ``` +Publish the build info to Artifactory: + +``` +jf rt bp my-npm-build 1 +``` diff --git a/python-example/pip-example/README.md b/python-example/pip-example/README.md index e37522bb8..7ceecf7cd 100644 --- a/python-example/pip-example/README.md +++ b/python-example/pip-example/README.md @@ -9,7 +9,7 @@ This example demonstrates how to build a Python Pip project with Artifactory, wh 2. Install **pip**. You can use the [Pip Documentation](https://pip.pypa.io/en/stable/installing/) and also [Installing packages using pip and virtual environments](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) 3. Create three Pypi repositories in Artifactory - a local, remote and a virtual repository. You can use the [PyPi Repositories Documentation](https://www.jfrog.com/confluence/display/RTF/PyPI+Repositories). * The remote repository should proxy *https://files.pythonhosted.org* (the default when creating a Pypi remote repository). -* Name the virtual repository *pipy*. +* Name the virtual repository *pypi*. * The virtual repository should include the remote repository. * The virtual repository should have the local repository set as the *Default Deployment Repository*. 4. Make sure **wheel** and **setuptools** are installed. You can use the [Installing Packages Documentation](https://packaging.python.org/tutorials/installing-packages/). @@ -34,36 +34,36 @@ Verify that virtual-environment is activated: > echo $VIRTUAL_ENV Output JFrog CLI version: -> jfrog --version +> jf --version ``` ## Running the Example -CD to the root project directory +'cd' to the root project directory ```console Configure Artifactory: -> jfrog c add +> jf c add Configure the project's resolution repository. You shoud set the virtual repository you created. -> jfrog rt pipc +> jf rt pipc Install project dependencies with pip from Artifactory: -> jfrog rt pipi -r requirements.txt --build-name=my-pip-build --build-number=1 --module=jfrog-python-example +> jf rt pipi -r requirements.txt --build-name=my-pip-build --build-number=1 --module=jfrog-python-example Package the project, create distribution archives (tar.gz and whl): > python setup.py sdist bdist_wheel Upload the packages to the pypi repository in Artifactory: -> jfrog rt u dist/ pypi/ --build-name=my-pip-build --build-number=1 --module=jfrog-python-example +> jf rt u dist/ pypi/ --build-name=my-pip-build --build-number=1 --module=jfrog-python-example Collect environment variables and add them to the build info: -> jfrog rt bce my-pip-build 1 +> jf rt bce my-pip-build 1 Publish the build info to Artifactory: -> jfrog rt bp my-pip-build 1 +> jf rt bp my-pip-build 1 Install published package by installing it from Artifactory using pip: -> jfrog rt pip-install jfrog-python-example +> jf rt pip-install jfrog-python-example Validate package successfully installed: > pip show jfrog-python-example diff --git a/python-example/pipenv-example/README.md b/python-example/pipenv-example/README.md index 9b5f48a8f..b6da937e4 100644 --- a/python-example/pipenv-example/README.md +++ b/python-example/pipenv-example/README.md @@ -9,7 +9,7 @@ This example demonstrates how to build a Python Pipenv project with Artifactory, 2. Install **pipenv**. You can use the [Pip Documentation](https://pipenv.pypa.io/en/latest/) and also [Installing packages using pip and virtual environments](https://realpython.com/pipenv-guide/) 3. Create three Pypi repositories in Artifactory - a local, remote and a virtual repository. You can use the [PyPi Repositories Documentation](https://www.jfrog.com/confluence/display/RTF/PyPI+Repositories). * The remote repository should proxy *https://files.pythonhosted.org* (the default when creating a Pypi remote repository). -* Name the virtual repository *pipy*. +* Name the virtual repository *pypi*. * The virtual repository should include the remote repository. * The virtual repository should have the local repository set as the *Default Deployment Repository*. 4. Make sure **wheel** and **setuptools** are installed. You can use the [Installing Packages Documentation](https://packaging.python.org/tutorials/installing-packages/). @@ -25,35 +25,35 @@ Output pipenv version: > pipenv --version Output JFrog CLI version: -> jfrog --version +> jf --version ``` ## Running the Example -CD to the root project directory +'cd' to the root project directory ```console Configure Artifactory: -> jfrog c add +> jf c add Configure the project's resolution repository. You shoud set the virtual repository you created. -> jfrog pipec +> jf pipec -Install project dependencies with pip from Artifactory: -> jfrog pipenv install --build-name=my-pipenv-build --build-number=1 --module=jfrog-pipenv-example +Install project dependencies with pipenv from Artifactory: +> jf pipenv install --build-name=my-pipenv-build --build-number=1 --module=jfrog-pipenv-example Package the project, create distribution archives (tar.gz and whl): > python setup.py sdist bdist_wheel Upload the packages to the pypi repository in Artifactory: -> jfrog rt u dist/ pypi/ --build-name=my-pipenv-build --build-number=1 --module=jfrog-pipenv-example +> jf rt u dist/ pypi/ --build-name=my-pipenv-build --build-number=1 --module=jfrog-pipenv-example Collect environment variables and add them to the build info: -> jfrog rt bce my-pipenv-build 1 +> jf rt bce my-pipenv-build 1 Publish the build info to Artifactory: -> jfrog rt bp my-pipenv-build 1 +> jf rt bp my-pipenv-build 1 Install published package by installing it from Artifactory using pip: -> jfrog pipenv install jfrog-pipenv-example +> jf pipenv install jfrog-pipenv-example Learn about [Building Python Packages with JFrog CLI](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildingPythonPackages). diff --git a/python-example/poetry-example/README.md b/python-example/poetry-example/README.md new file mode 100644 index 000000000..f169ed613 --- /dev/null +++ b/python-example/poetry-example/README.md @@ -0,0 +1,58 @@ +# Pipenv Example + +## Overview +This example demonstrates how to build a Python Poetry project with Artifactory, while collecting build-info. + +## Before Running the Example +### Set Up the Environment +1. Make sure **Python** is installed and the **python** command is in your PATH. +2. Install **poetry**. You can use the [Poetry Documentation](https://python-poetry.org/docs/). +3. Create three Pypi repositories in Artifactory - a local, remote and a virtual repository. You can use the [PyPi Repositories Documentation](https://www.jfrog.com/confluence/display/RTF/PyPI+Repositories). +* The remote repository should proxy *https://files.pythonhosted.org* (the default when creating a Pypi remote repository). +* Name the virtual repository *pypi*. +* The virtual repository should include the remote repository. +* The virtual repository should have the local repository set as the *Default Deployment Repository*. +4. Make sure version 2.27.0 or above of [JFrog CLI](https://jfrog.com/getcli/) is installed. + +### Validate the Setup +In your terminal, validate that the following commands work. +```console +Output Python version: +> python --version + +Output pipenv version: +> poetry --version + +Output JFrog CLI version: +> jf --version +``` + +## Running the Example +'cd' to the root project directory + +```console +Configure Artifactory: +> jf c add + +Configure the project's resolution repository. You shoud set the virtual repository you created. +> jf poetry-config + +Install project dependencies with poetry from Artifactory: +> jf poetry install --build-name=my-poetry-build --build-number=1 --module=jfrog-poetry-example + +Package the project, create distribution archives (tar.gz and whl): +> jf build + +Upload the packages to the pypi repository in Artifactory: +> jf rt u dist/ pypi/ --build-name=my-poetry-build --build-number=1 --module=jfrog-poetry-example + +Collect environment variables and add them to the build info: +> jf rt bce my-poetry-build 1 + +Publish the build info to Artifactory: +> jf rt bp my-poetry-build 1 + +Install published package by installing it from Artifactory using pip: +> jf poetry install jfrog-pipenv-example + +Learn about [Building Python Packages with JFrog CLI](https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildingPythonPackages). diff --git a/python-example/poetry-example/hello.py b/python-example/poetry-example/hello.py new file mode 100644 index 000000000..e59e04407 --- /dev/null +++ b/python-example/poetry-example/hello.py @@ -0,0 +1,4 @@ +import numpy as np + +arr = np.array([1, 2, 3, 4, 5]) +print(arr) diff --git a/python-example/poetry-example/pyproject.toml b/python-example/poetry-example/pyproject.toml new file mode 100644 index 000000000..bec1dcfd8 --- /dev/null +++ b/python-example/poetry-example/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "my-poetry-project" +version = "1.1.0" +description = "" +authors = ["Severus Snape "] + +[tool.poetry.dependencies] +python = "^3.10" +numpy = "^1.23.0" + +[tool.poetry.dev-dependencies] +pytest = "^5.2" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/terraform-example/README.md b/terraform-example/README.md index b2203e5d3..0c68c116f 100644 --- a/terraform-example/README.md +++ b/terraform-example/README.md @@ -1,5 +1,3 @@ -## This example and documentation are for the Beta v.1 of the Terraform Repositories, available exclusively to JFrog Beta customers. - # Terraform Example ## Overview @@ -18,14 +16,14 @@ Output JFrog CLI version: ``` ## Running the Example -CD to the root project directory +'cd' to the root project directory ```console Configure Artifactory: > jf c add Configure the project's deployment repository. You shoud set the local repository you created. -> jf rt tfc +> jf tfc CD to directory which contains the modules. for example "aws" directory. > cd aws @@ -40,4 +38,4 @@ You can exclude files and directories from being scanned by the commandm using t ## How are the modules packed and published? The jf tf command scans the local file-system under the current working directory recursively. It searches for directories which includes at least one file with a .tf extension. Such a directory is assumed to be a terraform module, and it is therefore packed into one zip file (including submodules directories) and then published to Artifactory. -There isn't any recursive scanning inside the module directory after it is packed. This means that sub-nodules aren't packed and deployed separately to Artifactory. \ No newline at end of file +There isn't any recursive scanning inside the module directory after it is packed. This means that sub-nodules aren't packed and deployed separately to Artifactory.